@sava-info-systems/api-maker-with-extensions 1.7.0 → 1.8.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/6236.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6236],{4491:(C,E,s)=>{s.d(E,{g:()=>q});var m=s(5861),r=s(95),c=s(3157),l=s(328),u=s(9361),I=s(1162),p=s(553),D=s(5085),M=s(1601),f=s(3531),h=s(9989),e=s(4946),v=s(9961),P=s(7240),O=s(7414),T=s(2694),A=s(5852),S=s(2304),Z=s(3429),U=s(2915),F=s(3835),z=s(6814),R=s(2660),b=s(5860),y=s(756),x=s(7680),g=s(4844),L=s(3259),B=s(5025);const W=["insertCodeModalC"],K=["monacoEditorModalC"];function N(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Add Process Initializer"),e.qZA())}function J(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," View Process Initializer"),e.qZA())}function Y(i,_){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," Edit Process Initializer "),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(4),e.Oqu(o.form.get("name").value)}}function w(i,_){1&i&&(e.TgZ(0,"span",39),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function V(i,_){if(1&i&&(e.TgZ(0,"div")(1,"form",31)(2,"div",32)(3,"label",33),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",34),e._UZ(6,"input",35),e.YNc(7,w,2,0,"span",36),e.qZA()(),e.TgZ(8,"div",32)(9,"label",33),e._uU(10,"Order"),e.qZA(),e.TgZ(11,"div",34),e._UZ(12,"input",37),e.qZA()(),e.TgZ(13,"div",32)(14,"label",33),e._uU(15,"Timeout in minutes"),e.qZA(),e.TgZ(16,"div",34),e._UZ(17,"input",38),e.qZA()()()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("formGroup",o.form),e.xp6(6),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD)}}function Q(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"div",40)(1,"app-monaco-editor",41),e.NdJ("editorGenerated",function(t){e.CHM(o);const n=e.oxw();return e.KtG(n.editorGenerated(t))}),e.qZA()()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",o.editorOptionsProcessInitializer)}}function G(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"a",42),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function k(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function j(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.save())}),e._UZ(1,"i",44),e.YNc(2,H,2,0,"span",4),e.YNc(3,k,2,0,"span",4),e.qZA()}if(2&i){const o=e.oxw();e.Q6J("disabled",o.form.invalid),e.xp6(2),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT)}}function X(i,_){1&i&&e._UZ(0,"p-progressSpinner",45)}let q=(()=>{class i{fb;ns;generalS;constantsS;processInitializersS;authCS;monacoS;instanceS;eventCenterS;generalCS;userS;cd;data;loading={form:!1};EFormMode=l.D;form;subscriptions=[];formData;IEventData=c.F;id;BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptionsProcessInitializer={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(o,a,t,n,d,ee,oe,te,se,ae,ie,ne){this.fb=o,this.ns=a,this.generalS=t,this.constantsS=n,this.processInitializersS=d,this.authCS=ee,this.monacoS=oe,this.instanceS=te,this.eventCenterS=se,this.generalCS=ae,this.userS=ie,this.cd=ne}ngOnInit(){var o=this;return(0,m.Z)(function*(){o.createForm(),o.subscriptions.push(o.data.eventChannel.subscribe(function(){var a=(0,m.Z)(function*(t){if(t)if(o.form.enable(),t.action===c.F.OPEN_FORM_IN_EDIT_MODE)yield o.editViewLoadData(),o.form.get("name").disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_VIEW_MODE)yield o.editViewLoadData(),o.form.disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_ADD_MODE){o.form.reset(),o.form.patchValue(t.data||{});const n=yield o.instanceS.getDefaultContent(o.BE_HOST_PORT,D.R.PROCESS_INITIALIZER).toPromise();o.editorOptionsProcessInitializer={readOnly:!1},o.generalCS.setValueInEditor(o,"editorPI",n.data),o.cd.detectChanges()}});return function(t){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var o=this;return(0,m.Z)(function*(){const a=yield o.processInitializersS.getById(o.data.formData._id).toPromise();o.form.reset(),o.form.patchValue(a.data),o.generalCS.setValueInEditor(o,"editorPI",a.data?.processInitializerCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[r.kI.required]],order:[null,[r.kI.required]],processInitializerTimeoutInMinutes:[null,[]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idProcessInitializerForm").modal("show")},100)}hideModal(){$("#idProcessInitializerForm").modal("hide")}save(){var o=this;return(0,m.Z)(function*(){const a=o.form.getRawValue();let t;t=o.data.formData&&o.data.formData._id?(yield o.processInitializersS.getById(o.data.formData._id).toPromise()).data:{};const n=Object.assign({},t,a);n.user=o.authCS.getUserId(),n.processInitializerCode=o.editorPI.getValue();try{let d;o.loading.form=!0,o.lastError=void 0,o.monacoS.clearEditorDecorations(o.editorPI,o.monacoDecorations),o.data.mode===l.D.ADD?d=yield o.processInitializersS.post(n).toPromise():o.data.mode===l.D.EDIT&&(d=yield o.processInitializersS.put(n._id,n,{select:I.iH._id}).toPromise()),o.ns.showSuccess(o.data.mode===l.D.ADD?o.constantsS.processInitializer.addSuccess:o.constantsS.processInitializer.editSuccess),o.data.eventChannel.emit({action:o.data.mode===l.D.ADD?c.F.SAVED:c.F.UPDATED,data:d}),o.eventCenterS.processInitializersSavedAndUpdate.next(!0),o.loading.form=!1}catch(d){o.loading.form=!1,o.ns.showErrorFromResponse(d.error||d,"Unable to save process initializer."),o.lastError=d.error,o.tab={axiosResponse:{data:d.error}},o.monacoS.highlightErrorInMonacoEditor(o.editorPI,o.tab,"MainSandbox.ts",o.monacoDecorations)}o.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=u.H.All,this.insertCodeModalC.showModal(f.b.ProcessInitializersFormC).then()}editorGenerated(o){var a=this;return(0,m.Z)(function*(){a.editorPI=o,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(o,t=>{a.form.valid&&a.save()}),a.monacoS.addInsertCodeKeyBinding(o,t=>{a.generalCS.messageReceivedFor=u.H.All,a.data.mode!==l.D.VIEW&&a.insertCodeModalC.showModal(f.b.ProcessInitializersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(t=>{t.type&&t.type===h.g.TEXT_COPIED&&t.componentName===f.b.ProcessInitializersFormC&&(a.monacoS.insertAtCursor(o,t.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.processInitializersSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.Y36(r.qu),e.Y36(v.W),e.Y36(P.b),e.Y36(O.L),e.Y36(T.e),e.Y36(A.D),e.Y36(S.b),e.Y36(Z.E),e.Y36(U.u),e.Y36(P.b),e.Y36(F.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-process-initializers-form"]],viewQuery:function(a,t){if(1&a&&(e.Gf(W,5),e.Gf(K,5)),2&a){let n;e.iGM(n=e.CRH())&&(t.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(t.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:32,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idProcessInitializerForm","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",3,"click"],["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/features/process-initializers.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",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",3,"click"],[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,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[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,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["class","mt-1px small",4,"ngIf"],["formControlName","order","name","order","spellcheck","false","type","number","placeholder","Please provide order",1,"form-control","form-control-sm"],["formControlName","processInitializerTimeoutInMinutes","name","processInitializerTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm"],[1,"mt-1px","small"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[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(a,t){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,N,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return t.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return t.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.YNc(18,V,18,2,"div",4),e.qZA(),e.TgZ(19,"p-tabPanel",15),e.YNc(20,Q,2,2,"div",16),e.qZA()()(),e.TgZ(21,"div",17),e.YNc(22,G,2,0,"a",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return t.hideModal()}),e._UZ(24,"i",20),e._uU(25," Close"),e.qZA(),e.YNc(26,j,4,3,"button",21),e.qZA(),e.YNc(27,X,1,0,"p-progressSpinner",22),e.qZA()()(),e._UZ(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&a&&(e.xp6(4),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.lastError),e.xp6(4),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysProcessInitializer")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[r._Y,r.Fj,r.wV,r.JJ,r.JL,r.sg,r.u,z.O5,R.y,b.P,y.O,x.G,g.xf,g.x4,L.u,B.A],encapsulation:2,changeDetection:0})}return i})()},6236:(C,E,s)=>{s.d(E,{e:()=>I});var m=s(8176),c=(s(4491),s(4950)),l=s(4946);let I=(()=>{class p{static \u0275fac=function(f){return new(f||p)};static \u0275mod=l.oAB({type:p});static \u0275inj=l.cJS({imports:[m.u,c.A]})}return p})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6236],{4491:(C,E,s)=>{s.d(E,{g:()=>q});var m=s(5861),r=s(95),c=s(3157),l=s(328),u=s(9361),I=s(1162),p=s(553),D=s(5085),M=s(1601),f=s(3531),h=s(9989),e=s(4946),v=s(9961),P=s(7240),O=s(7414),T=s(2694),A=s(5852),S=s(2304),Z=s(3429),U=s(2915),F=s(3835),b=s(6814),z=s(2660),R=s(5860),y=s(756),x=s(7680),g=s(4844),L=s(3259),B=s(5025);const W=["insertCodeModalC"],K=["monacoEditorModalC"];function N(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Add Process Initializer"),e.qZA())}function J(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," View Process Initializer"),e.qZA())}function Y(i,_){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," Edit Process Initializer "),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(4),e.Oqu(o.form.get("name").value)}}function w(i,_){1&i&&(e.TgZ(0,"span",39),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function V(i,_){if(1&i&&(e.TgZ(0,"div")(1,"form",31)(2,"div",32)(3,"label",33),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",34),e._UZ(6,"input",35),e.YNc(7,w,2,0,"span",36),e.qZA()(),e.TgZ(8,"div",32)(9,"label",33),e._uU(10,"Order"),e.qZA(),e.TgZ(11,"div",34),e._UZ(12,"input",37),e.qZA()(),e.TgZ(13,"div",32)(14,"label",33),e._uU(15,"Timeout in minutes"),e.qZA(),e.TgZ(16,"div",34),e._UZ(17,"input",38),e.qZA()()()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("formGroup",o.form),e.xp6(6),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD)}}function Q(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"div",40)(1,"app-monaco-editor",41),e.NdJ("editorGenerated",function(t){e.CHM(o);const n=e.oxw();return e.KtG(n.editorGenerated(t))}),e.qZA()()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",o.editorOptionsProcessInitializer)}}function G(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"a",42),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function k(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function j(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.save())}),e._UZ(1,"i",44),e.YNc(2,H,2,0,"span",4),e.YNc(3,k,2,0,"span",4),e.qZA()}if(2&i){const o=e.oxw();e.Q6J("disabled",o.form.invalid),e.xp6(2),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT)}}function X(i,_){1&i&&e._UZ(0,"p-progressSpinner",45)}let q=(()=>{class i{fb;ns;generalS;constantsS;processInitializersS;authCS;monacoS;instanceS;eventCenterS;generalCS;userS;cd;data;loading={form:!1};EFormMode=l.D;form;subscriptions=[];formData;IEventData=c.F;id;BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptionsProcessInitializer={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(o,a,t,n,d,ee,oe,te,se,ae,ie,ne){this.fb=o,this.ns=a,this.generalS=t,this.constantsS=n,this.processInitializersS=d,this.authCS=ee,this.monacoS=oe,this.instanceS=te,this.eventCenterS=se,this.generalCS=ae,this.userS=ie,this.cd=ne}ngOnInit(){var o=this;return(0,m.Z)(function*(){o.createForm(),o.subscriptions.push(o.data.eventChannel.subscribe(function(){var a=(0,m.Z)(function*(t){if(t)if(o.form.enable(),t.action===c.F.OPEN_FORM_IN_EDIT_MODE)yield o.editViewLoadData(),o.form.get("name").disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_VIEW_MODE)yield o.editViewLoadData(),o.form.disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_ADD_MODE){o.form.reset(),o.form.patchValue(t.data||{});const n=yield o.instanceS.getDefaultContent(o.BE_HOST_PORT,D.R.PROCESS_INITIALIZER).toPromise();o.editorOptionsProcessInitializer={readOnly:!1},o.generalCS.setValueInEditor(o,"editorPI",n.data),o.cd.detectChanges()}});return function(t){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var o=this;return(0,m.Z)(function*(){const a=yield o.processInitializersS.getById(o.data.formData._id).toPromise();o.form.reset(),o.form.patchValue(a.data),o.generalCS.setValueInEditor(o,"editorPI",a.data?.processInitializerCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[r.kI.required]],order:[null,[r.kI.required]],processInitializerTimeoutInMinutes:[null,[]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idProcessInitializerForm").modal("show")},100)}hideModal(){$("#idProcessInitializerForm").modal("hide")}save(){var o=this;return(0,m.Z)(function*(){const a=o.form.getRawValue();let t;t=o.data.formData&&o.data.formData._id?(yield o.processInitializersS.getById(o.data.formData._id).toPromise()).data:{};const n=Object.assign({},t,a);n.user=o.authCS.getUserId(),n.processInitializerCode=o.editorPI.getValue();try{let d;o.loading.form=!0,o.lastError=void 0,o.monacoS.clearEditorDecorations(o.editorPI,o.monacoDecorations),o.data.mode===l.D.ADD?d=yield o.processInitializersS.post(n).toPromise():o.data.mode===l.D.EDIT&&(d=yield o.processInitializersS.put(n._id,n,{select:I.iH._id}).toPromise()),o.ns.showSuccess(o.data.mode===l.D.ADD?o.constantsS.processInitializer.addSuccess:o.constantsS.processInitializer.editSuccess),o.data.eventChannel.emit({action:o.data.mode===l.D.ADD?c.F.SAVED:c.F.UPDATED,data:d}),o.eventCenterS.processInitializersSavedAndUpdate.next(!0),o.loading.form=!1}catch(d){o.loading.form=!1,o.ns.showErrorFromResponse(d.error||d,"Unable to save process initializer."),o.lastError=d.error,o.tab=o.tab||{},o.tab.axiosResponse={data:d.error},o.monacoS.highlightErrorInMonacoEditor(o.editorPI,o.tab,"MainSandbox.ts",o.monacoDecorations)}o.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=u.H.All,this.insertCodeModalC.showModal(f.b.ProcessInitializersFormC).then()}editorGenerated(o){var a=this;return(0,m.Z)(function*(){a.editorPI=o,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(o,t=>{a.form.valid&&a.save()}),a.monacoS.addInsertCodeKeyBinding(o,t=>{a.generalCS.messageReceivedFor=u.H.All,a.data.mode!==l.D.VIEW&&a.insertCodeModalC.showModal(f.b.ProcessInitializersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(t=>{t.type&&t.type===h.g.TEXT_COPIED&&t.componentName===f.b.ProcessInitializersFormC&&(a.monacoS.insertAtCursor(o,t.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.processInitializersSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.Y36(r.qu),e.Y36(v.W),e.Y36(P.b),e.Y36(O.L),e.Y36(T.e),e.Y36(A.D),e.Y36(S.b),e.Y36(Z.E),e.Y36(U.u),e.Y36(P.b),e.Y36(F.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-process-initializers-form"]],viewQuery:function(a,t){if(1&a&&(e.Gf(W,5),e.Gf(K,5)),2&a){let n;e.iGM(n=e.CRH())&&(t.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(t.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:32,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idProcessInitializerForm","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",3,"click"],["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/features/process-initializers.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",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",3,"click"],[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,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[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,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["class","mt-1px small",4,"ngIf"],["formControlName","order","name","order","spellcheck","false","type","number","placeholder","Please provide order",1,"form-control","form-control-sm"],["formControlName","processInitializerTimeoutInMinutes","name","processInitializerTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm"],[1,"mt-1px","small"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[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(a,t){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,N,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return t.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return t.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.YNc(18,V,18,2,"div",4),e.qZA(),e.TgZ(19,"p-tabPanel",15),e.YNc(20,Q,2,2,"div",16),e.qZA()()(),e.TgZ(21,"div",17),e.YNc(22,G,2,0,"a",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return t.hideModal()}),e._UZ(24,"i",20),e._uU(25," Close"),e.qZA(),e.YNc(26,j,4,3,"button",21),e.qZA(),e.YNc(27,X,1,0,"p-progressSpinner",22),e.qZA()()(),e._UZ(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&a&&(e.xp6(4),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.lastError),e.xp6(4),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysProcessInitializer")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[r._Y,r.Fj,r.wV,r.JJ,r.JL,r.sg,r.u,b.O5,z.y,R.P,y.O,x.G,g.xf,g.x4,L.u,B.A],encapsulation:2,changeDetection:0})}return i})()},6236:(C,E,s)=>{s.d(E,{e:()=>I});var m=s(8176),c=(s(4491),s(4950)),l=s(4946);let I=(()=>{class p{static \u0275fac=function(f){return new(f||p)};static \u0275mod=l.oAB({type:p});static \u0275inj=l.cJS({imports:[m.u,c.A]})}return p})()}}]);
package/dist/7368.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7368],{7368:(xe,S,s)=>{s.r(S),s.d(S,{SandboxSettingsM:()=>fe});var O=s(7664),D=s(3726),y=s(8176),M=s(2443),d=s(5861),e=s(4946),_=s(6990),v=s(3157),c=s(328),k=s(1162),h=s(553),U=s(4371),x=s(5852),b=s(3835),w=s(5405),Z=s(9961),p=s(5219),T=s(7414),I=s(2304),N=s(4977),P=s(3429),E=s(1344),J=s(7240),g=s(95),u=s(6814),G=s(8147),R=s(1861),K=s(756),f=s(5431),Y=s(7680),C=s(4844),A=s(3259),q=s(2660);function F(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th",28),e._uU(4,"Action"),e.qZA()())}function H(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",31)(1,"button",32),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.editAllowedOrigin(n,a))}),e._UZ(2,"i",33),e.qZA(),e.TgZ(3,"button",34),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.removeAllowedOrigin(n,a))}),e._UZ(4,"i",35),e.qZA()()}}function L(o,l){if(1&o&&(e.TgZ(0,"tr",29)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,H,5,0,"div",30),e.qZA()()),2&o){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",!t.isReadOnly)}}function Q(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",37),e.TgZ(2,"span"),e._uU(3,"Save"),e.qZA()()}}let V=(()=>{class o{authCS;userS;eventCenterCS;notificationS;cs;confirmationService;modalId="idAllowedOriginModal";subscriptions=[];allowedOriginsGridData=[];saveSettings=new e.vpe;gridKeyAllowedOrigins="name";allowedOriginModel={domainName:"",domainNameBak:""};exampleOrigin=location.origin;allowedOriginData={mode:c.D.ADD};EFormMode=c.D;selectedRowsUI=[];constructor(t,i,n,a,r,m){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=a,this.cs=r,this.confirmationService=m}ngOnInit(){}save(){var t=this;return(0,d.Z)(function*(){if(t.allowedOriginData.mode===c.D.ADD)t.allowedOriginsGridData.push({name:t.allowedOriginModel.domainName});else{const i=t.allowedOriginsGridData.findIndex(n=>n.name===t.allowedOriginModel.domainNameBak);t.allowedOriginsGridData[i].name=t.allowedOriginModel.domainName}t.allowedOriginsGridData=_.uniqBy(t.allowedOriginsGridData,"name"),t.saveSettings.emit(),t.hideAllowedOriginModal()})()}showAllowedOriginModal(){$("#idAllowedOriginModal").modal("show")}hideAllowedOriginModal(){$("#idAllowedOriginModal").modal("hide")}addAllowedOrigin(){var t=this;return(0,d.Z)(function*(){t.allowedOriginModel.domainNameBak=t.allowedOriginModel.domainName="",t.allowedOriginData.mode=c.D.ADD,t.showAllowedOriginModal()})()}editAllowedOrigin(t,i){var n=this;return(0,d.Z)(function*(){n.allowedOriginModel.domainNameBak=n.allowedOriginModel.domainName=i.name,n.allowedOriginData.mode=c.D.EDIT,n.showAllowedOriginModal()})()}doubleClick(){this.editAllowedOrigin(null,this.selectedRowsUI[0]).then()}removeAllowedOrigin(t,i){var n=this;return(0,d.Z)(function*(){var a;n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentAllowedOriginConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){yield n.removeAO(t,i)}),function(){return a.apply(this,arguments)})})})()}removeAO(t,i){var n=this;return(0,d.Z)(function*(){const a=n.allowedOriginsGridData.findIndex(r=>r.name===i.name);n.allowedOriginsGridData.splice(a,1),n.saveSettings.emit()})()}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||o)(e.Y36(x.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(T.L),e.Y36(p.YP))};static \u0275cmp=e.Xpm({type:o,selectors:[["allowed-origin-c"]],inputs:{allowedOriginsGridData:["allowedOrigins","allowedOriginsGridData"]},outputs:{saveSettings:"saveSettings"},decls:37,vars:10,consts:[[1,"card","shadow-sm","mt-2","mr-1","mb-5",2,"height","384px"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],["pTooltip","Add New",1,"float-right","cursor-pointer","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"card-body","p-0","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","350px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["aria-hidden","true","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",3,"id"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body"],[1,"form-group","row","mt-3","mb-0"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","name","spellcheck","false","type","text","placeholder","Please provide domain name",1,"form-control","form-control-sm",3,"ngModel","blur","ngModelChange"],[1,"form-group","row"],[1,"col-form-label","col-form-label-sm","text-info","font-monospaced"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],[2,"width","100px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[1,"text-center"],["pTooltip","Edit","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","tooltipPosition","left",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Allowed Origins"),e.qZA(),e.TgZ(5,"span",3),e.NdJ("click",function(){return n.addAllowedOrigin()}),e._UZ(6,"i",4),e.qZA()(),e.TgZ(7,"div",5)(8,"p-table",6),e.NdJ("selectionChange",function(r){return n.selectedRowsUI=r})("dblclick",function(){return n.doubleClick()}),e.YNc(9,F,5,0,"ng-template",7),e.YNc(10,L,5,3,"ng-template",8),e.qZA()()(),e.TgZ(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"span"),e._UZ(16,"i",13),e._uU(17," Allowed Origins"),e.qZA(),e.TgZ(18,"button",14)(19,"span",15),e._UZ(20,"i",16),e.qZA()()(),e.TgZ(21,"div",17)(22,"div",18)(23,"label",19),e._uU(24,"Domain name"),e.qZA(),e.TgZ(25,"div",20)(26,"input",21),e.NdJ("blur",function(){return n.allowedOriginModel.domainName=n.allowedOriginModel.domainName.toLowerCase()})("ngModelChange",function(r){return n.allowedOriginModel.domainName=r}),e.qZA()()(),e.TgZ(27,"div",22),e._UZ(28,"label",19),e.TgZ(29,"div",20)(30,"label",23),e._uU(31),e.qZA()()()(),e.TgZ(32,"div",24)(33,"button",25),e._UZ(34,"i",26),e._uU(35," Close"),e.qZA(),e.YNc(36,Q,4,0,"button",27),e.qZA()()()()),2&i&&(e.xp6(8),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRowsUI)("dataKey",n.gridKeyAllowedOrigins)("scrollable",!0)("value",n.allowedOriginsGridData),e.xp6(3),e.s9C("id",n.modalId),e.xp6(15),e.Q6J("ngModel",n.allowedOriginModel.domainName),e.xp6(5),e.hij("(Ex: ",n.exampleOrigin,")"),e.xp6(5),e.Q6J("ngIf",n.allowedOriginData.mode!==n.EFormMode.VIEW))},dependencies:[g.Fj,g.JJ,g.On,u.O5,q.y,f.iA,p.jx,f.Ei,A.u],encapsulation:2})}return o})();const B=["addNpmLibC"],j=["allowedOriginC"],W=["SandboxSettingsPkgVersionsModalC"];function z(o,l){1&o&&(e.TgZ(0,"tr"),e._UZ(1,"th",46)(2,"th",47),e.TgZ(3,"th",48),e._uU(4,"Version"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Name"),e.qZA(),e.TgZ(7,"th",49),e._uU(8,"Sub Dependencies"),e.qZA(),e.TgZ(9,"th",50),e._uU(10,"Third Party API"),e.qZA(),e.TgZ(11,"th",51),e._uU(12,"Default"),e.qZA(),e.TgZ(13,"th",52),e._uU(14,"Action"),e.qZA()())}function X(o,l){1&o&&e._UZ(0,"i",61)}function ee(o,l){1&o&&e._UZ(0,"i",62)}function te(o,l){if(1&o&&(e.TgZ(0,"div",64),e._uU(1),e.qZA()),2&o){const t=l.$implicit;e.xp6(1),e.AsE("",t.name," @",t.version,"")}}function ne(o,l){if(1&o&&(e.TgZ(0,"div"),e.YNc(1,te,2,2,"div",63),e.qZA()),2&o){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.dependencies)}}function ie(o,l){1&o&&e._UZ(0,"i",65)}function oe(o,l){1&o&&e._UZ(0,"i",65)}function ae(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",58)(1,"button",66),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return e.KtG(r.editData(n,a))}),e._UZ(2,"i",67),e.qZA(),e.TgZ(3,"button",68),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return e.KtG(r.removePermanentDialog(n,a))}),e._UZ(4,"i",69),e.qZA()()}}function se(o,l){if(1&o&&(e.TgZ(0,"tr",53)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,X,1,0,"i",54),e.YNc(5,ee,1,0,"i",55),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",56),e.YNc(12,ne,2,1,"div",57),e.qZA()(),e.TgZ(13,"td",58),e.YNc(14,ie,1,0,"i",59),e.qZA(),e.TgZ(15,"td",58),e.YNc(16,oe,1,0,"i",59),e.qZA(),e.TgZ(17,"td"),e.YNc(18,ae,5,0,"div",60),e.qZA()()),2&o){const t=l.$implicit,i=l.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Q6J("ngIf",t.active),e.xp6(1),e.Q6J("ngIf",!t.active),e.xp6(2),e.Oqu(t.version),e.xp6(2),e.Oqu(t.name),e.xp6(3),e.Q6J("ngForOf",t.subDependencies),e.xp6(2),e.Q6J("ngIf",t.isThirdPartyApi),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",!t.isReadOnly)}}function le(o,l){1&o&&(e.TgZ(0,"tr"),e._UZ(1,"th",46),e.TgZ(2,"th",48),e._uU(3,"Version"),e.qZA(),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th",70),e._uU(7,"Third Party API"),e.qZA(),e.TgZ(8,"th",48),e._uU(9,"Default"),e.qZA()())}function re(o,l){1&o&&e._UZ(0,"i",65)}function de(o,l){1&o&&e._UZ(0,"i",65)}function ce(o,l){if(1&o&&(e.TgZ(0,"tr",53)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e.YNc(8,re,1,0,"i",59),e.qZA(),e.TgZ(9,"td"),e.YNc(10,de,1,0,"i",59),e.qZA()()),2&o){const t=l.$implicit,i=l.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.version),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isThirdPartyApi),e.xp6(2),e.Q6J("ngIf",t.isDefault)}}function ge(o,l){1&o&&e._UZ(0,"p-progressSpinner",71)}function me(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",5)(1,"div",6)(2,"button",7),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.loadGridData())}),e._UZ(3,"i",8),e._uU(4," Refresh "),e.qZA(),e.TgZ(5,"button",9),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e._UZ(6,"i",10),e._uU(7," Save "),e.qZA()(),e.TgZ(8,"div",11)(9,"div",12)(10,"span"),e._UZ(11,"i",13),e._uU(12," Settings"),e.qZA()(),e.TgZ(13,"div",14)(14,"div",15)(15,"div",16)(16,"label",17),e._uU(17,"Sandbox Count"),e.qZA(),e.TgZ(18,"input",18),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.settings.sandbox.sandboxCountOverrideAdmin=n)}),e.qZA(),e.TgZ(19,"div",19)(20,"span",20)(21,"span"),e._uU(22,"1 CPU core will have one process and one process will have these many sandbox."),e.qZA(),e._UZ(23,"br"),e.TgZ(24,"span"),e._uU(25,"Ideally it should be 1-2."),e.qZA()()()()()()(),e.TgZ(26,"div",11)(27,"div",12)(28,"span"),e._UZ(29,"i",21),e._uU(30," Sandbox Dependencies"),e.qZA(),e.TgZ(31,"div",22)(32,"a",23),e._UZ(33,"img",24),e.qZA()(),e.TgZ(34,"span",25),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showLibraryModel())}),e._UZ(35,"i",26),e.qZA()(),e.TgZ(36,"div",27)(37,"p-tabView",28)(38,"p-tabPanel",29)(39,"p-table",30),e.NdJ("selectionChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.selectedRowsUI=n)})("dblclick",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.summaryTableDoubleClick())}),e.YNc(40,z,15,0,"ng-template",31),e.YNc(41,se,19,10,"ng-template",32),e.qZA()(),e.TgZ(42,"p-tabPanel",33)(43,"p-table",34),e.NdJ("selectionChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.selectedRowsPackageJson=n)}),e.YNc(44,le,10,0,"ng-template",31),e.YNc(45,ce,11,6,"ng-template",32),e.qZA()()(),e.YNc(46,ge,1,0,"p-progressSpinner",35),e.qZA()(),e.TgZ(47,"div",11)(48,"div",12)(49,"span"),e._UZ(50,"i",36),e._uU(51," Docker File"),e.qZA(),e.TgZ(52,"span",37),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.resetDockerfileToDefault())}),e._UZ(53,"i",38),e.qZA(),e.TgZ(54,"span",39),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showDockerImageBuildLogs())}),e._UZ(55,"i",40),e.qZA()(),e.TgZ(56,"div",41)(57,"app-monaco-editor",42),e.NdJ("editorGenerated",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.editorGenerated(n))}),e.qZA()()(),e.TgZ(58,"allowed-origin-c",43,44),e.NdJ("saveSettings",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e.qZA(),e.TgZ(60,"div",45),e._uU(61,"\xa0"),e.qZA()()}if(2&o){const t=e.oxw();e.xp6(18),e.Q6J("ngModel",t.settings.sandbox.sandboxCountOverrideAdmin),e.xp6(21),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRowsUI)("dataKey",t.gridKey)("scrollable",!0)("value",t.packageSummary),e.xp6(4),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRowsPackageJson)("dataKey",t.gridKey)("scrollable",!0)("value",t.finalPackageJson),e.xp6(3),e.Q6J("ngIf",t.loading.form),e.xp6(11),e.Q6J("editorOptions",t.editorOptionsDocker),e.xp6(1),e.Q6J("allowedOrigins",t.settings.allowedOrigins)}}const pe=[{path:"main",component:(()=>{class o{authCS;userS;eventCenterCS;notificationS;confirmationService;cs;monacoS;tpStoreApiVersionS;instanceS;feStoreCS;generalCS;STORE_BE_HOST_PORT=h.N.STORE_BE_HOST_PORT;BE_HOST_PORT=h.N.BE_HOST_PORT;subscriptions=[];data={mode:c.D.ADD,eventChannel:new e.vpe,formData:void 0};packageSummary=[];selectedRowsUI=[];gridKey="rowId";counter;EFormMode=c.D;finalPackageJson=[];selectedRowsPackageJson=[];showAll=!1;loading={form:!1};settings;tpNpmPackageAndVersion={};tpApiVersionIdMap;tpApiBundleIdMap;editorDocker;editorOptionsDocker={readOnly:!1,language:"dockerfile",contextmenu:!0};addNpmLibC;allowedOriginC;SandboxSettingsPkgVersionsModalC;constructor(t,i,n,a,r,m,_e,ue,Se,ve,he){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=a,this.confirmationService=r,this.cs=m,this.monacoS=_e,this.tpStoreApiVersionS=ue,this.instanceS=Se,this.feStoreCS=ve,this.generalCS=he}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.subscriptions.push(t.eventCenterCS.sandboxDep.subscribe(i=>{if(t.data.mode===c.D.ADD){for(const n of t.packageSummary)if(n.name===i.name&&n.isDefault)return void t.notificationS.showError("You can not override default package.");t.packageSummary.unshift(i),t.rowIdSet(),t.notificationS.showSuccess(t.cs.amUserSandboxDepSetting.addSuccess),t.addNpmLibC.hideModal()}})),yield t.loadGridData(),t.generalCS.setNewTitle("API Maker - Sandbox Settings")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){const i=yield t.userS.getAdminSettings(t.authCS.getUserId()).toPromise();t.settings=i.data||{},t.packageSummary=t.settings.sandbox.dependenciesUI.nodeJS,t.finalPackageJson=t.settings.sandbox.dependencies.nodeJS;const n=t.settings.allowedOrigins||[];n.sort(),t.settings.allowedOrigins=_.map(n,a=>({name:a})),t.rowIdSet();for(const a of t.finalPackageJson)a.rowId=(t.counter++).toString();t.generalCS.setValueInEditor(t,"editorDocker",t.settings.dockerFile||"")})()}editorGenerated(t){var i=this;return(0,d.Z)(function*(){i.editorDocker=t,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(t,n=>{i.saveSettings()})})()}rowIdSet(){this.counter=1;for(const t of this.packageSummary)t.rowId=(this.counter++).toString()}showLibraryModel(){this.data.formData=void 0,this.data.mode=c.D.ADD,this.data.eventChannel.emit({action:v.F.OPEN_FORM_IN_ADD_MODE}),this.addNpmLibC.showModal()}saveSettings(t){var i=this;return(0,d.Z)(function*(){try{const n=i.authCS.getUserId();if(i?.settings?.sandbox?.sandboxCountOverrideAdmin>5)return void i.notificationS.showError("More than 5 sandbox are not allowed.");const a={settings:{sandbox:{sandboxCountOverrideAdmin:i.settings.sandbox.sandboxCountOverrideAdmin,dependencies:{nodeJS:i.packageSummary.filter(m=>!m.isReadOnly&&!m.isThirdPartyApi&&!m.isDefault)}},dockerFile:i.editorDocker.getValue(),allowedOrigins:_.map(i.allowedOriginC.allowedOriginsGridData,"name").sort()}};(yield i.userS.put(n,a,{select:k.iH._id}).toPromise())&&(t===c.D.EDIT?i.notificationS.showSuccess(i.cs.amUserSandboxDepSetting.editSuccess):"DELETE"===t?i.notificationS.showSuccess(i.cs.amUserSandboxDepSetting.removePermanent):t||i.notificationS.showSuccess("Success")),i.loadGridData().then()}catch(n){i.loading.form=!1,i.notificationS.showErrorFromResponse(n.error||n,"Unable to save settings.")}})()}removePermanentDialog(t,i){var n=this;return(0,d.Z)(function*(){var a;t.stopPropagation(),t.preventDefault(),n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){yield n.removePermanent(i)}),function(){return a.apply(this,arguments)})})})()}removePermanent(t){var i=this;return(0,d.Z)(function*(){i.packageSummary.splice(i.packageSummary.indexOf(t),1),i.saveSettings("DELETE").then()})()}loadDependenciesAndSchemas(){var t=this;return(0,d.Z)(function*(){const{tpNpmPackageAndVersion:i,tpApiBundleIdMap:n,tpApiVersionIdMap:a}=(yield t.instanceS.getInstalledPackagesAndSchemas().toPromise()).data;t.tpNpmPackageAndVersion=i,t.tpApiBundleIdMap=n,t.tpApiVersionIdMap=a})()}commonPackageAddRemoveTasks(){var t=this;return(0,d.Z)(function*(){yield t.loadDependenciesAndSchemas()})()}editData(t,i){var n=this;return(0,d.Z)(function*(){t?.stopPropagation(),t?.preventDefault(),n.data.formData=i,n.data.mode=c.D.EDIT,n.data.eventChannel.emit({action:v.F.OPEN_FORM_IN_EDIT_MODE}),yield n.SandboxSettingsPkgVersionsModalC.showPkgVersions(i.name)})()}hideNpmLibModel(){this.addNpmLibC.hideModal()}resetDockerfileToDefault(){var t=this;return(0,d.Z)(function*(){try{const i=yield t.feStoreCS.geDefaultDockerfile(t.BE_HOST_PORT);t.editorDocker.setValue(i.data)}catch(i){t.notificationS.showErrorFromResponse(i.error||i,"Unable to reset docker file.")}})()}showDockerImageBuildLogs(){var t=this;return(0,d.Z)(function*(){const i=t.eventCenterCS.headerC,n=i.systemLogsModelC.systemLogsListC.filterOptions.find(a=>a.value===U.g.DOCKER_IMAGE_BUILD_LOGS);i.showSystemLogsModal(n)})()}summaryTableDoubleClick(){var t=this;setTimeout((0,d.Z)(function*(){if(t.selectedRowsUI[0]){let i;for(const n of t.packageSummary)n[t.gridKey]===t.selectedRowsUI[0].rowId&&(i=n);i&&!i.isReadOnly&&(yield t.editData(null,i))}}),100)}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||o)(e.Y36(x.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(p.YP),e.Y36(T.L),e.Y36(I.b),e.Y36(N.f),e.Y36(P.E),e.Y36(E.e),e.Y36(J.b))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-sandbox-settings-c"]],viewQuery:function(i,n){if(1&i&&(e.Gf(B,5),e.Gf(j,5),e.Gf(W,5)),2&i){let a;e.iGM(a=e.CRH())&&(n.addNpmLibC=a.first),e.iGM(a=e.CRH())&&(n.allowedOriginC=a.first),e.iGM(a=e.CRH())&&(n.SandboxSettingsPkgVersionsModalC=a.first)}},decls:6,vars:9,consts:[["class","pt-1 pl-5 pr-5 full-body overflow-auto",4,"ngIf"],[3,"data","pkgVersionModal","modalId","hostAndPort"],["addNpmLibC",""],[3,"modalId","hostAndPort","data","dependencies","saveUpdateSandboxDep","hideLibraryModelEventEmitter","installed"],["pkgVersionsModalC","","SandboxSettingsPkgVersionsModalC",""],[1,"pt-1","pl-5","pr-5","full-body","overflow-auto"],[1,"cursor-pointer","text-right","mr-1"],[1,"btn","btn-primary","btn-sm","mt-1","mr-1",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw","cursor-pointer"],[1,"btn","btn-success","btn-sm","mt-1",3,"click"],[1,"fas","fa-save","fa-fw","cursor-pointer"],[1,"card","shadow-sm","mt-2","mr-1"],[1,"card-header"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"card-body","p-3","overflow-hidden"],[1,"container"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["name","Setting","type","number","placeholder","Please provide value",1,"col-2","form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"col-6","pr-0"],[1,"small","text-info"],[1,"fas","fa-box","text-warning","fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/settings/sandboxSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"card-body","p-2","overflow-hidden"],[1,"w-100"],["header","Summary"],["styleClass","p-datatable-striped","scrollHeight","400px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["header","Final package.json"],["styleClass","p-datatable-striped","scrollHeight","400px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fab","fa-docker","fa-fw","mr-1","text-info"],["tooltipPosition","left","pTooltip","Reset dockerfile to default",1,"float-right","cursor-pointer","ml-2",3,"click"],[1,"fas","fa-undo","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","View logs of docker image build",1,"float-right","cursor-pointer","ml-2",3,"click"],[1,"fas","fa-water","text-info","fa-fw"],[1,"card-body","p-1","overflow-hidden",2,"height","400px"],[3,"editorOptions","editorGenerated"],[3,"allowedOrigins","saveSettings"],["allowedOriginC",""],[1,"mb-5"],[2,"width","55px"],[2,"width","40px"],[2,"width","100px"],[2,"width","200px"],[1,"text-center",2,"width","150px"],[1,"text-center",2,"width","100px"],[1,"text-center",2,"width","130px"],[3,"pSelectableRow"],["class","fas fa-circle fa-fw text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw text-muted text-v-small",4,"ngIf"],[1,"small"],[4,"ngFor","ngForOf"],[1,"text-center"],["class","fas fa-check fa-fw text-success pt-1",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"fas","fa-circle","fa-fw","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","text-muted","text-v-small"],["class","pl-3",4,"ngFor","ngForOf"],[1,"pl-3"],[1,"fas","fa-check","fa-fw","text-success","pt-1"],["pTooltip","Edit","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","tooltipPosition","left",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],[2,"width","150px"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){if(1&i&&(e.YNc(0,me,62,16,"div",0),e._UZ(1,"find-npm-package",1,2),e.TgZ(3,"app-sandbox-settings-pkg-versions-modal",3,4),e.NdJ("saveUpdateSandboxDep",function(r){return n.saveSettings(r)})("hideLibraryModelEventEmitter",function(){return n.hideNpmLibModel()})("installed",function(){return n.commonPackageAddRemoveTasks()}),e.qZA()),2&i){const a=e.MAs(4);e.Q6J("ngIf",n.settings),e.xp6(1),e.Q6J("data",n.data)("pkgVersionModal",a)("modalId","idAddNpmSandboxSettings")("hostAndPort",n.STORE_BE_HOST_PORT),e.xp6(2),e.Q6J("modalId","idAddNpmSandboxSettingsEdit")("hostAndPort",n.STORE_BE_HOST_PORT)("data",n.data)("dependencies",n.tpNpmPackageAndVersion)}},dependencies:[g.Fj,g.wV,g.JJ,g.On,u.sg,u.O5,G.K,R.S,K.O,f.iA,p.jx,f.Ei,Y.G,C.xf,C.x4,A.u,V],encapsulation:2})}return o})(),canActivate:[D.P]}];let fe=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[O.Bz.forChild(pe),y.u,M.ApiTestingM]})}return o})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7368],{7368:(xe,S,s)=>{s.r(S),s.d(S,{SandboxSettingsM:()=>fe});var O=s(7664),D=s(3726),y=s(8176),M=s(5249),d=s(5861),e=s(4946),_=s(6990),v=s(3157),c=s(328),k=s(1162),h=s(553),U=s(4371),x=s(5852),b=s(3835),w=s(5405),Z=s(9961),p=s(5219),T=s(7414),I=s(2304),N=s(4977),P=s(3429),E=s(1344),J=s(7240),g=s(95),u=s(6814),G=s(8147),R=s(1861),K=s(756),f=s(5431),Y=s(7680),C=s(4844),A=s(3259),q=s(2660);function F(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th",28),e._uU(4,"Action"),e.qZA()())}function H(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",31)(1,"button",32),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.editAllowedOrigin(n,a))}),e._UZ(2,"i",33),e.qZA(),e.TgZ(3,"button",34),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.removeAllowedOrigin(n,a))}),e._UZ(4,"i",35),e.qZA()()}}function L(o,l){if(1&o&&(e.TgZ(0,"tr",29)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,H,5,0,"div",30),e.qZA()()),2&o){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",!t.isReadOnly)}}function Q(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",37),e.TgZ(2,"span"),e._uU(3,"Save"),e.qZA()()}}let V=(()=>{class o{authCS;userS;eventCenterCS;notificationS;cs;confirmationService;modalId="idAllowedOriginModal";subscriptions=[];allowedOriginsGridData=[];saveSettings=new e.vpe;gridKeyAllowedOrigins="name";allowedOriginModel={domainName:"",domainNameBak:""};exampleOrigin=location.origin;allowedOriginData={mode:c.D.ADD};EFormMode=c.D;selectedRowsUI=[];constructor(t,i,n,a,r,m){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=a,this.cs=r,this.confirmationService=m}ngOnInit(){}save(){var t=this;return(0,d.Z)(function*(){if(t.allowedOriginData.mode===c.D.ADD)t.allowedOriginsGridData.push({name:t.allowedOriginModel.domainName});else{const i=t.allowedOriginsGridData.findIndex(n=>n.name===t.allowedOriginModel.domainNameBak);t.allowedOriginsGridData[i].name=t.allowedOriginModel.domainName}t.allowedOriginsGridData=_.uniqBy(t.allowedOriginsGridData,"name"),t.saveSettings.emit(),t.hideAllowedOriginModal()})()}showAllowedOriginModal(){$("#idAllowedOriginModal").modal("show")}hideAllowedOriginModal(){$("#idAllowedOriginModal").modal("hide")}addAllowedOrigin(){var t=this;return(0,d.Z)(function*(){t.allowedOriginModel.domainNameBak=t.allowedOriginModel.domainName="",t.allowedOriginData.mode=c.D.ADD,t.showAllowedOriginModal()})()}editAllowedOrigin(t,i){var n=this;return(0,d.Z)(function*(){n.allowedOriginModel.domainNameBak=n.allowedOriginModel.domainName=i.name,n.allowedOriginData.mode=c.D.EDIT,n.showAllowedOriginModal()})()}doubleClick(){this.editAllowedOrigin(null,this.selectedRowsUI[0]).then()}removeAllowedOrigin(t,i){var n=this;return(0,d.Z)(function*(){var a;n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentAllowedOriginConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){yield n.removeAO(t,i)}),function(){return a.apply(this,arguments)})})})()}removeAO(t,i){var n=this;return(0,d.Z)(function*(){const a=n.allowedOriginsGridData.findIndex(r=>r.name===i.name);n.allowedOriginsGridData.splice(a,1),n.saveSettings.emit()})()}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||o)(e.Y36(x.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(T.L),e.Y36(p.YP))};static \u0275cmp=e.Xpm({type:o,selectors:[["allowed-origin-c"]],inputs:{allowedOriginsGridData:["allowedOrigins","allowedOriginsGridData"]},outputs:{saveSettings:"saveSettings"},decls:37,vars:10,consts:[[1,"card","shadow-sm","mt-2","mr-1","mb-5",2,"height","384px"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],["pTooltip","Add New",1,"float-right","cursor-pointer","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"card-body","p-0","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","350px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["aria-hidden","true","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",3,"id"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body"],[1,"form-group","row","mt-3","mb-0"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","name","spellcheck","false","type","text","placeholder","Please provide domain name",1,"form-control","form-control-sm",3,"ngModel","blur","ngModelChange"],[1,"form-group","row"],[1,"col-form-label","col-form-label-sm","text-info","font-monospaced"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],[2,"width","100px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[1,"text-center"],["pTooltip","Edit","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","tooltipPosition","left",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Allowed Origins"),e.qZA(),e.TgZ(5,"span",3),e.NdJ("click",function(){return n.addAllowedOrigin()}),e._UZ(6,"i",4),e.qZA()(),e.TgZ(7,"div",5)(8,"p-table",6),e.NdJ("selectionChange",function(r){return n.selectedRowsUI=r})("dblclick",function(){return n.doubleClick()}),e.YNc(9,F,5,0,"ng-template",7),e.YNc(10,L,5,3,"ng-template",8),e.qZA()()(),e.TgZ(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"span"),e._UZ(16,"i",13),e._uU(17," Allowed Origins"),e.qZA(),e.TgZ(18,"button",14)(19,"span",15),e._UZ(20,"i",16),e.qZA()()(),e.TgZ(21,"div",17)(22,"div",18)(23,"label",19),e._uU(24,"Domain name"),e.qZA(),e.TgZ(25,"div",20)(26,"input",21),e.NdJ("blur",function(){return n.allowedOriginModel.domainName=n.allowedOriginModel.domainName.toLowerCase()})("ngModelChange",function(r){return n.allowedOriginModel.domainName=r}),e.qZA()()(),e.TgZ(27,"div",22),e._UZ(28,"label",19),e.TgZ(29,"div",20)(30,"label",23),e._uU(31),e.qZA()()()(),e.TgZ(32,"div",24)(33,"button",25),e._UZ(34,"i",26),e._uU(35," Close"),e.qZA(),e.YNc(36,Q,4,0,"button",27),e.qZA()()()()),2&i&&(e.xp6(8),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRowsUI)("dataKey",n.gridKeyAllowedOrigins)("scrollable",!0)("value",n.allowedOriginsGridData),e.xp6(3),e.s9C("id",n.modalId),e.xp6(15),e.Q6J("ngModel",n.allowedOriginModel.domainName),e.xp6(5),e.hij("(Ex: ",n.exampleOrigin,")"),e.xp6(5),e.Q6J("ngIf",n.allowedOriginData.mode!==n.EFormMode.VIEW))},dependencies:[g.Fj,g.JJ,g.On,u.O5,q.y,f.iA,p.jx,f.Ei,A.u],encapsulation:2})}return o})();const B=["addNpmLibC"],j=["allowedOriginC"],W=["SandboxSettingsPkgVersionsModalC"];function z(o,l){1&o&&(e.TgZ(0,"tr"),e._UZ(1,"th",46)(2,"th",47),e.TgZ(3,"th",48),e._uU(4,"Version"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Name"),e.qZA(),e.TgZ(7,"th",49),e._uU(8,"Sub Dependencies"),e.qZA(),e.TgZ(9,"th",50),e._uU(10,"Third Party API"),e.qZA(),e.TgZ(11,"th",51),e._uU(12,"Default"),e.qZA(),e.TgZ(13,"th",52),e._uU(14,"Action"),e.qZA()())}function X(o,l){1&o&&e._UZ(0,"i",61)}function ee(o,l){1&o&&e._UZ(0,"i",62)}function te(o,l){if(1&o&&(e.TgZ(0,"div",64),e._uU(1),e.qZA()),2&o){const t=l.$implicit;e.xp6(1),e.AsE("",t.name," @",t.version,"")}}function ne(o,l){if(1&o&&(e.TgZ(0,"div"),e.YNc(1,te,2,2,"div",63),e.qZA()),2&o){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.dependencies)}}function ie(o,l){1&o&&e._UZ(0,"i",65)}function oe(o,l){1&o&&e._UZ(0,"i",65)}function ae(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",58)(1,"button",66),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return e.KtG(r.editData(n,a))}),e._UZ(2,"i",67),e.qZA(),e.TgZ(3,"button",68),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return e.KtG(r.removePermanentDialog(n,a))}),e._UZ(4,"i",69),e.qZA()()}}function se(o,l){if(1&o&&(e.TgZ(0,"tr",53)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,X,1,0,"i",54),e.YNc(5,ee,1,0,"i",55),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",56),e.YNc(12,ne,2,1,"div",57),e.qZA()(),e.TgZ(13,"td",58),e.YNc(14,ie,1,0,"i",59),e.qZA(),e.TgZ(15,"td",58),e.YNc(16,oe,1,0,"i",59),e.qZA(),e.TgZ(17,"td"),e.YNc(18,ae,5,0,"div",60),e.qZA()()),2&o){const t=l.$implicit,i=l.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Q6J("ngIf",t.active),e.xp6(1),e.Q6J("ngIf",!t.active),e.xp6(2),e.Oqu(t.version),e.xp6(2),e.Oqu(t.name),e.xp6(3),e.Q6J("ngForOf",t.subDependencies),e.xp6(2),e.Q6J("ngIf",t.isThirdPartyApi),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",!t.isReadOnly)}}function le(o,l){1&o&&(e.TgZ(0,"tr"),e._UZ(1,"th",46),e.TgZ(2,"th",48),e._uU(3,"Version"),e.qZA(),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th",70),e._uU(7,"Third Party API"),e.qZA(),e.TgZ(8,"th",48),e._uU(9,"Default"),e.qZA()())}function re(o,l){1&o&&e._UZ(0,"i",65)}function de(o,l){1&o&&e._UZ(0,"i",65)}function ce(o,l){if(1&o&&(e.TgZ(0,"tr",53)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e.YNc(8,re,1,0,"i",59),e.qZA(),e.TgZ(9,"td"),e.YNc(10,de,1,0,"i",59),e.qZA()()),2&o){const t=l.$implicit,i=l.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.version),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isThirdPartyApi),e.xp6(2),e.Q6J("ngIf",t.isDefault)}}function ge(o,l){1&o&&e._UZ(0,"p-progressSpinner",71)}function me(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",5)(1,"div",6)(2,"button",7),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.loadGridData())}),e._UZ(3,"i",8),e._uU(4," Refresh "),e.qZA(),e.TgZ(5,"button",9),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e._UZ(6,"i",10),e._uU(7," Save "),e.qZA()(),e.TgZ(8,"div",11)(9,"div",12)(10,"span"),e._UZ(11,"i",13),e._uU(12," Settings"),e.qZA()(),e.TgZ(13,"div",14)(14,"div",15)(15,"div",16)(16,"label",17),e._uU(17,"Sandbox Count"),e.qZA(),e.TgZ(18,"input",18),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.settings.sandbox.sandboxCountOverrideAdmin=n)}),e.qZA(),e.TgZ(19,"div",19)(20,"span",20)(21,"span"),e._uU(22,"1 CPU core will have one process and one process will have these many sandbox."),e.qZA(),e._UZ(23,"br"),e.TgZ(24,"span"),e._uU(25,"Ideally it should be 1-2."),e.qZA()()()()()()(),e.TgZ(26,"div",11)(27,"div",12)(28,"span"),e._UZ(29,"i",21),e._uU(30," Sandbox Dependencies"),e.qZA(),e.TgZ(31,"div",22)(32,"a",23),e._UZ(33,"img",24),e.qZA()(),e.TgZ(34,"span",25),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showLibraryModel())}),e._UZ(35,"i",26),e.qZA()(),e.TgZ(36,"div",27)(37,"p-tabView",28)(38,"p-tabPanel",29)(39,"p-table",30),e.NdJ("selectionChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.selectedRowsUI=n)})("dblclick",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.summaryTableDoubleClick())}),e.YNc(40,z,15,0,"ng-template",31),e.YNc(41,se,19,10,"ng-template",32),e.qZA()(),e.TgZ(42,"p-tabPanel",33)(43,"p-table",34),e.NdJ("selectionChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.selectedRowsPackageJson=n)}),e.YNc(44,le,10,0,"ng-template",31),e.YNc(45,ce,11,6,"ng-template",32),e.qZA()()(),e.YNc(46,ge,1,0,"p-progressSpinner",35),e.qZA()(),e.TgZ(47,"div",11)(48,"div",12)(49,"span"),e._UZ(50,"i",36),e._uU(51," Docker File"),e.qZA(),e.TgZ(52,"span",37),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.resetDockerfileToDefault())}),e._UZ(53,"i",38),e.qZA(),e.TgZ(54,"span",39),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showDockerImageBuildLogs())}),e._UZ(55,"i",40),e.qZA()(),e.TgZ(56,"div",41)(57,"app-monaco-editor",42),e.NdJ("editorGenerated",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.editorGenerated(n))}),e.qZA()()(),e.TgZ(58,"allowed-origin-c",43,44),e.NdJ("saveSettings",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e.qZA(),e.TgZ(60,"div",45),e._uU(61,"\xa0"),e.qZA()()}if(2&o){const t=e.oxw();e.xp6(18),e.Q6J("ngModel",t.settings.sandbox.sandboxCountOverrideAdmin),e.xp6(21),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRowsUI)("dataKey",t.gridKey)("scrollable",!0)("value",t.packageSummary),e.xp6(4),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRowsPackageJson)("dataKey",t.gridKey)("scrollable",!0)("value",t.finalPackageJson),e.xp6(3),e.Q6J("ngIf",t.loading.form),e.xp6(11),e.Q6J("editorOptions",t.editorOptionsDocker),e.xp6(1),e.Q6J("allowedOrigins",t.settings.allowedOrigins)}}const pe=[{path:"main",component:(()=>{class o{authCS;userS;eventCenterCS;notificationS;confirmationService;cs;monacoS;tpStoreApiVersionS;instanceS;feStoreCS;generalCS;STORE_BE_HOST_PORT=h.N.STORE_BE_HOST_PORT;BE_HOST_PORT=h.N.BE_HOST_PORT;subscriptions=[];data={mode:c.D.ADD,eventChannel:new e.vpe,formData:void 0};packageSummary=[];selectedRowsUI=[];gridKey="rowId";counter;EFormMode=c.D;finalPackageJson=[];selectedRowsPackageJson=[];showAll=!1;loading={form:!1};settings;tpNpmPackageAndVersion={};tpApiVersionIdMap;tpApiBundleIdMap;editorDocker;editorOptionsDocker={readOnly:!1,language:"dockerfile",contextmenu:!0};addNpmLibC;allowedOriginC;SandboxSettingsPkgVersionsModalC;constructor(t,i,n,a,r,m,_e,ue,Se,ve,he){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=a,this.confirmationService=r,this.cs=m,this.monacoS=_e,this.tpStoreApiVersionS=ue,this.instanceS=Se,this.feStoreCS=ve,this.generalCS=he}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.subscriptions.push(t.eventCenterCS.sandboxDep.subscribe(i=>{if(t.data.mode===c.D.ADD){for(const n of t.packageSummary)if(n.name===i.name&&n.isDefault)return void t.notificationS.showError("You can not override default package.");t.packageSummary.unshift(i),t.rowIdSet(),t.notificationS.showSuccess(t.cs.amUserSandboxDepSetting.addSuccess),t.addNpmLibC.hideModal()}})),yield t.loadGridData(),t.generalCS.setNewTitle("API Maker - Sandbox Settings")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){const i=yield t.userS.getAdminSettings(t.authCS.getUserId()).toPromise();t.settings=i.data||{},t.packageSummary=t.settings.sandbox.dependenciesUI.nodeJS,t.finalPackageJson=t.settings.sandbox.dependencies.nodeJS;const n=t.settings.allowedOrigins||[];n.sort(),t.settings.allowedOrigins=_.map(n,a=>({name:a})),t.rowIdSet();for(const a of t.finalPackageJson)a.rowId=(t.counter++).toString();t.generalCS.setValueInEditor(t,"editorDocker",t.settings.dockerFile||"")})()}editorGenerated(t){var i=this;return(0,d.Z)(function*(){i.editorDocker=t,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(t,n=>{i.saveSettings()})})()}rowIdSet(){this.counter=1;for(const t of this.packageSummary)t.rowId=(this.counter++).toString()}showLibraryModel(){this.data.formData=void 0,this.data.mode=c.D.ADD,this.data.eventChannel.emit({action:v.F.OPEN_FORM_IN_ADD_MODE}),this.addNpmLibC.showModal()}saveSettings(t){var i=this;return(0,d.Z)(function*(){try{const n=i.authCS.getUserId();if(i?.settings?.sandbox?.sandboxCountOverrideAdmin>5)return void i.notificationS.showError("More than 5 sandbox are not allowed.");const a={settings:{sandbox:{sandboxCountOverrideAdmin:i.settings.sandbox.sandboxCountOverrideAdmin,dependencies:{nodeJS:i.packageSummary.filter(m=>!m.isReadOnly&&!m.isThirdPartyApi&&!m.isDefault)}},dockerFile:i.editorDocker.getValue(),allowedOrigins:_.map(i.allowedOriginC.allowedOriginsGridData,"name").sort()}};(yield i.userS.put(n,a,{select:k.iH._id}).toPromise())&&(t===c.D.EDIT?i.notificationS.showSuccess(i.cs.amUserSandboxDepSetting.editSuccess):"DELETE"===t?i.notificationS.showSuccess(i.cs.amUserSandboxDepSetting.removePermanent):t||i.notificationS.showSuccess("Success")),i.loadGridData().then()}catch(n){i.loading.form=!1,i.notificationS.showErrorFromResponse(n.error||n,"Unable to save settings.")}})()}removePermanentDialog(t,i){var n=this;return(0,d.Z)(function*(){var a;t.stopPropagation(),t.preventDefault(),n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){yield n.removePermanent(i)}),function(){return a.apply(this,arguments)})})})()}removePermanent(t){var i=this;return(0,d.Z)(function*(){i.packageSummary.splice(i.packageSummary.indexOf(t),1),i.saveSettings("DELETE").then()})()}loadDependenciesAndSchemas(){var t=this;return(0,d.Z)(function*(){const{tpNpmPackageAndVersion:i,tpApiBundleIdMap:n,tpApiVersionIdMap:a}=(yield t.instanceS.getInstalledPackagesAndSchemas().toPromise()).data;t.tpNpmPackageAndVersion=i,t.tpApiBundleIdMap=n,t.tpApiVersionIdMap=a})()}commonPackageAddRemoveTasks(){var t=this;return(0,d.Z)(function*(){yield t.loadDependenciesAndSchemas()})()}editData(t,i){var n=this;return(0,d.Z)(function*(){t?.stopPropagation(),t?.preventDefault(),n.data.formData=i,n.data.mode=c.D.EDIT,n.data.eventChannel.emit({action:v.F.OPEN_FORM_IN_EDIT_MODE}),yield n.SandboxSettingsPkgVersionsModalC.showPkgVersions(i.name)})()}hideNpmLibModel(){this.addNpmLibC.hideModal()}resetDockerfileToDefault(){var t=this;return(0,d.Z)(function*(){try{const i=yield t.feStoreCS.geDefaultDockerfile(t.BE_HOST_PORT);t.editorDocker.setValue(i.data)}catch(i){t.notificationS.showErrorFromResponse(i.error||i,"Unable to reset docker file.")}})()}showDockerImageBuildLogs(){var t=this;return(0,d.Z)(function*(){const i=t.eventCenterCS.headerC,n=i.systemLogsModelC.systemLogsListC.filterOptions.find(a=>a.value===U.g.DOCKER_IMAGE_BUILD_LOGS);i.showSystemLogsModal(n)})()}summaryTableDoubleClick(){var t=this;setTimeout((0,d.Z)(function*(){if(t.selectedRowsUI[0]){let i;for(const n of t.packageSummary)n[t.gridKey]===t.selectedRowsUI[0].rowId&&(i=n);i&&!i.isReadOnly&&(yield t.editData(null,i))}}),100)}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||o)(e.Y36(x.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(p.YP),e.Y36(T.L),e.Y36(I.b),e.Y36(N.f),e.Y36(P.E),e.Y36(E.e),e.Y36(J.b))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-sandbox-settings-c"]],viewQuery:function(i,n){if(1&i&&(e.Gf(B,5),e.Gf(j,5),e.Gf(W,5)),2&i){let a;e.iGM(a=e.CRH())&&(n.addNpmLibC=a.first),e.iGM(a=e.CRH())&&(n.allowedOriginC=a.first),e.iGM(a=e.CRH())&&(n.SandboxSettingsPkgVersionsModalC=a.first)}},decls:6,vars:9,consts:[["class","pt-1 pl-5 pr-5 full-body overflow-auto",4,"ngIf"],[3,"data","pkgVersionModal","modalId","hostAndPort"],["addNpmLibC",""],[3,"modalId","hostAndPort","data","dependencies","saveUpdateSandboxDep","hideLibraryModelEventEmitter","installed"],["pkgVersionsModalC","","SandboxSettingsPkgVersionsModalC",""],[1,"pt-1","pl-5","pr-5","full-body","overflow-auto"],[1,"cursor-pointer","text-right","mr-1"],[1,"btn","btn-primary","btn-sm","mt-1","mr-1",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw","cursor-pointer"],[1,"btn","btn-success","btn-sm","mt-1",3,"click"],[1,"fas","fa-save","fa-fw","cursor-pointer"],[1,"card","shadow-sm","mt-2","mr-1"],[1,"card-header"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"card-body","p-3","overflow-hidden"],[1,"container"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["name","Setting","type","number","placeholder","Please provide value",1,"col-2","form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"col-6","pr-0"],[1,"small","text-info"],[1,"fas","fa-box","text-warning","fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/settings/sandboxSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"card-body","p-2","overflow-hidden"],[1,"w-100"],["header","Summary"],["styleClass","p-datatable-striped","scrollHeight","400px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["header","Final package.json"],["styleClass","p-datatable-striped","scrollHeight","400px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fab","fa-docker","fa-fw","mr-1","text-info"],["tooltipPosition","left","pTooltip","Reset dockerfile to default",1,"float-right","cursor-pointer","ml-2",3,"click"],[1,"fas","fa-undo","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","View logs of docker image build",1,"float-right","cursor-pointer","ml-2",3,"click"],[1,"fas","fa-water","text-info","fa-fw"],[1,"card-body","p-1","overflow-hidden",2,"height","400px"],[3,"editorOptions","editorGenerated"],[3,"allowedOrigins","saveSettings"],["allowedOriginC",""],[1,"mb-5"],[2,"width","55px"],[2,"width","40px"],[2,"width","100px"],[2,"width","200px"],[1,"text-center",2,"width","150px"],[1,"text-center",2,"width","100px"],[1,"text-center",2,"width","130px"],[3,"pSelectableRow"],["class","fas fa-circle fa-fw text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw text-muted text-v-small",4,"ngIf"],[1,"small"],[4,"ngFor","ngForOf"],[1,"text-center"],["class","fas fa-check fa-fw text-success pt-1",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"fas","fa-circle","fa-fw","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","text-muted","text-v-small"],["class","pl-3",4,"ngFor","ngForOf"],[1,"pl-3"],[1,"fas","fa-check","fa-fw","text-success","pt-1"],["pTooltip","Edit","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","tooltipPosition","left",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],[2,"width","150px"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){if(1&i&&(e.YNc(0,me,62,16,"div",0),e._UZ(1,"find-npm-package",1,2),e.TgZ(3,"app-sandbox-settings-pkg-versions-modal",3,4),e.NdJ("saveUpdateSandboxDep",function(r){return n.saveSettings(r)})("hideLibraryModelEventEmitter",function(){return n.hideNpmLibModel()})("installed",function(){return n.commonPackageAddRemoveTasks()}),e.qZA()),2&i){const a=e.MAs(4);e.Q6J("ngIf",n.settings),e.xp6(1),e.Q6J("data",n.data)("pkgVersionModal",a)("modalId","idAddNpmSandboxSettings")("hostAndPort",n.STORE_BE_HOST_PORT),e.xp6(2),e.Q6J("modalId","idAddNpmSandboxSettingsEdit")("hostAndPort",n.STORE_BE_HOST_PORT)("data",n.data)("dependencies",n.tpNpmPackageAndVersion)}},dependencies:[g.Fj,g.wV,g.JJ,g.On,u.sg,u.O5,G.K,R.S,K.O,f.iA,p.jx,f.Ei,Y.G,C.xf,C.x4,A.u,V],encapsulation:2})}return o})(),canActivate:[D.P]}];let fe=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[O.Bz.forChild(pe),y.u,M.ApiTestingM]})}return o})()}}]);
package/dist/7470.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7470],{2883:(R,A,a)=>{a.d(A,{c:()=>u});var c=a(4946),p=a(3300);let u=(()=>{class n{hideCodeFinderModel=new c.vpe;loading={form:!1,response:!1};constructor(){}ngOnInit(){}showModal(){$("#idCodeFinder").modal("show")}hideModal(){$("#idCodeFinder").modal("hide")}hideModalEvent(){this.hideCodeFinderModel.emit(!0)}ngOnDestroy(){}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=c.Xpm({type:n,selectors:[["app-code-finder-modal"]],outputs:{hideCodeFinderModel:"hideCodeFinderModel"},decls:8,vars:1,consts:[["id","idCodeFinder","role","dialog","data-backdrop","static","data-keyboard","false",1,"pt-1","pl-1","pr-1","overflow-auto","modal","parent-notes-modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content","border-0"],["aria-label","Close","type","button",1,"close","position-absolute",2,"top","0.25rem","right","0.5rem","z-index","1",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close","m-1"],[1,"modal-body","p-0"],[3,"modalId"]],template:function(r,y){1&r&&(c.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),c.NdJ("click",function(){return y.hideModalEvent()}),c.TgZ(4,"span",4),c._UZ(5,"i",5),c.qZA()(),c.TgZ(6,"div",6),c._UZ(7,"app-code-finder-w",7),c.qZA()()()()),2&r&&(c.xp6(7),c.Q6J("modalId","idCodeFinder"))},dependencies:[p.k],encapsulation:2,changeDetection:0})}return n})()},365:(R,A,a)=>{a.d(A,{n:()=>je});var c=a(5861),p=a(6990),n=a(1440),m=a(1162),E=a(553),r=a(5085),y=a(1601),P=a(3531),j=a(9989),e=a(4946),M=a(7240),S=a(7414),T=a(2304),v=a(5852),f=a(7629),I=a(1042),D=a(602),_=a(2694),O=a(2559),d=a(5394),h=a(9448),l=a(6457),g=a(7145),x=a(9961),N=a(2915),F=a(1344),B=a(6233),L=a(115),J=a(1252),K=a(9530),H=a(9729),Y=a(6125),W=a(204),Z=a(6814),Q=a(2660),w=a(5860),k=a(756),q=a(3259),G=a(5025);const V=["insertCodeModalC"],z=["monacoEditorModalC"];function X(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.qZA(),e.TgZ(11,"span",16),e._uU(12),e.qZA(),e.TgZ(13,"span",17),e._uU(14),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ee(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",15),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function oe(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",15),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function te(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function ie(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function se(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",19),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function ae(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",21),e._uU(4),e.qZA(),e.TgZ(5,"span",22),e._uU(6),e.qZA(),e.TgZ(7,"span",20),e._uU(8),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.eventName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.eventListenersName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function ne(s,C){if(1&s&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&s){const o=e.oxw(2);e.xp6(1),e.hij(" \u2192 ",o.codeObj.name,"")}}function de(s,C){if(1&s&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&s){const o=e.oxw(2);e.xp6(1),e.Oqu(o.codeObj.hookType)}}function re(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",23),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA(),e.YNc(7,ne,2,1,"span",24),e.YNc(8,de,2,1,"span",25),e.qZA()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.customApiName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":""),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType)}}function ce(s,C){if(1&s&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&s){const o=e.oxw(2);e.xp6(1),e.hij(" \u2192 ",o.codeObj.name,"")}}function pe(s,C){if(1&s&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&s){const o=e.oxw(2);e.xp6(1),e.Oqu(o.codeObj.hookType)}}function _e(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",26),e._uU(4),e.qZA(),e.TgZ(5,"span",27),e._uU(6),e.qZA(),e.TgZ(7,"span",28),e._uU(8),e.qZA(),e.TgZ(9,"span",20),e._uU(10),e.qZA(),e.YNc(11,ce,2,1,"span",24),e.YNc(12,pe,2,1,"span",25),e.qZA()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.bundleName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.apiVersion),e.xp6(2),e.hij("",o.codeObj.apiName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":""),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType)}}function le(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",29),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.utilityClassName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function Ce(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function ue(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function ge(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",31),e._uU(4),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function me(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiId," ")}}function he(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",26),e._uU(4),e.qZA(),e.TgZ(5,"span",27),e._uU(6),e.qZA(),e.TgZ(7,"span",28),e._uU(8),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.bundleName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiVersion," \u2192 "),e.xp6(2),e.hij("",o.codeObj.name," ")}}function Oe(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function Se(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function Te(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function fe(s,C){if(1&s&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&s){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Ee(s,C){1&s&&(e.TgZ(0,"span",41),e._UZ(1,"i",42),e.qZA())}function Ie(s,C){if(1&s&&(e.TgZ(0,"span",43),e._uU(1),e.qZA()),2&s){const o=e.oxw(2);e.Q6J("pTooltip",o.matchFound+" match found in this file."),e.xp6(1),e.Oqu(o.matchFound)}}function Ae(s,C){if(1&s){const o=e.EpF();e.TgZ(0,"a",44),e.NdJ("click",function(){e.CHM(o);const i=e.oxw(2);return e.KtG(i.viewError())}),e._uU(1,"View error"),e.qZA()}}const ye=function(){return{"margin-right":"30px"}};function Pe(s,C){if(1&s){const o=e.EpF();e.TgZ(0,"span")(1,"span",32),e.NdJ("click",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.saveData())}),e._UZ(2,"i",33),e._uU(3,"Save "),e.qZA(),e.TgZ(4,"span",34),e.NdJ("click",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.toggleResponseTab())}),e._UZ(5,"i",35),e.qZA(),e.TgZ(6,"span",36),e.NdJ("click",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.reloadTypes())}),e._UZ(7,"i",37),e.qZA(),e.YNc(8,Ee,2,0,"span",38),e.YNc(9,Ie,2,2,"span",39),e.YNc(10,Ae,2,0,"a",40),e.qZA()}if(2&s){const o=e.oxw();e.xp6(1),e.Q6J("ngStyle",o.modalId?e.DdM(4,ye):""),e.xp6(7),e.Q6J("ngIf",o.showLoadingTypes),e.xp6(1),e.Q6J("ngIf",o.matchFound),e.xp6(1),e.Q6J("ngIf",o.lastError)}}let je=(()=>{class s{generalCS;constantsS;monacoS;authCS;functionS;schedulerS;dbMigrationS;processInitializersS;tpInstalledApisS;instanceApiSettingsS;instanceApiHooksS;systemApiSettingsS;amEventS;ns;eventCenterS;feStoreCS;i18nS;secretS;tpApiSettingsS;schemaS;dbMastersS;uiMakerUtilsS;constantsCS;cd;modalId;DOCS_HOST_PORT=E.N.DOCS_HOST_PORT;loading={grid:!1};subscriptions=[];editorCodeFinder;editorOptionsEditorCodeFinder={readOnly:!1,language:y.d.typescript,contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};gridKey=m.iH._id;BE_HOST_PORT=E.N.BE_HOST_PORT;EAPICategory=r.R;codeObj={};monacoDecorations=[];tab;insertCodeModalC;viewDockerfileModelC;lastCodeFinderObject={};matchFound=0;constructor(o,t,i,b,U,Me,be,ve,Ue,Re,De,Ze,xe,Ne,Fe,Be,Le,Je,Ke,He,Ye,We,Qe,we){this.generalCS=o,this.constantsS=t,this.monacoS=i,this.authCS=b,this.functionS=U,this.schedulerS=Me,this.dbMigrationS=be,this.processInitializersS=ve,this.tpInstalledApisS=Ue,this.instanceApiSettingsS=Re,this.instanceApiHooksS=De,this.systemApiSettingsS=Ze,this.amEventS=xe,this.ns=Ne,this.eventCenterS=Fe,this.feStoreCS=Be,this.i18nS=Le,this.secretS=Je,this.tpApiSettingsS=Ke,this.schemaS=He,this.dbMastersS=Ye,this.uiMakerUtilsS=We,this.constantsCS=Qe,this.cd=we}ngOnInit(){this.subscriptions.push(this.eventCenterS.codeFinderResult.subscribe(o=>{if(o.length){this.codeObj=o[0],p.isEmpty(this.lastCodeFinderObject)||this.getBackupOfMonacoEditor(this.lastCodeFinderObject),this.lastCodeFinderObject=this.codeObj,this.generalCS.setValueInEditor(this,"editorCodeFinder",this.codeObj?.apiCodeStr),this.restoreBackupOfMonacoEditor(this.lastCodeFinderObject);const t=this.editorCodeFinder.getModel().findMatches(o[0].searchKeyWord,!0,!1,!1,null,!0);this.lastCodeFinderObject.cursorPosition={lineNumber:t[0]?.range?.startLineNumber,column:t[0]?.range?.startColumn},this?.lastCodeFinderObject?.cursorPosition?.lineNumber&&this.editorCodeFinder.setPosition(this?.lastCodeFinderObject?.cursorPosition),t[0]?.range?.startLineNumber&&this.editorCodeFinder.revealLineInCenter(t[0]?.range?.startLineNumber),t[0]?.range&&this.editorCodeFinder.revealRange(t[0].range,1),this.editorCodeFinder.deltaDecorations(this.monacoDecorations,[]),this.monacoDecorations=[];for(const i of t){const b=[{range:new monaco.Range(i?.range?.startLineNumber,i?.range?.startColumn,i?.range?.endLineNumber,i?.range?.endColumn),options:{inlineClassName:"highlightMatchedWord"}}];if(this.editorCodeFinder){const U=this.editorCodeFinder.deltaDecorations([],b);this.monacoDecorations.push(...U)}}this.matchFound=this.monacoDecorations.length,this.editorCodeFinder.focus()}else this.resetCodeObj();this.lastError=void 0,this.cd.detectChanges()}))}getBackupOfMonacoEditor(o){o.viewState=this.editorCodeFinder.saveViewState()}restoreBackupOfMonacoEditor(o){o.viewState&&this.editorCodeFinder.restoreViewState(o.viewState),o.cursorPosition?.lineNumber?this.editorCodeFinder.setPosition(o.cursorPosition):(o.cursorPosition={lineNumber:1,column:1},this.editorCodeFinder.setPosition(o.cursorPosition),this.editorCodeFinder.setScrollTop(0),this.editorCodeFinder.setScrollLeft(0)),this.editorCodeFinder.focus()}editorGenerated(o){var t=this;return(0,c.Z)(function*(){t.editorCodeFinder=o,yield t.monacoS.loadSchemaEditorSettings(t.BE_HOST_PORT,t.authCS.getUserId(),null),t.monacoS.addSaveCodeKeyBinding(o,i=>{t.codeObj&&t.saveData()}),t.editorCodeFinder.onDidChangeCursorPosition(i=>{t.lastCodeFinderObject&&1!==i.position.lineNumber&&1!==i.position.column&&(t.lastCodeFinderObject.cursorPosition=i.position)}),t.monacoS.addInsertCodeKeyBinding(o,i=>{(t.codeObj.apiCategory===r.R.INSTANCES||t.codeObj.apiCategory===r.R.THIRD_PARTY_APIS||t.codeObj.apiCategory===r.R.CUSTOM_APIS||t.codeObj.apiCategory===r.R.SYSTEM_APIS||t.codeObj.apiCategory===r.R.EVENTS||t.codeObj.apiCategory===r.R.SCHEDULERS||t.codeObj.apiCategory===r.R.UTILITY_CLASS||t.codeObj.apiCategory===r.R.MIGRATION_SCRIPT||t.codeObj.apiCategory===r.R.PROCESS_INITIALIZER||t.codeObj.apiCategory===r.R.INSTANCE_API_HOOKS_JSON||t.codeObj.apiCategory!==r.R.I18N_JSON&&t.codeObj.apiCategory!==r.R.SECRET_JSON&&t.codeObj.apiCategory!==r.R.INSTANCE_API_SETTINGS_JSON&&t.codeObj.apiCategory!==r.R.THIRD_PARTY_API_SETTINGS_JSON&&t.codeObj.apiCategory!==r.R.SCHEMA_JSON&&t.codeObj.apiCategory!==r.R.SYSTEM_API_SETTINGS_JSON)&&t.insertCodeModalC.showModal(P.b.CodeFinderResultC)}),t.subscriptions.push(t.generalCS.messageReceived.subscribe(i=>{i.type&&i.type===j.g.TEXT_COPIED&&i.componentName===P.b.CodeFinderResultC&&(t.monacoS.insertAtCursor(o,i.selectedText),t.insertCodeModalC.hideModal())})),t.monacoS.addToggleCodeKeyBinding(o,i=>{t.toggleResponseTab(),t.layout.cd.detectChanges(),t.cd.detectChanges()})})()}layout;saveData(){var o=this;return(0,c.Z)(function*(){o.monacoS.clearEditorDecorations(o.editorCodeFinder,o.monacoDecorations),yield o.customApisUpdateData(),yield o.schedulerApisUpdateData(),yield o.dbMigrationUpdateData(),yield o.processInitializerUpdateData(),yield o.amEventsUpdateData(),yield o.tpApisUpdateData(),yield o.instanceApisSettingUpdateData(),yield o.instanceApisHooksUpdateData(),yield o.sysApisSettingUpdateData(),yield o.utilityClassesUpdateData(),yield o.i18nUpdateData(),yield o.secretsUpdateData(),yield o.tpApiSettingUpdateData(),yield o.schemaUpdateData(),yield o.dbMasterUpdateData(),yield o.dbMasterUpdateJSUtilsData(),yield o.uiMakerUtilityUpdateData(),o.cd.detectChanges()})()}customApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.CUSTOM_APIS)try{const t=(yield o.functionS.getById(o.codeObj._id).toPromise()).data;o.lockAndApiStrCodeCommon(t.versions),yield o.functionS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.functions.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}schedulerApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.SCHEDULERS)try{const t=(yield o.schedulerS.getById(o.codeObj._id).toPromise()).data;o.lockAndApiStrCodeCommon(t.versions),yield o.schedulerS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.schedulers.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}dbMigrationUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.MIGRATION_SCRIPT)try{const t=(yield o.dbMigrationS.getById(o.codeObj._id).toPromise()).data;t.dbMigrationScriptCode=o.editorCodeFinder.getValue(),yield o.dbMigrationS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.dbMigration.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}processInitializerUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.PROCESS_INITIALIZER)try{const t=(yield o.processInitializersS.getById(o.codeObj._id).toPromise()).data;t.processInitializerCode=o.editorCodeFinder.getValue(),yield o.processInitializersS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.processInitializer.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}amEventsUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.EVENTS)try{const t=(yield o.amEventS.getById(o.codeObj._id).toPromise()).data;for(const i of t.eventListeners)i._id===o.codeObj.eventListenersId&&i.name===o.codeObj.eventListenersName&&o.lockAndApiStrCodeCommon(i.versions);yield o.amEventS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.amEventListeners.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}tpApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.THIRD_PARTY_APIS)try{const t=(yield o.tpInstalledApisS.getById(o.codeObj._id).toPromise()).data;o.lockAndApiStrCodeCommon(t.versions),yield o.tpInstalledApisS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}instanceApisSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.INSTANCES||o.codeObj.apiCategory===r.R.INSTANCE_API_SETTINGS_JSON)try{const t=(yield o.instanceApiSettingsS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.INSTANCE_API_SETTINGS_JSON&&(t.instanceApiSettingCode=o.editorCodeFinder.getValue()),o.codeObj.apiCategory===r.R.INSTANCES&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceApiSettingsS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}instanceApisHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.INSTANCE_API_HOOKS_JSON)try{const t=(yield o.instanceApiHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.INSTANCE_API_HOOKS_JSON&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceApiHooksS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}sysApisSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.SYSTEM_APIS||o.codeObj.apiCategory===r.R.SYSTEM_API_SETTINGS_JSON)try{const t=(yield o.systemApiSettingsS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.SYSTEM_API_SETTINGS_JSON&&(t.sysApiSettingCode=o.editorCodeFinder.getValue()),o.codeObj.apiCategory===r.R.SYSTEM_APIS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.systemApiSettingsS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}utilityClassesUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.UTILITY_CLASS)try{const t=(yield o.feStoreCS.getByIdUtilityClasses(o.BE_HOST_PORT,o.codeObj._id).toPromise()).data;o.lockAndApiStrCodeCommon(t.versions),yield o.feStoreCS.putUtilityClasses(o.BE_HOST_PORT,t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsCS.utilityClassesS.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}i18nUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.I18N_JSON)try{const t=(yield o.i18nS.getById(o.codeObj._id).toPromise()).data;t.keysCode=o.editorCodeFinder.getValue(),yield o.i18nS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.i18n.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}secretsUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.SECRET_JSON)try{const t=(yield o.secretS.getById(o.codeObj._id).toPromise()).data;t.keysCode=o.editorCodeFinder.getValue(),t.keysCode=o.generalCS.getEncryptedString(t.keysCode,E.N.crypto.passCommunication),yield o.secretS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsCS.secret.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}tpApiSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.THIRD_PARTY_API_SETTINGS_JSON)try{const t=(yield o.tpApiSettingsS.getById(o.codeObj._id).toPromise()).data;t.thirdPartyApiSettingsCode=o.editorCodeFinder.getValue(),yield o.tpApiSettingsS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.tpApiSettings.addOrUpdateSuccess)}catch(t){o.catchErrorCommon(t)}})()}schemaUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.SCHEMA_JSON)try{const t=(yield o.schemaS.getById(o.codeObj._id).toPromise()).data;t.propertiesCode=o.editorCodeFinder.getValue(),yield o.schemaS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess("Schema updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}dbMasterUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.DB_MASTERS_JSON)try{const t=(yield o.dbMastersS.getById(o.codeObj._id).toPromise()).data;t.dbMasterConfigCode=o.editorCodeFinder.getValue(),o.codeObj[n.nA.dbMasterConfigCode]=t.dbMasterConfigCode,yield o.dbMastersS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess("DB Master updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}dbMasterUpdateJSUtilsData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.DB_MASTERS_JS_UTILS)try{const t=(yield o.dbMastersS.getById(o.codeObj._id).toPromise()).data;t.pageUtilsCode=o.editorCodeFinder.getValue(),o.codeObj[n.nA.pageUtilsCode]=t.pageUtilsCode,yield o.dbMastersS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess("DB Master utils updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}uiMakerUtilityUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.UI_MAKER_UTILITY_CLASS)try{const t=(yield o.uiMakerUtilsS.getById(o.codeObj._id).toPromise()).data;t.utilsCode=o.editorCodeFinder.getValue(),o.codeObj[n.Kr.utilsCode]=t.utilsCode,yield o.uiMakerUtilsS.put(t._id,t,{select:m.iH._id}).toPromise(),o.ns.showSuccess("UI Maker utility updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}lockAndApiStrCodeCommon(o){for(const t of o)t.version===this.codeObj.version&&(this.codeObj.hookType?(this.codeObj.apiCategory===r.R.CUSTOM_APIS&&this.codeObj.hookType||this.codeObj.apiCategory===r.R.THIRD_PARTY_APIS&&this.codeObj.hookType)&&this.prePostHooksCodeCommon(t):t.apiCodeStr=this.editorCodeFinder.getValue())}prePostHooksCodeCommon(o){for(const t of o.preHooks)t.name===this.codeObj.name&&"Pre Hook"===this.codeObj.hookType&&(t.hookCode=this.editorCodeFinder.getValue());for(const t of o.postHooks)t.name===this.codeObj.name&&"Post Hook"===this.codeObj.hookType&&(t.hookCode=this.editorCodeFinder.getValue())}resetCodeObj(){this.codeObj={},this.editorCodeFinder.setValue("")}catchErrorCommon(o){this.ns.showErrorMessageFromErrorObject(o),this.lastError=o.error,this.tab={axiosResponse:{data:o.error}},this.monacoS.highlightErrorInMonacoEditor(this.editorCodeFinder,this.tab,"MainSandbox.ts",this.monacoDecorations)}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),y.d.json)}isResponseCollapsed=!1;showLoadingTypes;toggleResponseTab(){this.isResponseCollapsed=!this.isResponseCollapsed,this.layout.isResponseCollapsed=!this.layout.isResponseCollapsed}reloadTypes(){var o=this;return(0,c.Z)(function*(){yield o.removeExistingAndLoadFreshTypesInMonacoEditor()})()}removeExistingAndLoadFreshTypesInMonacoEditor(){var o=this;return(0,c.Z)(function*(){try{o.showLoadingTypes=!0,yield o.monacoS.loadTypesInMonaco(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.showLoadingTypes=!1}catch{}o.cd.detectChanges()})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(t){return new(t||s)(e.Y36(M.b),e.Y36(S.L),e.Y36(T.b),e.Y36(v.D),e.Y36(f.d),e.Y36(I.Z),e.Y36(D.j),e.Y36(_.e),e.Y36(O.d),e.Y36(d.f),e.Y36(h.S),e.Y36(l.J),e.Y36(g.l),e.Y36(x.W),e.Y36(N.u),e.Y36(F.e),e.Y36(B.q),e.Y36(L.e),e.Y36(J.G),e.Y36(K.$),e.Y36(H.z),e.Y36(Y.L),e.Y36(W.s),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-code-finder-result"]],viewQuery:function(t,i){if(1&t&&(e.Gf(V,5),e.Gf(z,5)),2&t){let b;e.iGM(b=e.CRH())&&(i.insertCodeModalC=b.first),e.iGM(b=e.CRH())&&(i.viewDockerfileModelC=b.first)}},inputs:{modalId:"modalId"},decls:30,vars:28,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header","font-weight-normal"],[2,"font-size","small"],[1,"fas","fa-list-alt","text-yellow","fa-fw","mr-1"],[4,"ngIf"],[1,"overflow-hidden","h-100"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["tooltipPosition","top",3,"pTooltip"],["pTooltip","Instances","tooltipPosition","top",1,"pl-1"],["pTooltip","Databases","tooltipPosition","top",1,"pl-1"],["pTooltip","Collections","tooltipPosition","top",1,"pl-1"],["pTooltip","API","tooltipPosition","top",1,"pl-1"],["pTooltip","Hook Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Hook Type","tooltipPosition","top",1,"pl-1","small","text-secondary"],["pTooltip","Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Schedulers Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Version","tooltipPosition","top",1,"pl-1","small","text-secondary"],["pTooltip","Event Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Listener Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Custom API Name","tooltipPosition","top",1,"pl-1"],["class","pl-1","pTooltip","Hook Name","tooltipPosition","top",4,"ngIf"],["class","pl-1 small text-secondary","pTooltip","Hook Type","tooltipPosition","top",4,"ngIf"],["pTooltip","Library","tooltipPosition","top",1,"pl-1"],["pTooltip","API Versions","tooltipPosition","top",1,"pl-1"],["pTooltip","API Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Utility Class Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Secret Name","tooltipPosition","top",1,"pl-1"],["pTooltip","System Api Name","tooltipPosition","top",1,"pl-1"],[1,"float-right","cursor-pointer","mr-2",3,"ngStyle","click"],[1,"fas","fa-save","text-success","fa-fw"],["pTooltip","Toggle response panel","tooltipPosition","left",1,"float-right","cursor-pointer","mr-2",3,"click"],[1,"fas","fa-window-maximize","text-warning","fa-fw","fa-rotate-90"],["sava-no-dbl-click","","pTooltip","Reload types","tooltipPosition","left",1,"float-right","cursor-pointer","mr-2",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],["class","d-inline-block text-danger float-right mr-2",4,"ngIf"],["class","mr-2 font-weight-bold float-right matchCircle",3,"pTooltip",4,"ngIf"],["href","javascript:;","class","text-danger float-right mr-2",3,"click",4,"ngIf"],[1,"d-inline-block","text-danger","float-right","mr-2"],["pTooltip","Loading types...","tooltipPosition","left",1,"fas","fa-spinner","fa-fw","fa-spin","fa-lg"],[1,"mr-2","font-weight-bold","float-right","matchCircle",3,"pTooltip"],["href","javascript:;",1,"text-danger","float-right","mr-2",3,"click"]],template:function(t,i){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span",2),e._UZ(3,"i",3),e.YNc(4,X,15,8,"span",4),e.YNc(5,ee,9,5,"span",4),e.YNc(6,oe,9,5,"span",4),e.YNc(7,te,5,3,"span",4),e.YNc(8,ie,5,3,"span",4),e.YNc(9,se,7,4,"span",4),e.YNc(10,ae,9,5,"span",4),e.YNc(11,re,9,6,"span",4),e.YNc(12,_e,13,8,"span",4),e.YNc(13,le,7,4,"span",4),e.YNc(14,Ce,5,3,"span",4),e.YNc(15,ue,5,3,"span",4),e.YNc(16,ge,5,3,"span",4),e.YNc(17,me,11,6,"span",4),e.YNc(18,he,9,5,"span",4),e.YNc(19,Oe,9,5,"span",4),e.YNc(20,Se,9,5,"span",4),e.YNc(21,Te,9,5,"span",4),e.YNc(22,fe,5,3,"span",4),e.qZA(),e.YNc(23,Pe,11,5,"span",4),e.qZA(),e.TgZ(24,"div",5)(25,"app-monaco-editor",6),e.NdJ("editorGenerated",function(U){return i.editorGenerated(U)}),e.qZA()()(),e._UZ(26,"app-insert-code-modal",7,8)(28,"app-monaco-editor-modal",9,10)),2&t&&(e.xp6(4),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.INSTANCE_API_HOOKS_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.SYSTEM_APIS),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.SYSTEM_API_HOOKS_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.MIGRATION_SCRIPT),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.PROCESS_INITIALIZER),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.SCHEDULERS),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.EVENTS),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.CUSTOM_APIS),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.THIRD_PARTY_APIS),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.UTILITY_CLASS),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.I18N_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.SECRET_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.SYSTEM_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.INSTANCE_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.THIRD_PARTY_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.SCHEMA_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.DB_MASTERS_JSON),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.DB_MASTERS_JS_UTILS),e.xp6(1),e.Q6J("ngIf",i.codeObj&&i.codeObj.apiCategory===i.EAPICategory.UI_MAKER_UTILITY_CLASS),e.xp6(1),e.Q6J("ngIf",i.codeObj.apiCategory),e.xp6(2),e.Q6J("isSchemaEditor",!0)("editorOptions",i.editorOptionsEditorCodeFinder),e.xp6(1),e.Q6J("frameId","idInsertCodeFinder")("modalId","idInsertCodeFinderForm")("docsHostPort",i.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInCodeFinder")("editorOptionsMonacoEditorModal",i.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[Z.O5,Z.PC,Q.y,w.P,k.O,q.u,G.A],styles:[".from-modal[_ngcontent-%COMP%]{height:calc(100vh - 117px)}.from-page[_ngcontent-%COMP%]{height:calc(100vh - 87px)}.matchCircle[_ngcontent-%COMP%]{background-color:#ff0;border-radius:10px;padding:0 6px;color:#000}"],changeDetection:0})}return s})()},7566:(R,A,a)=>{a.d(A,{Q:()=>f});var c=a(5861),p=a(1162),u=a(5085),n=a(4946),m=a(3429),E=a(5852),r=a(9961),y=a(2915),P=a(7240),j=a(95),e=a(6814),M=a(7680),S=a(3259);function T(I,D){if(1&I&&(n.TgZ(0,"span",23),n._uU(1),n.qZA()),2&I){const _=n.oxw();n.xp6(1),n.hij("Total Items: ",_.searchArrays.length,"")}}function v(I,D){1&I&&n._UZ(0,"p-progressSpinner",24)}let f=(()=>{class I{instanceS;authCS;ns;eventCenterS;cd;generalS;loading={grid:!1};subscriptions=[];searchArrays=[];gridKey=p.iH._id;searchText="";isCaseSensitive=!1;constructor(_,O,d,h,l,g){this.instanceS=_,this.authCS=O,this.ns=d,this.eventCenterS=h,this.cd=l,this.generalS=g}ngOnInit(){this.generalS.setNewTitle("API Maker - Code Finder")}codeSearch(){var _=this;return(0,c.Z)(function*(){try{_.loading.grid=!0;const O={text:_.searchText.trim(),user:_.authCS.getUserId(),isCaseSensitive:_.isCaseSensitive};if(O.text){const d=yield _.instanceS.codeFinderData(O);if(d.success)if(_.searchArrays=d.data,_.searchArrays.length)_.showDataInUI();else{const h=[];h.push('<div class="bold text-warning cursor-pointer pt-3 text-center">\n <span class="pl-2">No match found</span>\n </div>'),$("[name='codeBlock']").html(h.join("")),_.eventCenterS.codeFinderResult.next([])}}_.loading.grid=!1,_.cd.detectChanges()}catch(O){_.ns.showErrorFromResponse(O.error||O,"Unable to code search.")}})()}showDataInUI(){const _=[],O=[];for(const d of this.searchArrays){const h=this.searchArrays.indexOf(d);let l="",g="";d.apiCategory===u.R.SCHEDULERS?(l="SCH",g="Scheduler"):d.apiCategory===u.R.MIGRATION_SCRIPT?(l="DB-MS",g="Database Migration Script"):d.apiCategory===u.R.PROCESS_INITIALIZER?(l="PI",g="Process Initializer"):d.apiCategory===u.R.EVENTS?(l="EV",g="Event"):d.apiCategory===u.R.CUSTOM_APIS?(l="CA",g="Custom APIs"):d.apiCategory===u.R.THIRD_PARTY_APIS?(l="TP",g="Third Party APIs"):d.apiCategory===u.R.THIRD_PARTY_API_SETTINGS_JSON?(l="TP-S",g="Third Party API Settings"):d.apiCategory===u.R.INSTANCE_API_SETTINGS_JSON?(l="INS-J",g="Instance APIs Settings"):d.apiCategory===u.R.INSTANCE_API_HOOKS_JSON?(l="INS-Hook",g="Instance APIs Hooks"):d.apiCategory===u.R.SYSTEM_API_SETTINGS_JSON?(l="SYS-J",g="System API Settings"):d.apiCategory===u.R.SYSTEM_API_HOOKS_JSON?(l="SYS-Hook",g="System API Hooks"):d.apiCategory===u.R.UTILITY_CLASS?(l="UTIL",g="Utility Classes"):d.apiCategory===u.R.I18N_JSON?(l="I18N",g="Internationalization Settings"):d.apiCategory===u.R.SECRET_JSON?(l="SEC",g="Secret"):d.apiCategory===u.R.SCHEMA_JSON?(l="SC",g="Schema"):d.apiCategory===u.R.DB_MASTERS_JSON?(l="DMC",g="DB Master Config"):d.apiCategory===u.R.DB_MASTERS_JS_UTILS?(l="DMU",g="DB Master Utils"):d.apiCategory===u.R.UI_MAKER_UTILITY_CLASS?(l="UMU",g="UI Maker Utils"):(l=d.categoryName,g=d.categoryName),d.prefix=l,d.tooltip=g,d.versionUI="-1"===d?.version?"Original":d?.version?d.version:"",_.push('<div class="bold cursor-pointer pt-1">'),_.push('<i class="fas fa-times fa-fw text-danger float-right pt-1 nameRemoveSearchResultBlock"></i>'),_.push(`<span class="pl-2 font-weight-bold" title="${g}">${l} :</span>`),d.name&&_.push(`<span class="pl-2">${d.name}</span>`),d.versionUI&&_.push(`<span class="pl-2 small text-secondary">${"("+d.versionUI+")"}</span>`),d.hookType&&_.push(`<span class="pl-2 small">${"["+d.hookType+"]"}</span>`),_.push(`<pre class="h-100 language-javascript m-1 cursor-pointer"><code name="namePrismCss" id="idCodeFinder_${h}" class="language-javascript"></code></pre>`),_.push("</div>"),O.push({i:h,code:d.apiCode})}$("[name='codeBlock']").html(_.join(""));for(const d of O)$(`#idCodeFinder_${d.i}`).text(d.code),Prism.highlightElement(document.getElementById(`idCodeFinder_${d.i}`));this.cd.detectChanges(),$("pre.language-javascript").on("click",d=>{$("pre.bg-primary").removeClass("bg-primary"),$(d.currentTarget.className+=" bg-primary");const h=$(d.currentTarget.childNodes).attr("id").split("_")[1];this.searchArrays[h].searchKeyWord=this.searchText.trim(),this.eventCenterS.codeFinderResult.next([this.searchArrays[h]])}),$("i.nameRemoveSearchResultBlock").on("click",d=>{const h=Number($(d.currentTarget).parent().find("code[name=namePrismCss]").attr("id").split("_")[1]);this.searchArrays.splice(h,1),this.showDataInUI()})}clear(){this.searchText="",this.eventCenterS.codeFinderResult.next([]),$("[name='codeBlock']").empty(),this.searchArrays=[]}static \u0275fac=function(O){return new(O||I)(n.Y36(m.E),n.Y36(E.D),n.Y36(r.W),n.Y36(y.u),n.Y36(n.sBO),n.Y36(P.b))};static \u0275cmp=n.Xpm({type:I,selectors:[["app-code-finder-search"]],decls:26,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header","font-weight-normal"],["src","/assets/images/icons/finder.svg","alt","Code Finder",1,"fa-fw","mr-1"],["class","pl-3 text-info",4,"ngIf"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/features/code-finder.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"pt-1","pl-1","pr-1"],[1,"input-group","input-group-sm","mb-1"],["name","searchText","id","code_search","placeholder","Enter To Search",1,"form-control","form-control-sm",3,"ngModel","ngModelChange","keyup.enter"],[1,"input-group-append"],["type","button","pTooltip","Clear","tooltipPosition","bottom",1,"btn","btn-outline-warning",3,"click"],[1,"fas","fa-ban","fa-fw"],["type","button","data-toggle","dropdown","pTooltip","Case Sensitive","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-info"],[1,"fas","fa-ellipsis-v"],[1,"dropdown-menu","pl-4"],["type","checkbox","name","idIsCaseSensitive","id","idIsCaseSensitive",1,"p-checkbox",2,"vertical-align","middle!important",3,"ngModel","ngModelChange"],["for","idIsCaseSensitive",1,"pt-1","pl-2"],[1,"card-body","p-0","h-100","overflow-auto"],[1,"position-relative","h-100"],[1,"overflow-auto"],["name","codeBlock"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"pl-3","text-info"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(O,d){1&O&&(n.TgZ(0,"div",0)(1,"div",1)(2,"span"),n._UZ(3,"img",2),n._uU(4," Search"),n.qZA(),n.YNc(5,T,2,1,"span",3),n.TgZ(6,"div",4)(7,"a",5),n._UZ(8,"img",6),n.qZA()()(),n.TgZ(9,"div",7)(10,"div",8)(11,"input",9),n.NdJ("ngModelChange",function(l){return d.searchText=l})("keyup.enter",function(){return d.codeSearch()}),n.qZA(),n.TgZ(12,"div",10)(13,"button",11),n.NdJ("click",function(){return d.clear()}),n._UZ(14,"i",12),n.qZA(),n.TgZ(15,"button",13),n._UZ(16,"i",14),n.qZA(),n.TgZ(17,"div",15)(18,"input",16),n.NdJ("ngModelChange",function(l){return d.isCaseSensitive=l}),n.qZA(),n.TgZ(19,"label",17),n._uU(20,"Case Sensitive"),n.qZA()()()()(),n.TgZ(21,"div",18)(22,"div",19)(23,"div",20),n._UZ(24,"div",21),n.YNc(25,v,1,0,"p-progressSpinner",22),n.qZA()()()()),2&O&&(n.xp6(5),n.Q6J("ngIf",d.searchArrays.length),n.xp6(6),n.Q6J("ngModel",d.searchText),n.xp6(7),n.Q6J("ngModel",d.isCaseSensitive),n.xp6(7),n.Q6J("ngIf",d.loading.grid))},dependencies:[j.Fj,j.Wl,j.JJ,j.On,e.O5,M.G,S.u],encapsulation:2,changeDetection:0})}return I})()},3300:(R,A,a)=>{a.d(A,{k:()=>j});var c=a(1162),p=a(4946),u=a(7240),n=a(6814),m=a(7566),E=a(365);const r=["codeFinderResult"],y=function(e,M){return{"col-4":e,"d-none":M}},P=function(e,M){return{"col-8":e,"col-12":M}};let j=(()=>{class e{cd;generalS;modalId="idDefaultCodeFinderId";loading={grid:!1};subscriptions=[];gridKey=c.iH._id;codeFinderResult;constructor(S,T){this.cd=S,this.generalS=T}ngOnInit(){setTimeout(()=>{this.codeFinderResult.layout=this},1e3)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(T){return new(T||e)(p.Y36(p.sBO),p.Y36(u.b))};static \u0275cmp=p.Xpm({type:e,selectors:[["app-code-finder-w"]],viewQuery:function(T,v){if(1&T&&p.Gf(r,5),2&T){let f;p.iGM(f=p.CRH())&&(v.codeFinderResult=f.first)}},inputs:{modalId:"modalId"},decls:7,vars:9,consts:[[1,"pt-1","pl-1","pr-1"],[1,"row","m-0","overflow-hidden","code-finder-height"],[1,"p-0","h-100",3,"ngClass"],[1,"w-100"],[1,"w-100",3,"modalId"],["codeFinderResult",""]],template:function(T,v){if(1&T&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._UZ(3,"app-code-finder-search",3),p.qZA(),p.TgZ(4,"div",2),p._UZ(5,"app-code-finder-result",4,5),p.qZA()()()),2&T){const f=p.MAs(6);p.xp6(2),p.Q6J("ngClass",p.WLB(3,y,!f.isResponseCollapsed,f.isResponseCollapsed)),p.xp6(2),p.Q6J("ngClass",p.WLB(6,P,!f.isResponseCollapsed,f.isResponseCollapsed)),p.xp6(1),p.Q6J("modalId",v.modalId)}},dependencies:[n.mk,m.Q,E.n],encapsulation:2,changeDetection:0})}return e})()},7470:(R,A,a)=>{a.r(A),a.d(A,{CodeFinderM:()=>M});var c=a(7664),p=a(8176),u=a(3726),n=a(3300),y=(a(2883),a(7566),a(365),a(4950)),P=a(4946);const j=[{path:"finder",component:n.k,canActivate:[u.P]}];let M=(()=>{class S{static \u0275fac=function(f){return new(f||S)};static \u0275mod=P.oAB({type:S});static \u0275inj=P.cJS({imports:[c.Bz.forChild(j),p.u,y.A]})}return S})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7470],{2883:(R,I,a)=>{a.d(I,{c:()=>u});var c=a(4946),_=a(3300);let u=(()=>{class n{hideCodeFinderModel=new c.vpe;loading={form:!1,response:!1};constructor(){}ngOnInit(){}showModal(){$("#idCodeFinder").modal("show")}hideModal(){$("#idCodeFinder").modal("hide")}hideModalEvent(){this.hideCodeFinderModel.emit(!0)}ngOnDestroy(){}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=c.Xpm({type:n,selectors:[["app-code-finder-modal"]],outputs:{hideCodeFinderModel:"hideCodeFinderModel"},decls:8,vars:1,consts:[["id","idCodeFinder","role","dialog","data-backdrop","static","data-keyboard","false",1,"pt-1","pl-1","pr-1","overflow-auto","modal","parent-notes-modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content","border-0"],["aria-label","Close","type","button",1,"close","position-absolute",2,"top","0.25rem","right","0.5rem","z-index","1",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close","m-1"],[1,"modal-body","p-0"],[3,"modalId"]],template:function(r,y){1&r&&(c.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),c.NdJ("click",function(){return y.hideModalEvent()}),c.TgZ(4,"span",4),c._UZ(5,"i",5),c.qZA()(),c.TgZ(6,"div",6),c._UZ(7,"app-code-finder-w",7),c.qZA()()()()),2&r&&(c.xp6(7),c.Q6J("modalId","idCodeFinder"))},dependencies:[_.k],encapsulation:2,changeDetection:0})}return n})()},365:(R,I,a)=>{a.d(I,{n:()=>Ze});var c=a(5861),_=a(6990),n=a(1440),g=a(1162),E=a(553),r=a(5085),y=a(1601),P=a(3531),j=a(9989),e=a(4946),b=a(7240),S=a(7414),T=a(2304),U=a(5852),f=a(7629),A=a(1042),Z=a(602),l=a(2694),h=a(2559),d=a(5394),m=a(9448),p=a(3366),O=a(3645),x=a(5800),N=a(6457),F=a(7145),B=a(9961),H=a(2915),L=a(1344),J=a(6233),K=a(115),k=a(1252),Y=a(9530),W=a(9729),Q=a(6125),q=a(204),D=a(6814),w=a(2660),G=a(5860),V=a(756),z=a(3259),X=a(5025);const ee=["insertCodeModalC"],oe=["monacoEditorModalC"];function te(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.qZA(),e.TgZ(11,"span",16),e._uU(12),e.qZA(),e.TgZ(13,"span",17),e._uU(14),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function se(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ie(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",16),e._uU(8),e.qZA(),e.TgZ(9,"span",17),e._uU(10),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ae(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",16),e._uU(10),e.qZA(),e.TgZ(11,"span",17),e._uU(12),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ne(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",15),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function de(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",15),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function re(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function ce(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function pe(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",19),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function _e(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",21),e._uU(4),e.qZA(),e.TgZ(5,"span",22),e._uU(6),e.qZA(),e.TgZ(7,"span",20),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.eventName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.eventListenersName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function le(i,C){if(1&i&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.hij(" \u2192 ",o.codeObj.name,"")}}function Ce(i,C){if(1&i&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.Oqu(o.codeObj.hookType)}}function ue(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",23),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA(),e.YNc(7,le,2,1,"span",24),e.YNc(8,Ce,2,1,"span",25),e.qZA()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.customApiName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":""),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType)}}function Oe(i,C){if(1&i&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.hij(" \u2192 ",o.codeObj.name,"")}}function ge(i,C){if(1&i&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.Oqu(o.codeObj.hookType)}}function me(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",26),e._uU(4),e.qZA(),e.TgZ(5,"span",27),e._uU(6),e.qZA(),e.TgZ(7,"span",28),e._uU(8),e.qZA(),e.TgZ(9,"span",20),e._uU(10),e.qZA(),e.YNc(11,Oe,2,1,"span",24),e.YNc(12,ge,2,1,"span",25),e.qZA()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.bundleName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.apiVersion),e.xp6(2),e.hij("",o.codeObj.apiName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":""),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType)}}function he(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",29),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.utilityClassName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function Se(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Te(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function fe(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",31),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Ee(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiId," ")}}function Ae(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",26),e._uU(4),e.qZA(),e.TgZ(5,"span",27),e._uU(6),e.qZA(),e.TgZ(7,"span",28),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.bundleName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiVersion," \u2192 "),e.xp6(2),e.hij("",o.codeObj.name," ")}}function Ie(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function ye(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function Pe(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function je(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function be(i,C){1&i&&(e.TgZ(0,"span",41),e._UZ(1,"i",42),e.qZA())}function Me(i,C){if(1&i&&(e.TgZ(0,"span",43),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.Q6J("pTooltip",o.matchFound+" match found in this file."),e.xp6(1),e.Oqu(o.matchFound)}}function Ue(i,C){if(1&i){const o=e.EpF();e.TgZ(0,"a",44),e.NdJ("click",function(){e.CHM(o);const s=e.oxw(2);return e.KtG(s.viewError())}),e._uU(1,"View error"),e.qZA()}}const ve=function(){return{"margin-right":"30px"}};function Re(i,C){if(1&i){const o=e.EpF();e.TgZ(0,"span")(1,"span",32),e.NdJ("click",function(){e.CHM(o);const s=e.oxw();return e.KtG(s.saveData())}),e._UZ(2,"i",33),e._uU(3,"Save "),e.qZA(),e.TgZ(4,"span",34),e.NdJ("click",function(){e.CHM(o);const s=e.oxw();return e.KtG(s.toggleResponseTab())}),e._UZ(5,"i",35),e.qZA(),e.TgZ(6,"span",36),e.NdJ("click",function(){e.CHM(o);const s=e.oxw();return e.KtG(s.reloadTypes())}),e._UZ(7,"i",37),e.qZA(),e.YNc(8,be,2,0,"span",38),e.YNc(9,Me,2,2,"span",39),e.YNc(10,Ue,2,0,"a",40),e.qZA()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("ngStyle",o.modalId?e.DdM(4,ve):""),e.xp6(7),e.Q6J("ngIf",o.showLoadingTypes),e.xp6(1),e.Q6J("ngIf",o.matchFound),e.xp6(1),e.Q6J("ngIf",o.lastError)}}let Ze=(()=>{class i{generalCS;constantsS;monacoS;authCS;functionS;schedulerS;dbMigrationS;processInitializersS;tpInstalledApisS;instanceApiSettingsS;instanceApiHooksS;instanceHooksS;databaseHooksS;collectionHooksS;systemApiSettingsS;amEventS;ns;eventCenterS;feStoreCS;i18nS;secretS;tpApiSettingsS;schemaS;dbMastersS;uiMakerUtilsS;constantsCS;cd;modalId;DOCS_HOST_PORT=E.N.DOCS_HOST_PORT;loading={grid:!1};subscriptions=[];editorCodeFinder;editorOptionsEditorCodeFinder={readOnly:!1,language:y.d.typescript,contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};gridKey=g.iH._id;BE_HOST_PORT=E.N.BE_HOST_PORT;EAPICategory=r.R;codeObj={};monacoDecorations=[];tab;insertCodeModalC;viewDockerfileModelC;lastCodeFinderObject={};matchFound=0;constructor(o,t,s,M,v,De,xe,Ne,Fe,Be,He,Le,Je,Ke,ke,Ye,We,Qe,qe,we,Ge,Ve,$e,ze,Xe,eo,oo){this.generalCS=o,this.constantsS=t,this.monacoS=s,this.authCS=M,this.functionS=v,this.schedulerS=De,this.dbMigrationS=xe,this.processInitializersS=Ne,this.tpInstalledApisS=Fe,this.instanceApiSettingsS=Be,this.instanceApiHooksS=He,this.instanceHooksS=Le,this.databaseHooksS=Je,this.collectionHooksS=Ke,this.systemApiSettingsS=ke,this.amEventS=Ye,this.ns=We,this.eventCenterS=Qe,this.feStoreCS=qe,this.i18nS=we,this.secretS=Ge,this.tpApiSettingsS=Ve,this.schemaS=$e,this.dbMastersS=ze,this.uiMakerUtilsS=Xe,this.constantsCS=eo,this.cd=oo}ngOnInit(){this.subscriptions.push(this.eventCenterS.codeFinderResult.subscribe(o=>{if(o.length){this.codeObj=o[0],_.isEmpty(this.lastCodeFinderObject)||this.getBackupOfMonacoEditor(this.lastCodeFinderObject),this.lastCodeFinderObject=this.codeObj,this.generalCS.setValueInEditor(this,"editorCodeFinder",this.codeObj?.apiCodeStr),this.restoreBackupOfMonacoEditor(this.lastCodeFinderObject);const t=this.editorCodeFinder.getModel().findMatches(o[0].searchKeyWord,!0,!1,!1,null,!0);this.lastCodeFinderObject.cursorPosition={lineNumber:t[0]?.range?.startLineNumber,column:t[0]?.range?.startColumn},this?.lastCodeFinderObject?.cursorPosition?.lineNumber&&this.editorCodeFinder.setPosition(this?.lastCodeFinderObject?.cursorPosition),t[0]?.range?.startLineNumber&&this.editorCodeFinder.revealLineInCenter(t[0]?.range?.startLineNumber),t[0]?.range&&this.editorCodeFinder.revealRange(t[0].range,1),this.editorCodeFinder.deltaDecorations(this.monacoDecorations,[]),this.monacoDecorations=[];for(const s of t){const M=[{range:new monaco.Range(s?.range?.startLineNumber,s?.range?.startColumn,s?.range?.endLineNumber,s?.range?.endColumn),options:{inlineClassName:"highlightMatchedWord"}}];if(this.editorCodeFinder){const v=this.editorCodeFinder.deltaDecorations([],M);this.monacoDecorations.push(...v)}}this.matchFound=this.monacoDecorations.length,this.editorCodeFinder.focus()}else this.resetCodeObj();this.lastError=void 0,this.cd.detectChanges()}))}getBackupOfMonacoEditor(o){o.viewState=this.editorCodeFinder.saveViewState()}restoreBackupOfMonacoEditor(o){o.viewState&&this.editorCodeFinder.restoreViewState(o.viewState),o.cursorPosition?.lineNumber?this.editorCodeFinder.setPosition(o.cursorPosition):(o.cursorPosition={lineNumber:1,column:1},this.editorCodeFinder.setPosition(o.cursorPosition),this.editorCodeFinder.setScrollTop(0),this.editorCodeFinder.setScrollLeft(0)),this.editorCodeFinder.focus()}editorGenerated(o){var t=this;return(0,c.Z)(function*(){t.editorCodeFinder=o,yield t.monacoS.loadSchemaEditorSettings(t.BE_HOST_PORT,t.authCS.getUserId(),null),t.monacoS.addSaveCodeKeyBinding(o,s=>{t.codeObj&&t.saveData()}),t.editorCodeFinder.onDidChangeCursorPosition(s=>{t.lastCodeFinderObject&&1!==s.position.lineNumber&&1!==s.position.column&&(t.lastCodeFinderObject.cursorPosition=s.position)}),t.monacoS.addInsertCodeKeyBinding(o,s=>{(t.codeObj.apiCategory===r.R.INSTANCES||t.codeObj.apiCategory===r.R.THIRD_PARTY_APIS||t.codeObj.apiCategory===r.R.CUSTOM_APIS||t.codeObj.apiCategory===r.R.SYSTEM_APIS||t.codeObj.apiCategory===r.R.EVENTS||t.codeObj.apiCategory===r.R.SCHEDULERS||t.codeObj.apiCategory===r.R.UTILITY_CLASS||t.codeObj.apiCategory===r.R.MIGRATION_SCRIPT||t.codeObj.apiCategory===r.R.PROCESS_INITIALIZER||t.codeObj.apiCategory===r.R.INSTANCE_API_HOOKS_JSON||t.codeObj.apiCategory!==r.R.I18N_JSON&&t.codeObj.apiCategory!==r.R.SECRET_JSON&&t.codeObj.apiCategory!==r.R.INSTANCE_API_SETTINGS_JSON&&t.codeObj.apiCategory!==r.R.THIRD_PARTY_API_SETTINGS_JSON&&t.codeObj.apiCategory!==r.R.SCHEMA_JSON&&t.codeObj.apiCategory!==r.R.SYSTEM_API_SETTINGS_JSON)&&t.insertCodeModalC.showModal(P.b.CodeFinderResultC)}),t.subscriptions.push(t.generalCS.messageReceived.subscribe(s=>{s.type&&s.type===j.g.TEXT_COPIED&&s.componentName===P.b.CodeFinderResultC&&(t.monacoS.insertAtCursor(o,s.selectedText),t.insertCodeModalC.hideModal())})),t.monacoS.addToggleCodeKeyBinding(o,s=>{t.toggleResponseTab(),t.layout.cd.detectChanges(),t.cd.detectChanges()})})()}layout;saveData(){var o=this;return(0,c.Z)(function*(){o.monacoS.clearEditorDecorations(o.editorCodeFinder,o.monacoDecorations),yield o.customApisUpdateData(),yield o.schedulerApisUpdateData(),yield o.dbMigrationUpdateData(),yield o.processInitializerUpdateData(),yield o.amEventsUpdateData(),yield o.tpApisUpdateData(),yield o.instanceApisSettingUpdateData(),yield o.instanceApisHooksUpdateData(),yield o.instanceHooksUpdateData(),yield o.databaseHooksUpdateData(),yield o.collectionHooksUpdateData(),yield o.sysApisSettingUpdateData(),yield o.utilityClassesUpdateData(),yield o.i18nUpdateData(),yield o.secretsUpdateData(),yield o.tpApiSettingUpdateData(),yield o.schemaUpdateData(),yield o.dbMasterUpdateData(),yield o.dbMasterUpdateJSUtilsData(),yield o.uiMakerUtilityUpdateData(),o.cd.detectChanges()})()}customApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.CUSTOM_APIS)try{const t=(yield o.functionS.getById(o.codeObj._id).toPromise()).data;o.lockAndApiStrCodeCommon(t.versions),yield o.functionS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.functions.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}schedulerApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.SCHEDULERS)try{const t=(yield o.schedulerS.getById(o.codeObj._id).toPromise()).data;o.lockAndApiStrCodeCommon(t.versions),yield o.schedulerS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.schedulers.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}dbMigrationUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.MIGRATION_SCRIPT)try{const t=(yield o.dbMigrationS.getById(o.codeObj._id).toPromise()).data;t.dbMigrationScriptCode=o.editorCodeFinder.getValue(),yield o.dbMigrationS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.dbMigration.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}processInitializerUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.PROCESS_INITIALIZER)try{const t=(yield o.processInitializersS.getById(o.codeObj._id).toPromise()).data;t.processInitializerCode=o.editorCodeFinder.getValue(),yield o.processInitializersS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.processInitializer.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}amEventsUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.EVENTS)try{const t=(yield o.amEventS.getById(o.codeObj._id).toPromise()).data;for(const s of t.eventListeners)s._id===o.codeObj.eventListenersId&&s.name===o.codeObj.eventListenersName&&o.lockAndApiStrCodeCommon(s.versions);yield o.amEventS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.amEventListeners.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}tpApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.THIRD_PARTY_APIS)try{const t=(yield o.tpInstalledApisS.getById(o.codeObj._id).toPromise()).data;o.lockAndApiStrCodeCommon(t.versions),yield o.tpInstalledApisS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}instanceApisSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.INSTANCES||o.codeObj.apiCategory===r.R.INSTANCE_API_SETTINGS_JSON)try{const t=(yield o.instanceApiSettingsS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.INSTANCE_API_SETTINGS_JSON&&(t.instanceApiSettingCode=o.editorCodeFinder.getValue()),o.codeObj.apiCategory===r.R.INSTANCES&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceApiSettingsS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}instanceApisHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.INSTANCE_API_HOOKS_JSON)try{const t=(yield o.instanceApiHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.INSTANCE_API_HOOKS_JSON&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceApiHooksS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}instanceHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.INSTANCE_HOOKS)try{const t=(yield o.instanceApiHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.INSTANCE_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceHooksS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}databaseHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.DATABASE_HOOKS)try{const t=(yield o.databaseHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.DATABASE_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.databaseHooksS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}collectionHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.COLLECTION_HOOKS)try{const t=(yield o.collectionHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.COLLECTION_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.collectionHooksS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}sysApisSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.SYSTEM_APIS||o.codeObj.apiCategory===r.R.SYSTEM_API_SETTINGS_JSON)try{const t=(yield o.systemApiSettingsS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===r.R.SYSTEM_API_SETTINGS_JSON&&(t.sysApiSettingCode=o.editorCodeFinder.getValue()),o.codeObj.apiCategory===r.R.SYSTEM_APIS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.systemApiSettingsS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}utilityClassesUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.UTILITY_CLASS)try{const t=(yield o.feStoreCS.getByIdUtilityClasses(o.BE_HOST_PORT,o.codeObj._id).toPromise()).data;o.lockAndApiStrCodeCommon(t.versions),yield o.feStoreCS.putUtilityClasses(o.BE_HOST_PORT,t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsCS.utilityClassesS.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}i18nUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.I18N_JSON)try{const t=(yield o.i18nS.getById(o.codeObj._id).toPromise()).data;t.keysCode=o.editorCodeFinder.getValue(),yield o.i18nS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.i18n.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}secretsUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.SECRET_JSON)try{const t=(yield o.secretS.getById(o.codeObj._id).toPromise()).data;t.keysCode=o.editorCodeFinder.getValue(),t.keysCode=o.generalCS.getEncryptedString(t.keysCode,E.N.crypto.passCommunication),yield o.secretS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsCS.secret.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}tpApiSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.THIRD_PARTY_API_SETTINGS_JSON)try{const t=(yield o.tpApiSettingsS.getById(o.codeObj._id).toPromise()).data;t.thirdPartyApiSettingsCode=o.editorCodeFinder.getValue(),yield o.tpApiSettingsS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.tpApiSettings.addOrUpdateSuccess)}catch(t){o.catchErrorCommon(t)}})()}schemaUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.SCHEMA_JSON)try{const t=(yield o.schemaS.getById(o.codeObj._id).toPromise()).data;t.propertiesCode=o.editorCodeFinder.getValue(),yield o.schemaS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("Schema updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}dbMasterUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.DB_MASTERS_JSON)try{const t=(yield o.dbMastersS.getById(o.codeObj._id).toPromise()).data;t.dbMasterConfigCode=o.editorCodeFinder.getValue(),o.codeObj[n.nA.dbMasterConfigCode]=t.dbMasterConfigCode,yield o.dbMastersS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("DB Master updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}dbMasterUpdateJSUtilsData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.DB_MASTERS_JS_UTILS)try{const t=(yield o.dbMastersS.getById(o.codeObj._id).toPromise()).data;t.pageUtilsCode=o.editorCodeFinder.getValue(),o.codeObj[n.nA.pageUtilsCode]=t.pageUtilsCode,yield o.dbMastersS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("DB Master utils updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}uiMakerUtilityUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===r.R.UI_MAKER_UTILITY_CLASS)try{const t=(yield o.uiMakerUtilsS.getById(o.codeObj._id).toPromise()).data;t.utilsCode=o.editorCodeFinder.getValue(),o.codeObj[n.Kr.utilsCode]=t.utilsCode,yield o.uiMakerUtilsS.put(t._id,t,{select:g.iH._id}).toPromise(),o.ns.showSuccess("UI Maker utility updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}lockAndApiStrCodeCommon(o){for(const t of o)t.version===this.codeObj.version&&(this.codeObj.hookType?(this.codeObj.apiCategory===r.R.CUSTOM_APIS&&this.codeObj.hookType||this.codeObj.apiCategory===r.R.THIRD_PARTY_APIS&&this.codeObj.hookType)&&this.prePostHooksCodeCommon(t):t.apiCodeStr=this.editorCodeFinder.getValue())}prePostHooksCodeCommon(o){for(const t of o.preHooks)t.name===this.codeObj.name&&"Pre Hook"===this.codeObj.hookType&&(t.hookCode=this.editorCodeFinder.getValue());for(const t of o.postHooks)t.name===this.codeObj.name&&"Post Hook"===this.codeObj.hookType&&(t.hookCode=this.editorCodeFinder.getValue())}resetCodeObj(){this.codeObj={},this.editorCodeFinder.setValue("")}catchErrorCommon(o){this.ns.showErrorMessageFromErrorObject(o),this.lastError=o.error,this.tab=this.tab||{},this.tab.axiosResponse={data:o.error},this.monacoS.highlightErrorInMonacoEditor(this.editorCodeFinder,this.tab,"MainSandbox.ts",this.monacoDecorations)}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),y.d.json)}isResponseCollapsed=!1;showLoadingTypes;toggleResponseTab(){this.isResponseCollapsed=!this.isResponseCollapsed,this.layout.isResponseCollapsed=!this.layout.isResponseCollapsed}reloadTypes(){var o=this;return(0,c.Z)(function*(){yield o.removeExistingAndLoadFreshTypesInMonacoEditor()})()}removeExistingAndLoadFreshTypesInMonacoEditor(){var o=this;return(0,c.Z)(function*(){try{o.showLoadingTypes=!0,yield o.monacoS.loadTypesInMonaco(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.showLoadingTypes=!1}catch{}o.cd.detectChanges()})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(t){return new(t||i)(e.Y36(b.b),e.Y36(S.L),e.Y36(T.b),e.Y36(U.D),e.Y36(f.d),e.Y36(A.Z),e.Y36(Z.j),e.Y36(l.e),e.Y36(h.d),e.Y36(d.f),e.Y36(m.S),e.Y36(p.Q),e.Y36(O.y),e.Y36(x.l),e.Y36(N.J),e.Y36(F.l),e.Y36(B.W),e.Y36(H.u),e.Y36(L.e),e.Y36(J.q),e.Y36(K.e),e.Y36(k.G),e.Y36(Y.$),e.Y36(W.z),e.Y36(Q.L),e.Y36(q.s),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-code-finder-result"]],viewQuery:function(t,s){if(1&t&&(e.Gf(ee,5),e.Gf(oe,5)),2&t){let M;e.iGM(M=e.CRH())&&(s.insertCodeModalC=M.first),e.iGM(M=e.CRH())&&(s.viewDockerfileModelC=M.first)}},inputs:{modalId:"modalId"},decls:33,vars:31,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header","font-weight-normal"],[2,"font-size","small"],[1,"fas","fa-list-alt","text-yellow","fa-fw","mr-1"],[4,"ngIf"],[1,"overflow-hidden","h-100"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["tooltipPosition","top",3,"pTooltip"],["pTooltip","Instances","tooltipPosition","top",1,"pl-1"],["pTooltip","Databases","tooltipPosition","top",1,"pl-1"],["pTooltip","Collections","tooltipPosition","top",1,"pl-1"],["pTooltip","API","tooltipPosition","top",1,"pl-1"],["pTooltip","Hook Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Hook Type","tooltipPosition","top",1,"pl-1","small","text-secondary"],["pTooltip","Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Schedulers Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Version","tooltipPosition","top",1,"pl-1","small","text-secondary"],["pTooltip","Event Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Listener Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Custom API Name","tooltipPosition","top",1,"pl-1"],["class","pl-1","pTooltip","Hook Name","tooltipPosition","top",4,"ngIf"],["class","pl-1 small text-secondary","pTooltip","Hook Type","tooltipPosition","top",4,"ngIf"],["pTooltip","Library","tooltipPosition","top",1,"pl-1"],["pTooltip","API Versions","tooltipPosition","top",1,"pl-1"],["pTooltip","API Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Utility Class Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Secret Name","tooltipPosition","top",1,"pl-1"],["pTooltip","System Api Name","tooltipPosition","top",1,"pl-1"],[1,"float-right","cursor-pointer","mr-2",3,"ngStyle","click"],[1,"fas","fa-save","text-success","fa-fw"],["pTooltip","Toggle response panel","tooltipPosition","left",1,"float-right","cursor-pointer","mr-2",3,"click"],[1,"fas","fa-window-maximize","text-warning","fa-fw","fa-rotate-90"],["sava-no-dbl-click","","pTooltip","Reload types","tooltipPosition","left",1,"float-right","cursor-pointer","mr-2",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],["class","d-inline-block text-danger float-right mr-2",4,"ngIf"],["class","mr-2 font-weight-bold float-right matchCircle",3,"pTooltip",4,"ngIf"],["href","javascript:;","class","text-danger float-right mr-2",3,"click",4,"ngIf"],[1,"d-inline-block","text-danger","float-right","mr-2"],["pTooltip","Loading types...","tooltipPosition","left",1,"fas","fa-spinner","fa-fw","fa-spin","fa-lg"],[1,"mr-2","font-weight-bold","float-right","matchCircle",3,"pTooltip"],["href","javascript:;",1,"text-danger","float-right","mr-2",3,"click"]],template:function(t,s){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span",2),e._UZ(3,"i",3),e.YNc(4,te,15,8,"span",4),e.YNc(5,se,9,5,"span",4),e.YNc(6,ie,11,6,"span",4),e.YNc(7,ae,13,7,"span",4),e.YNc(8,ne,9,5,"span",4),e.YNc(9,de,9,5,"span",4),e.YNc(10,re,5,3,"span",4),e.YNc(11,ce,5,3,"span",4),e.YNc(12,pe,7,4,"span",4),e.YNc(13,_e,9,5,"span",4),e.YNc(14,ue,9,6,"span",4),e.YNc(15,me,13,8,"span",4),e.YNc(16,he,7,4,"span",4),e.YNc(17,Se,5,3,"span",4),e.YNc(18,Te,5,3,"span",4),e.YNc(19,fe,5,3,"span",4),e.YNc(20,Ee,11,6,"span",4),e.YNc(21,Ae,9,5,"span",4),e.YNc(22,Ie,9,5,"span",4),e.YNc(23,ye,9,5,"span",4),e.YNc(24,Pe,9,5,"span",4),e.YNc(25,je,5,3,"span",4),e.qZA(),e.YNc(26,Re,11,5,"span",4),e.qZA(),e.TgZ(27,"div",5)(28,"app-monaco-editor",6),e.NdJ("editorGenerated",function(v){return s.editorGenerated(v)}),e.qZA()()(),e._UZ(29,"app-insert-code-modal",7,8)(31,"app-monaco-editor-modal",9,10)),2&t&&(e.xp6(4),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_API_HOOKS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DATABASE_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.COLLECTION_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_API_HOOKS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.MIGRATION_SCRIPT),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.PROCESS_INITIALIZER),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SCHEDULERS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.EVENTS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.CUSTOM_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.THIRD_PARTY_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.UTILITY_CLASS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.I18N_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SECRET_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.THIRD_PARTY_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SCHEMA_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DB_MASTERS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DB_MASTERS_JS_UTILS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.UI_MAKER_UTILITY_CLASS),e.xp6(1),e.Q6J("ngIf",s.codeObj.apiCategory),e.xp6(2),e.Q6J("isSchemaEditor",!0)("editorOptions",s.editorOptionsEditorCodeFinder),e.xp6(1),e.Q6J("frameId","idInsertCodeFinder")("modalId","idInsertCodeFinderForm")("docsHostPort",s.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInCodeFinder")("editorOptionsMonacoEditorModal",s.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[D.O5,D.PC,w.y,G.P,V.O,z.u,X.A],styles:[".from-modal[_ngcontent-%COMP%]{height:calc(100vh - 117px)}.from-page[_ngcontent-%COMP%]{height:calc(100vh - 87px)}.matchCircle[_ngcontent-%COMP%]{background-color:#ff0;border-radius:10px;padding:0 6px;color:#000}"],changeDetection:0})}return i})()},7566:(R,I,a)=>{a.d(I,{Q:()=>f});var c=a(5861),_=a(1162),u=a(5085),n=a(4946),g=a(3429),E=a(5852),r=a(9961),y=a(2915),P=a(7240),j=a(95),e=a(6814),b=a(7680),S=a(3259);function T(A,Z){if(1&A&&(n.TgZ(0,"span",23),n._uU(1),n.qZA()),2&A){const l=n.oxw();n.xp6(1),n.hij("Total Items: ",l.searchArrays.length,"")}}function U(A,Z){1&A&&n._UZ(0,"p-progressSpinner",24)}let f=(()=>{class A{instanceS;authCS;ns;eventCenterS;cd;generalS;loading={grid:!1};subscriptions=[];searchArrays=[];gridKey=_.iH._id;searchText="";isCaseSensitive=!1;constructor(l,h,d,m,p,O){this.instanceS=l,this.authCS=h,this.ns=d,this.eventCenterS=m,this.cd=p,this.generalS=O}ngOnInit(){this.generalS.setNewTitle("API Maker - Code Finder")}codeSearch(){var l=this;return(0,c.Z)(function*(){try{l.loading.grid=!0;const h={text:l.searchText.trim(),user:l.authCS.getUserId(),isCaseSensitive:l.isCaseSensitive};if(h.text){const d=yield l.instanceS.codeFinderData(h);if(d.success)if(l.searchArrays=d.data,l.searchArrays.length)l.showDataInUI();else{const m=[];m.push('<div class="bold text-warning cursor-pointer pt-3 text-center">\n <span class="pl-2">No match found</span>\n </div>'),$("[name='codeBlock']").html(m.join("")),l.eventCenterS.codeFinderResult.next([])}}l.loading.grid=!1,l.cd.detectChanges()}catch(h){l.ns.showErrorFromResponse(h.error||h,"Unable to code search.")}})()}showDataInUI(){const l=[],h=[];for(const d of this.searchArrays){const m=this.searchArrays.indexOf(d);let p="",O="";d.apiCategory===u.R.SCHEDULERS?(p="SCH",O="Scheduler"):d.apiCategory===u.R.MIGRATION_SCRIPT?(p="DB-MS",O="Database Migration Script"):d.apiCategory===u.R.PROCESS_INITIALIZER?(p="PI",O="Process Initializer"):d.apiCategory===u.R.EVENTS?(p="EV",O="Event"):d.apiCategory===u.R.CUSTOM_APIS?(p="CA",O="Custom APIs"):d.apiCategory===u.R.THIRD_PARTY_APIS?(p="TP",O="Third Party APIs"):d.apiCategory===u.R.THIRD_PARTY_API_SETTINGS_JSON?(p="TP-S",O="Third Party API Settings"):d.apiCategory===u.R.INSTANCE_API_SETTINGS_JSON?(p="INS-J",O="Instance APIs Settings"):d.apiCategory===u.R.INSTANCE_API_HOOKS_JSON?(p="INS-API-Hook",O="Instance APIs Hooks"):d.apiCategory===u.R.INSTANCE_HOOKS?(p="INS-Hook",O="Instance Hooks"):d.apiCategory===u.R.DATABASE_HOOKS?(p="DB-Hook",O="Database Hooks"):d.apiCategory===u.R.COLLECTION_HOOKS?(p="COL-Hook",O="Collection Hooks"):d.apiCategory===u.R.SYSTEM_API_SETTINGS_JSON?(p="SYS-J",O="System API Settings"):d.apiCategory===u.R.SYSTEM_API_HOOKS_JSON?(p="SYS-Hook",O="System API Hooks"):d.apiCategory===u.R.UTILITY_CLASS?(p="UTIL",O="Utility Classes"):d.apiCategory===u.R.I18N_JSON?(p="I18N",O="Internationalization Settings"):d.apiCategory===u.R.SECRET_JSON?(p="SEC",O="Secret"):d.apiCategory===u.R.SCHEMA_JSON?(p="SC",O="Schema"):d.apiCategory===u.R.DB_MASTERS_JSON?(p="DMC",O="DB Master Config"):d.apiCategory===u.R.DB_MASTERS_JS_UTILS?(p="DMU",O="DB Master Utils"):d.apiCategory===u.R.UI_MAKER_UTILITY_CLASS?(p="UMU",O="UI Maker Utils"):(p=d.categoryName,O=d.categoryName),d.prefix=p,d.tooltip=O,d.versionUI="-1"===d?.version?"Original":d?.version?d.version:"",l.push('<div class="bold cursor-pointer pt-1">'),l.push('<i class="fas fa-times fa-fw text-danger float-right pt-1 nameRemoveSearchResultBlock"></i>'),l.push(`<span class="pl-2 font-weight-bold" title="${O}">${p} :</span>`),d.name&&l.push(`<span class="pl-2">${d.name}</span>`),d.versionUI&&l.push(`<span class="pl-2 small text-secondary">${"("+d.versionUI+")"}</span>`),d.hookType&&l.push(`<span class="pl-2 small">${"["+d.hookType+"]"}</span>`),l.push(`<pre class="h-100 language-javascript m-1 cursor-pointer"><code name="namePrismCss" id="idCodeFinder_${m}" class="language-javascript"></code></pre>`),l.push("</div>"),h.push({i:m,code:d.apiCode})}$("[name='codeBlock']").html(l.join(""));for(const d of h)$(`#idCodeFinder_${d.i}`).text(d.code),Prism.highlightElement(document.getElementById(`idCodeFinder_${d.i}`));this.cd.detectChanges(),$("pre.language-javascript").on("click",d=>{$("pre.bg-primary").removeClass("bg-primary"),$(d.currentTarget.className+=" bg-primary");const m=$(d.currentTarget.childNodes).attr("id").split("_")[1];this.searchArrays[m].searchKeyWord=this.searchText.trim(),this.eventCenterS.codeFinderResult.next([this.searchArrays[m]])}),$("i.nameRemoveSearchResultBlock").on("click",d=>{const m=Number($(d.currentTarget).parent().find("code[name=namePrismCss]").attr("id").split("_")[1]);this.searchArrays.splice(m,1),this.showDataInUI()})}clear(){this.searchText="",this.eventCenterS.codeFinderResult.next([]),$("[name='codeBlock']").empty(),this.searchArrays=[]}static \u0275fac=function(h){return new(h||A)(n.Y36(g.E),n.Y36(E.D),n.Y36(r.W),n.Y36(y.u),n.Y36(n.sBO),n.Y36(P.b))};static \u0275cmp=n.Xpm({type:A,selectors:[["app-code-finder-search"]],decls:26,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header","font-weight-normal"],["src","/assets/images/icons/finder.svg","alt","Code Finder",1,"fa-fw","mr-1"],["class","pl-3 text-info",4,"ngIf"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/features/code-finder.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"pt-1","pl-1","pr-1"],[1,"input-group","input-group-sm","mb-1"],["name","searchText","id","code_search","placeholder","Enter To Search",1,"form-control","form-control-sm",3,"ngModel","ngModelChange","keyup.enter"],[1,"input-group-append"],["type","button","pTooltip","Clear","tooltipPosition","bottom",1,"btn","btn-outline-warning",3,"click"],[1,"fas","fa-ban","fa-fw"],["type","button","data-toggle","dropdown","pTooltip","Case Sensitive","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-info"],[1,"fas","fa-ellipsis-v"],[1,"dropdown-menu","pl-4"],["type","checkbox","name","idIsCaseSensitive","id","idIsCaseSensitive",1,"p-checkbox",2,"vertical-align","middle!important",3,"ngModel","ngModelChange"],["for","idIsCaseSensitive",1,"pt-1","pl-2"],[1,"card-body","p-0","h-100","overflow-auto"],[1,"position-relative","h-100"],[1,"overflow-auto"],["name","codeBlock"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"pl-3","text-info"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(h,d){1&h&&(n.TgZ(0,"div",0)(1,"div",1)(2,"span"),n._UZ(3,"img",2),n._uU(4," Search"),n.qZA(),n.YNc(5,T,2,1,"span",3),n.TgZ(6,"div",4)(7,"a",5),n._UZ(8,"img",6),n.qZA()()(),n.TgZ(9,"div",7)(10,"div",8)(11,"input",9),n.NdJ("ngModelChange",function(p){return d.searchText=p})("keyup.enter",function(){return d.codeSearch()}),n.qZA(),n.TgZ(12,"div",10)(13,"button",11),n.NdJ("click",function(){return d.clear()}),n._UZ(14,"i",12),n.qZA(),n.TgZ(15,"button",13),n._UZ(16,"i",14),n.qZA(),n.TgZ(17,"div",15)(18,"input",16),n.NdJ("ngModelChange",function(p){return d.isCaseSensitive=p}),n.qZA(),n.TgZ(19,"label",17),n._uU(20,"Case Sensitive"),n.qZA()()()()(),n.TgZ(21,"div",18)(22,"div",19)(23,"div",20),n._UZ(24,"div",21),n.YNc(25,U,1,0,"p-progressSpinner",22),n.qZA()()()()),2&h&&(n.xp6(5),n.Q6J("ngIf",d.searchArrays.length),n.xp6(6),n.Q6J("ngModel",d.searchText),n.xp6(7),n.Q6J("ngModel",d.isCaseSensitive),n.xp6(7),n.Q6J("ngIf",d.loading.grid))},dependencies:[j.Fj,j.Wl,j.JJ,j.On,e.O5,b.G,S.u],encapsulation:2,changeDetection:0})}return A})()},3300:(R,I,a)=>{a.d(I,{k:()=>j});var c=a(1162),_=a(4946),u=a(7240),n=a(6814),g=a(7566),E=a(365);const r=["codeFinderResult"],y=function(e,b){return{"col-4":e,"d-none":b}},P=function(e,b){return{"col-8":e,"col-12":b}};let j=(()=>{class e{cd;generalS;modalId="idDefaultCodeFinderId";loading={grid:!1};subscriptions=[];gridKey=c.iH._id;codeFinderResult;constructor(S,T){this.cd=S,this.generalS=T}ngOnInit(){setTimeout(()=>{this.codeFinderResult.layout=this},1e3)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(T){return new(T||e)(_.Y36(_.sBO),_.Y36(u.b))};static \u0275cmp=_.Xpm({type:e,selectors:[["app-code-finder-w"]],viewQuery:function(T,U){if(1&T&&_.Gf(r,5),2&T){let f;_.iGM(f=_.CRH())&&(U.codeFinderResult=f.first)}},inputs:{modalId:"modalId"},decls:7,vars:9,consts:[[1,"pt-1","pl-1","pr-1"],[1,"row","m-0","overflow-hidden","code-finder-height"],[1,"p-0","h-100",3,"ngClass"],[1,"w-100"],[1,"w-100",3,"modalId"],["codeFinderResult",""]],template:function(T,U){if(1&T&&(_.TgZ(0,"div",0)(1,"div",1)(2,"div",2),_._UZ(3,"app-code-finder-search",3),_.qZA(),_.TgZ(4,"div",2),_._UZ(5,"app-code-finder-result",4,5),_.qZA()()()),2&T){const f=_.MAs(6);_.xp6(2),_.Q6J("ngClass",_.WLB(3,y,!f.isResponseCollapsed,f.isResponseCollapsed)),_.xp6(2),_.Q6J("ngClass",_.WLB(6,P,!f.isResponseCollapsed,f.isResponseCollapsed)),_.xp6(1),_.Q6J("modalId",U.modalId)}},dependencies:[n.mk,g.Q,E.n],encapsulation:2,changeDetection:0})}return e})()},7470:(R,I,a)=>{a.r(I),a.d(I,{CodeFinderM:()=>b});var c=a(7664),_=a(8176),u=a(3726),n=a(3300),y=(a(2883),a(7566),a(365),a(4950)),P=a(4946);const j=[{path:"finder",component:n.k,canActivate:[u.P]}];let b=(()=>{class S{static \u0275fac=function(f){return new(f||S)};static \u0275mod=P.oAB({type:S});static \u0275inj=P.cJS({imports:[c.Bz.forChild(j),_.u,y.A]})}return S})()}}]);
package/dist/7975.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7975],{6522:(v,E,o)=>{o.d(E,{i:()=>oe});var f=o(5861),s=o(95),m=o(3157),l=o(328),D=o(9361),M=o(1162),p=o(553),T=o(5085),C=o(1601),u=o(3531),O=o(9989),e=o(4946),I=o(9961),h=o(7240),P=o(7414),S=o(602),A=o(5852),Z=o(2304),U=o(3429),x=o(2915),F=o(3835),y=o(6814),R=o(2660),B=o(5860),L=o(756),K=o(7680),b=o(4844),W=o(3259),N=o(8057),J=o(5025);const Y=["insertCodeModalC"],V=["monacoEditorModalC"];function w(n,d){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Add Database Migration"),e.qZA())}function Q(n,d){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," View Database Migration"),e.qZA())}function k(n,d){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," Edit Database Migration"),e.qZA())}function G(n,d){1&n&&(e.TgZ(0,"span",42),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function H(n,d){1&n&&(e.TgZ(0,"span",42),e._uU(1,"You can change Label later."),e.qZA())}function j(n,d){if(1&n){const a=e.EpF();e.TgZ(0,"div")(1,"form",30)(2,"div",31)(3,"label",32),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",33)(6,"input",34),e.NdJ("keyup",function(){e.CHM(a);const t=e.oxw();return e.KtG(t.form.get("label").setValue(t.form.get("name").value))}),e.qZA(),e.YNc(7,G,2,0,"span",35),e.qZA()(),e.TgZ(8,"div",31)(9,"label",32),e._uU(10,"Label"),e.qZA(),e.TgZ(11,"div",33),e._UZ(12,"input",36),e.YNc(13,H,2,0,"span",35),e.qZA()(),e.TgZ(14,"div",31)(15,"label",32),e._uU(16,"Order"),e.qZA(),e.TgZ(17,"div",33),e._UZ(18,"input",37),e.qZA()(),e.TgZ(19,"div",31)(20,"label",32),e._uU(21,"Timeout in minutes"),e.qZA(),e.TgZ(22,"div",33),e._UZ(23,"input",38),e.qZA()(),e.TgZ(24,"div",31),e._UZ(25,"label",32),e.TgZ(26,"div",33),e._UZ(27,"i",39),e.TgZ(28,"label",40),e._UZ(29,"p-checkbox",41),e.qZA()()()()()}if(2&n){const a=e.oxw();e.xp6(1),e.Q6J("formGroup",a.form),e.xp6(6),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(6),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(16),e.Q6J("binary",!0)}}function X(n,d){if(1&n){const a=e.EpF();e.TgZ(0,"div",43)(1,"app-monaco-editor",44),e.NdJ("editorGenerated",function(t){e.CHM(a);const r=e.oxw();return e.KtG(r.editorGenerated(t))}),e.qZA()()}if(2&n){const a=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",a.editorOptionsDBMigration)}}function z(n,d){if(1&n){const a=e.EpF();e.TgZ(0,"a",45),e.NdJ("click",function(){e.CHM(a);const t=e.oxw();return e.KtG(t.viewError())}),e._uU(1,"View error"),e.qZA()}}function q(n,d){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function ee(n,d){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function ae(n,d){if(1&n){const a=e.EpF();e.TgZ(0,"button",46),e.NdJ("click",function(){e.CHM(a);const t=e.oxw();return e.KtG(t.save())}),e._UZ(1,"i",47),e.YNc(2,q,2,0,"span",4),e.YNc(3,ee,2,0,"span",4),e.qZA()}if(2&n){const a=e.oxw();e.Q6J("disabled",a.form.invalid),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function te(n,d){1&n&&e._UZ(0,"p-progressSpinner",48)}let oe=(()=>{class n{fb;ns;generalS;constantsS;dbMigrationS;authCS;monacoS;instanceS;eventCenterS;generalCS;userS;cd;data;loading={form:!1};EFormMode=l.D;form;subscriptions=[];formData;IEventData=m.F;id;BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;instances=[];editorDbM;editorOptionsDBMigration={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(a,i,t,r,g,c,_,ie,ne,re,se,de){this.fb=a,this.ns=i,this.generalS=t,this.constantsS=r,this.dbMigrationS=g,this.authCS=c,this.monacoS=_,this.instanceS=ie,this.eventCenterS=ne,this.generalCS=re,this.userS=se,this.cd=de}ngOnInit(){var a=this;return(0,f.Z)(function*(){a.createForm(),a.subscriptions.push(a.data.eventChannel.subscribe(function(){var i=(0,f.Z)(function*(t){if(t)if(a.form.enable(),t.action===m.F.OPEN_FORM_IN_EDIT_MODE)yield a.editViewLoadData(),a.form.get("name").disable(),a.cd.detectChanges();else if(t.action===m.F.OPEN_FORM_IN_VIEW_MODE)yield a.editViewLoadData(),a.form.disable(),a.cd.detectChanges();else if(t.action===m.F.OPEN_FORM_IN_ADD_MODE){a.form.reset(),a.form.patchValue(t.data||{});const r=yield a.instanceS.getDefaultContent(a.BE_HOST_PORT,T.R.MIGRATION_SCRIPT).toPromise();a.editorOptionsDBMigration={readOnly:!1},a.generalCS.setValueInEditor(a,"editorDbM",r.data),a.cd.detectChanges()}});return function(t){return i.apply(this,arguments)}}()))})()}editViewLoadData(){var a=this;return(0,f.Z)(function*(){const i=yield a.dbMigrationS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(i.data),a.form.get("isScriptExecutedCalculated").setValue(a.data.formData.isScriptExecutedCalculated),a.generalCS.setValueInEditor(a,"editorDbM",i.data?.dbMigrationScriptCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[s.kI.required]],order:[null,[s.kI.required]],label:[null,[s.kI.required]],dbMigrationTimeoutInMinutes:[null,[]],isScriptExecutedCalculated:[!1,[]],executedMigrationScripts:[!1,[]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idDbMigrationForm").modal("show")},100)}hideModal(){$("#idDbMigrationForm").modal("hide")}save(){var a=this;return(0,f.Z)(function*(){const i=a.form.getRawValue();let t;t=a.data.formData&&a.data.formData._id?(yield a.dbMigrationS.getById(a.data.formData._id).toPromise()).data:{};const r=Object.assign({},t,i);r.user=a.authCS.getUserId(),r.dbMigrationScriptCode=a.editorDbM.getValue();const g=(yield a.userS.getById(a.authCS.gUser._id).toPromise()).data,c={};c._id=g._id,c.executedMigrationScripts=g.executedMigrationScripts,c.executedMigrationScripts=c.executedMigrationScripts||{},c.executedMigrationScripts[r.name]=!!i.isScriptExecutedCalculated,yield a.userS.put(a.authCS.gUser._id,c,{select:M.iH._id}).toPromise();try{let _;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorDbM,a.monacoDecorations),a.data.mode===l.D.ADD?_=yield a.dbMigrationS.post(r).toPromise():a.data.mode===l.D.EDIT&&(_=yield a.dbMigrationS.put(r._id,r,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===l.D.ADD?a.constantsS.dbMigration.addSuccess:a.constantsS.dbMigration.editSuccess),a.data.eventChannel.emit({action:a.data.mode===l.D.ADD?m.F.SAVED:m.F.UPDATED,data:_}),a.eventCenterS.dbMigrationSavedAndUpdate.next(!0),a.loading.form=!1}catch(_){a.loading.form=!1,a.ns.showErrorFromResponse(_.error||_,"Unable to save database migration."),a.lastError=_.error,a.tab={axiosResponse:{data:_.error}},a.monacoS.highlightErrorInMonacoEditor(a.editorDbM,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}resetForm(){this.formData=void 0,this.editorDbM&&this.editorDbM.getValue()&&this.editorDbM.setValue(""),this.monacoS.clearEditorDecorations(this.editorDbM,this.monacoDecorations),this.eventCenterS.dbMigration.detectChangesForm.next(Math.random())}showInsertCodeModel(){this.generalCS.messageReceivedFor=D.H.All,this.insertCodeModalC.showModal(u.b.CodeFinderResultC)}editorGenerated(a){var i=this;return(0,f.Z)(function*(){i.editorDbM=a,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(a,t=>{i.form.valid&&i.save()}),i.monacoS.addInsertCodeKeyBinding(a,t=>{i.generalCS.messageReceivedFor=D.H.All,i.data.mode!==l.D.VIEW&&i.insertCodeModalC.showModal(u.b.DatabasesMigrationFormC)}),i.subscriptions.push(i.generalS.messageReceived.subscribe(t=>{t.type&&t.type===O.g.TEXT_COPIED&&t.componentName===u.b.DatabasesMigrationFormC&&(i.monacoS.insertAtCursor(a,t.selectedText),i.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),C.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.dbMigrationSavedAndUpdate.next(!1)}static \u0275fac=function(i){return new(i||n)(e.Y36(s.qu),e.Y36(I.W),e.Y36(h.b),e.Y36(P.L),e.Y36(S.j),e.Y36(A.D),e.Y36(Z.b),e.Y36(U.E),e.Y36(x.u),e.Y36(h.b),e.Y36(F.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-databases-migration-form"]],viewQuery:function(i,t){if(1&i&&(e.Gf(Y,5),e.Gf(V,5)),2&i){let r;e.iGM(r=e.CRH())&&(t.insertCodeModalC=r.first),e.iGM(r=e.CRH())&&(t.viewDockerfileModelC=r.first)}},inputs:{data:"data"},decls:32,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDbMigrationForm","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",3,"click"],["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/features/database-migration.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",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",3,"click"],[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,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[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,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm",3,"keyup"],["class","mt-1px small",4,"ngIf"],["formControlName","label","name","label","spellcheck","false","type","text","placeholder","Please provide label",1,"form-control","form-control-sm"],["formControlName","order","name","order","spellcheck","false","type","number","placeholder","Please provide order",1,"form-control","form-control-sm"],["formControlName","dbMigrationTimeoutInMinutes","name","dbMigrationTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm"],[1,"fas","fa-lock","fa-fw","align-middle","text-warning","d-inline-block","mr-1","mt-1"],[1,"align-middle","mb-0","mt-1","ml-2"],["formControlName","isScriptExecutedCalculated","label","Script Executed",3,"binary"],[1,"mt-1px","small"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[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(i,t){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,w,3,0,"span",4),e.YNc(5,Q,3,0,"span",4),e.YNc(6,k,3,0,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return t.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return t.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.YNc(18,j,30,4,"div",4),e.qZA(),e.TgZ(19,"p-tabPanel",15),e.YNc(20,X,2,2,"div",16),e.qZA()()(),e.TgZ(21,"div",17),e.YNc(22,z,2,0,"a",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return t.hideModal()}),e._UZ(24,"i",20),e._uU(25," Close"),e.qZA(),e.YNc(26,ae,4,3,"button",21),e.qZA(),e.YNc(27,te,1,0,"p-progressSpinner",22),e.qZA()()(),e._UZ(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&i&&(e.xp6(4),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.lastError),e.xp6(4),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysMigration")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[s._Y,s.Fj,s.wV,s.JJ,s.JL,s.sg,s.u,y.O5,R.y,B.P,L.O,K.G,b.xf,b.x4,W.u,N.XZ,J.A],encapsulation:2,changeDetection:0})}return n})()},7975:(v,E,o)=>{o.d(E,{d:()=>M});var f=o(8176),m=(o(6522),o(4950)),l=o(4946);let M=(()=>{class p{static \u0275fac=function(u){return new(u||p)};static \u0275mod=l.oAB({type:p});static \u0275inj=l.cJS({imports:[f.u,m.A]})}return p})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7975],{6522:(v,E,o)=>{o.d(E,{i:()=>oe});var f=o(5861),s=o(95),m=o(3157),l=o(328),D=o(9361),M=o(1162),p=o(553),T=o(5085),C=o(1601),u=o(3531),O=o(9989),e=o(4946),I=o(9961),b=o(7240),P=o(7414),S=o(602),A=o(5852),Z=o(2304),U=o(3429),x=o(2915),F=o(3835),y=o(6814),R=o(2660),B=o(5860),L=o(756),K=o(7680),h=o(4844),W=o(3259),N=o(8057),J=o(5025);const Y=["insertCodeModalC"],V=["monacoEditorModalC"];function w(n,d){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Add Database Migration"),e.qZA())}function Q(n,d){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," View Database Migration"),e.qZA())}function k(n,d){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," Edit Database Migration"),e.qZA())}function G(n,d){1&n&&(e.TgZ(0,"span",42),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function H(n,d){1&n&&(e.TgZ(0,"span",42),e._uU(1,"You can change Label later."),e.qZA())}function j(n,d){if(1&n){const a=e.EpF();e.TgZ(0,"div")(1,"form",30)(2,"div",31)(3,"label",32),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",33)(6,"input",34),e.NdJ("keyup",function(){e.CHM(a);const t=e.oxw();return e.KtG(t.form.get("label").setValue(t.form.get("name").value))}),e.qZA(),e.YNc(7,G,2,0,"span",35),e.qZA()(),e.TgZ(8,"div",31)(9,"label",32),e._uU(10,"Label"),e.qZA(),e.TgZ(11,"div",33),e._UZ(12,"input",36),e.YNc(13,H,2,0,"span",35),e.qZA()(),e.TgZ(14,"div",31)(15,"label",32),e._uU(16,"Order"),e.qZA(),e.TgZ(17,"div",33),e._UZ(18,"input",37),e.qZA()(),e.TgZ(19,"div",31)(20,"label",32),e._uU(21,"Timeout in minutes"),e.qZA(),e.TgZ(22,"div",33),e._UZ(23,"input",38),e.qZA()(),e.TgZ(24,"div",31),e._UZ(25,"label",32),e.TgZ(26,"div",33),e._UZ(27,"i",39),e.TgZ(28,"label",40),e._UZ(29,"p-checkbox",41),e.qZA()()()()()}if(2&n){const a=e.oxw();e.xp6(1),e.Q6J("formGroup",a.form),e.xp6(6),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(6),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(16),e.Q6J("binary",!0)}}function X(n,d){if(1&n){const a=e.EpF();e.TgZ(0,"div",43)(1,"app-monaco-editor",44),e.NdJ("editorGenerated",function(t){e.CHM(a);const r=e.oxw();return e.KtG(r.editorGenerated(t))}),e.qZA()()}if(2&n){const a=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",a.editorOptionsDBMigration)}}function z(n,d){if(1&n){const a=e.EpF();e.TgZ(0,"a",45),e.NdJ("click",function(){e.CHM(a);const t=e.oxw();return e.KtG(t.viewError())}),e._uU(1,"View error"),e.qZA()}}function q(n,d){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function ee(n,d){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function ae(n,d){if(1&n){const a=e.EpF();e.TgZ(0,"button",46),e.NdJ("click",function(){e.CHM(a);const t=e.oxw();return e.KtG(t.save())}),e._UZ(1,"i",47),e.YNc(2,q,2,0,"span",4),e.YNc(3,ee,2,0,"span",4),e.qZA()}if(2&n){const a=e.oxw();e.Q6J("disabled",a.form.invalid),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function te(n,d){1&n&&e._UZ(0,"p-progressSpinner",48)}let oe=(()=>{class n{fb;ns;generalS;constantsS;dbMigrationS;authCS;monacoS;instanceS;eventCenterS;generalCS;userS;cd;data;loading={form:!1};EFormMode=l.D;form;subscriptions=[];formData;IEventData=m.F;id;BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;instances=[];editorDbM;editorOptionsDBMigration={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(a,i,t,r,g,c,_,ie,ne,re,se,de){this.fb=a,this.ns=i,this.generalS=t,this.constantsS=r,this.dbMigrationS=g,this.authCS=c,this.monacoS=_,this.instanceS=ie,this.eventCenterS=ne,this.generalCS=re,this.userS=se,this.cd=de}ngOnInit(){var a=this;return(0,f.Z)(function*(){a.createForm(),a.subscriptions.push(a.data.eventChannel.subscribe(function(){var i=(0,f.Z)(function*(t){if(t)if(a.form.enable(),t.action===m.F.OPEN_FORM_IN_EDIT_MODE)yield a.editViewLoadData(),a.form.get("name").disable(),a.cd.detectChanges();else if(t.action===m.F.OPEN_FORM_IN_VIEW_MODE)yield a.editViewLoadData(),a.form.disable(),a.cd.detectChanges();else if(t.action===m.F.OPEN_FORM_IN_ADD_MODE){a.form.reset(),a.form.patchValue(t.data||{});const r=yield a.instanceS.getDefaultContent(a.BE_HOST_PORT,T.R.MIGRATION_SCRIPT).toPromise();a.editorOptionsDBMigration={readOnly:!1},a.generalCS.setValueInEditor(a,"editorDbM",r.data),a.cd.detectChanges()}});return function(t){return i.apply(this,arguments)}}()))})()}editViewLoadData(){var a=this;return(0,f.Z)(function*(){const i=yield a.dbMigrationS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(i.data),a.form.get("isScriptExecutedCalculated").setValue(a.data.formData.isScriptExecutedCalculated),a.generalCS.setValueInEditor(a,"editorDbM",i.data?.dbMigrationScriptCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[s.kI.required]],order:[null,[s.kI.required]],label:[null,[s.kI.required]],dbMigrationTimeoutInMinutes:[null,[]],isScriptExecutedCalculated:[!1,[]],executedMigrationScripts:[!1,[]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idDbMigrationForm").modal("show")},100)}hideModal(){$("#idDbMigrationForm").modal("hide")}save(){var a=this;return(0,f.Z)(function*(){const i=a.form.getRawValue();let t;t=a.data.formData&&a.data.formData._id?(yield a.dbMigrationS.getById(a.data.formData._id).toPromise()).data:{};const r=Object.assign({},t,i);r.user=a.authCS.getUserId(),r.dbMigrationScriptCode=a.editorDbM.getValue();const g=(yield a.userS.getById(a.authCS.gUser._id).toPromise()).data,c={};c._id=g._id,c.executedMigrationScripts=g.executedMigrationScripts,c.executedMigrationScripts=c.executedMigrationScripts||{},c.executedMigrationScripts[r.name]=!!i.isScriptExecutedCalculated,yield a.userS.put(a.authCS.gUser._id,c,{select:M.iH._id}).toPromise();try{let _;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorDbM,a.monacoDecorations),a.data.mode===l.D.ADD?_=yield a.dbMigrationS.post(r).toPromise():a.data.mode===l.D.EDIT&&(_=yield a.dbMigrationS.put(r._id,r,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===l.D.ADD?a.constantsS.dbMigration.addSuccess:a.constantsS.dbMigration.editSuccess),a.data.eventChannel.emit({action:a.data.mode===l.D.ADD?m.F.SAVED:m.F.UPDATED,data:_}),a.eventCenterS.dbMigrationSavedAndUpdate.next(!0),a.loading.form=!1}catch(_){a.loading.form=!1,a.ns.showErrorFromResponse(_.error||_,"Unable to save database migration."),a.lastError=_.error,a.tab=a.tab||{},a.tab.axiosResponse={data:_.error},a.monacoS.highlightErrorInMonacoEditor(a.editorDbM,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}resetForm(){this.formData=void 0,this.editorDbM&&this.editorDbM.getValue()&&this.editorDbM.setValue(""),this.monacoS.clearEditorDecorations(this.editorDbM,this.monacoDecorations),this.eventCenterS.dbMigration.detectChangesForm.next(Math.random())}showInsertCodeModel(){this.generalCS.messageReceivedFor=D.H.All,this.insertCodeModalC.showModal(u.b.CodeFinderResultC)}editorGenerated(a){var i=this;return(0,f.Z)(function*(){i.editorDbM=a,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(a,t=>{i.form.valid&&i.save()}),i.monacoS.addInsertCodeKeyBinding(a,t=>{i.generalCS.messageReceivedFor=D.H.All,i.data.mode!==l.D.VIEW&&i.insertCodeModalC.showModal(u.b.DatabasesMigrationFormC)}),i.subscriptions.push(i.generalS.messageReceived.subscribe(t=>{t.type&&t.type===O.g.TEXT_COPIED&&t.componentName===u.b.DatabasesMigrationFormC&&(i.monacoS.insertAtCursor(a,t.selectedText),i.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),C.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.dbMigrationSavedAndUpdate.next(!1)}static \u0275fac=function(i){return new(i||n)(e.Y36(s.qu),e.Y36(I.W),e.Y36(b.b),e.Y36(P.L),e.Y36(S.j),e.Y36(A.D),e.Y36(Z.b),e.Y36(U.E),e.Y36(x.u),e.Y36(b.b),e.Y36(F.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-databases-migration-form"]],viewQuery:function(i,t){if(1&i&&(e.Gf(Y,5),e.Gf(V,5)),2&i){let r;e.iGM(r=e.CRH())&&(t.insertCodeModalC=r.first),e.iGM(r=e.CRH())&&(t.viewDockerfileModelC=r.first)}},inputs:{data:"data"},decls:32,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDbMigrationForm","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",3,"click"],["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/features/database-migration.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",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",3,"click"],[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,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[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,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm",3,"keyup"],["class","mt-1px small",4,"ngIf"],["formControlName","label","name","label","spellcheck","false","type","text","placeholder","Please provide label",1,"form-control","form-control-sm"],["formControlName","order","name","order","spellcheck","false","type","number","placeholder","Please provide order",1,"form-control","form-control-sm"],["formControlName","dbMigrationTimeoutInMinutes","name","dbMigrationTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm"],[1,"fas","fa-lock","fa-fw","align-middle","text-warning","d-inline-block","mr-1","mt-1"],[1,"align-middle","mb-0","mt-1","ml-2"],["formControlName","isScriptExecutedCalculated","label","Script Executed",3,"binary"],[1,"mt-1px","small"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[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(i,t){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,w,3,0,"span",4),e.YNc(5,Q,3,0,"span",4),e.YNc(6,k,3,0,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return t.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return t.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.YNc(18,j,30,4,"div",4),e.qZA(),e.TgZ(19,"p-tabPanel",15),e.YNc(20,X,2,2,"div",16),e.qZA()()(),e.TgZ(21,"div",17),e.YNc(22,z,2,0,"a",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return t.hideModal()}),e._UZ(24,"i",20),e._uU(25," Close"),e.qZA(),e.YNc(26,ae,4,3,"button",21),e.qZA(),e.YNc(27,te,1,0,"p-progressSpinner",22),e.qZA()()(),e._UZ(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&i&&(e.xp6(4),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.lastError),e.xp6(4),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysMigration")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[s._Y,s.Fj,s.wV,s.JJ,s.JL,s.sg,s.u,y.O5,R.y,B.P,L.O,K.G,h.xf,h.x4,W.u,N.XZ,J.A],encapsulation:2,changeDetection:0})}return n})()},7975:(v,E,o)=>{o.d(E,{d:()=>M});var f=o(8176),m=(o(6522),o(4950)),l=o(4946);let M=(()=>{class p{static \u0275fac=function(u){return new(u||p)};static \u0275mod=l.oAB({type:p});static \u0275inj=l.cJS({imports:[f.u,m.A]})}return p})()}}]);
package/dist/7977.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7977],{7977:(b,r,s)=>{s.r(r),s.d(r,{DashSummaryM:()=>T});var e=s(7664),c=s(8176),h=s(3726),l=s(1678),m=s(5861),t=s(4946),v=s(9961),f=s(3429),g=s(7276),S=s(7031),u=s(5852),p=s(7414),C=s(2915),i=s(7240),y=s(9006);let D=(()=>{class a{ns;instanceS;adminDashboardsS;logProfileS;authCS;constantsS;eventCenterS;generalCS;cd;generalS;loading={grid:!1};subscriptions=[];constructor(o,n,d,x,P,A,M,O,U,B){this.ns=o,this.instanceS=n,this.adminDashboardsS=d,this.logProfileS=x,this.authCS=P,this.constantsS=A,this.eventCenterS=M,this.generalCS=O,this.cd=U,this.generalS=B}ngOnInit(){var o=this;return(0,m.Z)(function*(){o.generalS.setNewTitle("Server Nodes Dashboard")})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(n){return new(n||a)(t.Y36(v.W),t.Y36(f.E),t.Y36(g.i),t.Y36(S.T),t.Y36(u.D),t.Y36(p.L),t.Y36(C.u),t.Y36(i.b),t.Y36(t.sBO),t.Y36(i.b))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-dash-summary"]],decls:13,vars:0,consts:[[1,"pt-1","main-container",2,"overflow","inherit"],[1,"row","ml-0","mr-0","mb-3"],[1,"col-12","pl-1","pr-1"],[1,"card"],[1,"card-header"],[1,"fas","fa-info-circle","text-info","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/dashboard/node-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"card-body","p-0","h-100","overflow-hidden","pt-2"]],template:function(n,d){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span"),t._UZ(6,"i",5),t._uU(7," List of all connected nodes"),t.qZA(),t.TgZ(8,"div",6)(9,"a",7),t._UZ(10,"img",8),t.qZA()()(),t.TgZ(11,"div",9),t._UZ(12,"app-dash-root-nodes"),t.qZA()()()()())},dependencies:[y.G],styles:[".main-container[_ngcontent-%COMP%]{height:calc(100vh - 48px);overflow:auto}#chart[_ngcontent-%COMP%]{max-width:650px;margin:35px auto}"]})}return a})();var Y=s(9575);const Z=[{path:"",component:D,canActivate:[h.P]}];let T=(()=>{class a{static \u0275fac=function(n){return new(n||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[e.Bz.forChild(Z),c.u,l.DashboardM,Y.Q]})}return a})()}}]);