@sava-info-systems/api-maker-with-extensions 1.14.0 → 1.15.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/.nvmrc +1 -1
- package/dist/{5249.ff62ef792f1671c8.js → 5249.6a454babc2d144b3.js} +1 -1
- package/dist/7368.ac46846616e465a8.js +1 -0
- package/dist/7987.541a0b67fd21c1f8.js +1 -0
- package/dist/885.70ca8f701657a321.js +1 -0
- package/dist/{9575.168612b46aca7ce7.js → 9575.d8d77a5248e62530.js} +1 -1
- package/dist/assets/schema-types/InterfaceProps.ts +1 -0
- package/dist/assets/schema-types/types.ts +100 -15
- package/dist/index.html +1 -1
- package/dist/main.7af59190ebaf6c36.js +1 -0
- package/dist/{runtime.83de819192a264a1.js → runtime.bfd9b30f865686f0.js} +1 -1
- package/main.js +1 -1
- package/package.json +15 -14
- package/sandbox/assets/schema-types/types.js +1 -0
- package/sandbox/package.json +3 -3
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/types.ts +100 -15
- package/src/public/dist-db-masters/browser/index.html +1 -1
- package/src/public/dist-db-masters/browser/main-CEUXXN7K.js +139 -0
- package/src/tools/install_utils/SetEnvInFrontend.js +1 -0
- package/dist/7368.ce2ec22a1f33bc93.js +0 -1
- package/dist/7987.28e2ad3cf92b8a76.js +0 -1
- package/dist/885.1c974629c902805a.js +0 -1
- package/dist/main.949138f5212140d3.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
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(7359),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})()}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7987],{1137:(D,C,a)=>{a.d(C,{u:()=>ne});var m=a(5861),l=a(3157),d=a(328),p=a(6990),E=a(9361),u=a(1162),I=a(7672),g=a(553),M=a(5085),P=a(1601),f=a(3531),T=a(9989),e=a(4946),F=a(9961),S=a(7629),O=a(7240),A=a(3429),U=a(7414),R=a(5852),B=a(2304),b=a(2915),Z=a(6814),y=a(2660),x=a(8917),W=a(5860),L=a(756),K=a(7680),h=a(4844),N=a(3259),J=a(5025);const H=["QuillEditorC"],Q=["insertCodeModalC"],G=["monacoEditorModalC"];function V(s,_){if(1&s&&e._UZ(0,"span",31),2&s){const t=e.oxw();e.Q6J("innerHTML",t.userNoteHtml,e.oJD)}}function Y(s,_){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",32),e._uU(2," Add Custom API"),e.qZA())}function w(s,_){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",33),e._uU(2," View Custom API"),e.qZA())}function j(s,_){if(1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",34),e._uU(2," Edit Custom API "),e.TgZ(3,"span",35),e._uU(4),e.qZA()()),2&s){const t=e.oxw();e.xp6(4),e.Oqu((null==t.updateObj?null:t.updateObj.name)||"")}}function k(s,_){if(1&s){const t=e.EpF();e.TgZ(0,"div",36)(1,"app-monaco-editor",37),e.NdJ("editorGenerated",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.editorGeneratedBasicInfo(o))}),e.qZA()()}if(2&s){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsSchema)}}function X(s,_){if(1&s){const t=e.EpF();e.TgZ(0,"div",36)(1,"app-monaco-editor",37),e.NdJ("editorGenerated",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.editorGenerated(o))}),e.qZA()()}if(2&s){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsSchema)}}function z(s,_){if(1&s){const t=e.EpF();e.TgZ(0,"a",38),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function q(s,_){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function ee(s,_){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function te(s,_){if(1&s){const t=e.EpF();e.TgZ(0,"button",39),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save())}),e._UZ(1,"i",40),e.YNc(2,q,2,0,"span",5),e.YNc(3,ee,2,0,"span",5),e.qZA()}if(2&s){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function oe(s,_){1&s&&e._UZ(0,"p-progressSpinner",41)}let ne=(()=>{class s{ns;functionS;generalS;instanceS;constantsS;authCS;monacoS;eventCenterS;generalCS;data;loading={form:!1};EFormMode=d.D;subscriptions=[];EAPIAccessType=I.di;editorFunctions;editorFunctionsBasicInfo;editorOptionsSchema={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};updateObj;QuillEditorC;userNoteHtml='\n <span class="font-weight-bold text-success">Note:</span><br/>\n <span>Name might be used in code,<br/> so consider changing in code also.</span>\n ';BE_HOST_PORT=g.N.BE_HOST_PORT;DOCS_HOST_PORT=g.N.DOCS_HOST_PORT;shouldLoadMonacoEditor=!1;insertCodeModalC;viewDockerfileModelC;constructor(t,n,o,i,r,c,ae,se,ie){this.ns=t,this.functionS=n,this.generalS=o,this.instanceS=i,this.constantsS=r,this.authCS=c,this.monacoS=ae,this.eventCenterS=se,this.generalCS=ie}ngOnInit(){var t=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var n=(0,m.Z)(function*(o){if(o)if(o.action===l.F.OPEN_FORM_IN_EDIT_MODE||o.action===l.F.OPEN_FORM_IN_VIEW_MODE){const i=yield t.functionS.getById(t.data.formData._id).toPromise();t.updateObj=i.data,t.generalCS.setValueInEditor(t,"editorFunctionsBasicInfo",i.data?.functionBasicInfo||""),t.generalCS.setValueInEditor(t,"editorFunctions",i.data?.functionCode||""),t.generalCS.setValueInEditor(t,"QuillEditorC",i.data?.apiDocs||"")}else if(o.action===l.F.OPEN_FORM_IN_ADD_MODE){const i=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,M.R.CUSTOM_API_JSON).toPromise(),r=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,M.R.CUSTOM_APIS).toPromise();t.generalCS.setValueInEditor(t,"editorFunctionsBasicInfo",i.data),t.generalCS.setValueInEditor(t,"editorFunctions",r.data),setTimeout(()=>{t.QuillEditorC.quill.setContents([{insert:"### API "},{insert:"Documentation",attributes:{bold:!0}},{insert:"\n"}])},1e3),t.updateObj={}}});return function(o){return n.apply(this,arguments)}}()))}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idFunctionForm").modal("show")},100)}hideModal(){$("#idFunctionForm").modal("hide")}save(){var t=this;return(0,m.Z)(function*(){let o;o=t.data.formData&&t.data.formData._id?(yield t.functionS.getById(t.data.formData._id).toPromise()).data:{};const i=p.find(o.versions||[],{isActive:!0});i&&(i.apiCodeStr=t.editorFunctions.getValue());let r=Object.assign({},o,{});r.user=t.authCS.getUserId(),r.functionCode=t.editorFunctions.getValue(),r.functionBasicInfo=t.editorFunctionsBasicInfo.getValue(),r.apiDocs=t.QuillEditorC.getValue();for(const c of r?.versions||[])c.version=c.version.toString();r=Object.assign({},t.updateObj||{},r);try{let c;t.loading.form=!0,t.lastError=void 0,t.data.mode===d.D.ADD?c=yield t.functionS.post(r).toPromise():t.data.mode===d.D.EDIT&&(c=yield t.functionS.replace(r._id,r,{select:u.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===d.D.ADD?t.constantsS.functions.addSuccess:t.constantsS.functions.editSuccess),t.data.eventChannel.emit({action:t.data.mode===d.D.ADD?l.F.SAVED:l.F.UPDATED}),t.eventCenterS.customApiSavedAndUpdate.next(!0),t.loading.form=!1}catch(c){t.ns.showErrorMessageFromErrorObject(c),t.loading.form=!1,t.lastError=c.error}})()}selectedTabTitle;tabSelected(t){this.selectedTabTitle=(t.originalEvent.originalTarget||t.originalEvent.currentTarget).text}setMessageReceiver(){this.generalCS.messageReceivedFor=void 0===this.selectedTabTitle||"Basic Info"===this.selectedTabTitle?E.H.Settings:E.H.All}showInsertCodeModel(){this.setMessageReceiver(),this.insertCodeModalC.showModal(f.b.FunManFormC)}editorGenerated(t){var n=this;return(0,m.Z)(function*(){n.editorFunctions=t,yield n.monacoS.loadSchemaEditorSettings(n.BE_HOST_PORT,n.authCS.getUserId(),null),n.monacoS.addSaveCodeKeyBinding(t,o=>{n.data.mode!==d.D.VIEW&&n.save()}),n.monacoS.addInsertCodeKeyBinding(t,o=>{n.data.mode!==d.D.VIEW&&(n.setMessageReceiver(),n.insertCodeModalC.showModal(f.b.FunManFormC))}),n.subscriptions.push(n.generalS.messageReceived.subscribe(o=>{o.type&&o.type===T.g.TEXT_COPIED&&"Code"===n.selectedTabTitle&&o.componentName===f.b.FunManFormC&&(n.monacoS.insertAtCursor(t,o.selectedText),n.insertCodeModalC.hideModal())}))})()}editorGeneratedBasicInfo(t){var n=this;return(0,m.Z)(function*(){n.editorFunctionsBasicInfo=t,yield n.monacoS.loadSchemaEditorSettings(n.BE_HOST_PORT,n.authCS.getUserId(),null),n.monacoS.addSaveCodeKeyBinding(t,o=>{n.data.mode!==d.D.VIEW&&n.save()}),n.monacoS.addInsertCodeKeyBinding(t,o=>{n.data.mode!==d.D.VIEW&&(n.setMessageReceiver(),n.insertCodeModalC.showModal(f.b.FunManFormC))}),n.subscriptions.push(n.generalS.messageReceived.subscribe(o=>{o.type&&o.type===T.g.TEXT_COPIED&&o.componentName===f.b.FunManFormC&&(void 0===n.selectedTabTitle||"Basic Info"===n.selectedTabTitle)&&(n.monacoS.insertAtCursor(t,o.selectedText),n.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),P.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.customApiSavedAndUpdate.next(!1)}static \u0275fac=function(n){return new(n||s)(e.Y36(F.W),e.Y36(S.d),e.Y36(O.b),e.Y36(A.E),e.Y36(U.L),e.Y36(R.D),e.Y36(B.b),e.Y36(b.u),e.Y36(O.b))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-fun-man-form"]],viewQuery:function(n,o){if(1&n&&(e.Gf(H,5),e.Gf(Q,5),e.Gf(G,5)),2&n){let i;e.iGM(i=e.CRH())&&(o.QuillEditorC=i.first),e.iGM(i=e.CRH())&&(o.insertCodeModalC=i.first),e.iGM(i=e.CRH())&&(o.viewDockerfileModelC=i.first)}},inputs:{data:"data"},decls:37,vars:14,consts:[["template",""],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idFunctionForm","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/apis-all/custom-apis/user-created-custom-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[3,"onChange"],["header","Basic Info"],["class","overflow-hidden","style","height: calc(100vh - 188px);",4,"ngIf"],["header","Code"],["header","Docs"],["QuillEditorC",""],[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,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"innerHTML"],[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,"overflow-hidden",2,"height","calc(100vh - 188px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(n,o){1&n&&(e.YNc(0,V,1,1,"ng-template",null,0,e.W1O),e.TgZ(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4),e.YNc(6,Y,3,0,"span",5),e.YNc(7,w,3,0,"span",5),e.YNc(8,j,5,1,"span",5),e.TgZ(9,"div",6)(10,"button",7),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(11,"span",8),e._UZ(12,"i",9),e.qZA()(),e.TgZ(13,"span",10),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(14,"i",11),e.qZA(),e.TgZ(15,"a",12),e._UZ(16,"img",13),e.qZA()()(),e.TgZ(17,"div",14)(18,"p-tabView",15),e.NdJ("onChange",function(r){return o.tabSelected(r)}),e.TgZ(19,"p-tabPanel",16),e.YNc(20,k,2,2,"div",17),e.qZA(),e.TgZ(21,"p-tabPanel",18),e.YNc(22,X,2,2,"div",17),e.qZA(),e.TgZ(23,"p-tabPanel",19),e._UZ(24,"app-quill-editor",null,20),e.qZA()()(),e.TgZ(26,"div",21),e.YNc(27,z,2,0,"a",22),e.TgZ(28,"button",23),e.NdJ("click",function(){return o.hideModal()}),e._UZ(29,"i",24),e._uU(30," Close"),e.qZA(),e.YNc(31,te,4,2,"button",25),e.qZA(),e.YNc(32,oe,1,0,"p-progressSpinner",26),e.qZA()()(),e._UZ(33,"app-insert-code-modal",27,28)(35,"app-monaco-editor-modal",29,30)),2&n&&(e.xp6(6),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(5),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeCusApi")("modalId","idInsertCodeCusApiForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInCustomApi")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[Z.O5,y.y,x.l,W.P,L.O,K.G,h.xf,h.x4,N.u,J.A],encapsulation:2})}return s})()},7987:(D,C,a)=>{a.d(C,{X:()=>E});var m=a(7359),l=a(4950),p=(a(1137),a(4946));let E=(()=>{class u{static \u0275fac=function(M){return new(M||u)};static \u0275mod=p.oAB({type:u});static \u0275inj=p.cJS({imports:[m.u,l.A]})}return u})()}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[885],{8487:(ee,Z,s)=>{s.d(Z,{L:()=>k});var g=s(5861),e=s(95),f=s(1162),u=s(328),m=s(3157),M=s(9490),t=s(4946),I=s(9961),S=s(1042),C=s(7240),A=s(7414),y=s(5852),F=s(2304),O=s(1429),L=s(5405),P=s(6814),w=s(2660),b=s(7680),W=s(3965),N=s(8057);function K(l,h){1&l&&(t.TgZ(0,"span"),t._UZ(1,"i",34),t._uU(2," Add Interval"),t.qZA())}function B(l,h){1&l&&(t.TgZ(0,"span"),t._UZ(1,"i",35),t._uU(2," View Interval"),t.qZA())}function J(l,h){1&l&&(t.TgZ(0,"span"),t._UZ(1,"i",36),t._uU(2," Edit Interval"),t.qZA())}function Y(l,h){1&l&&(t.TgZ(0,"div",39)(1,"a",40),t._uU(2,"Reference"),t.qZA()())}function V(l,h){if(1&l){const i=t.EpF();t.TgZ(0,"div",15)(1,"label",16),t._uU(2,"Custom"),t.qZA(),t.TgZ(3,"div",14)(4,"input",37),t.NdJ("blur",function(d){t.CHM(i);const D=t.oxw();return t.KtG(D.validateCronExpression(d))}),t.qZA(),t.YNc(5,Y,3,0,"div",38),t.qZA()()}if(2&l){const i=t.oxw();t.xp6(5),t.Q6J("ngIf",i.form.get("timeInterval").value===i.ESchedulerInterval.CUSTOM)}}function U(l,h){1&l&&(t.TgZ(0,"div",41)(1,"div",42)(2,"div",43)(3,"div",44),t._uU(4,"Custom CRON writing guide"),t.qZA(),t.TgZ(5,"div",45)(6,"table",46)(7,"tr")(8,"td",47),t._uU(9,"Seconds"),t.qZA(),t.TgZ(10,"td",48),t._uU(11," : "),t.qZA(),t.TgZ(12,"td",49),t._uU(13,"0-59"),t.qZA()(),t.TgZ(14,"tr")(15,"td",47),t._uU(16,"Minutes"),t.qZA(),t.TgZ(17,"td",48),t._uU(18," : "),t.qZA(),t.TgZ(19,"td",49),t._uU(20,"0-59"),t.qZA()(),t.TgZ(21,"tr")(22,"td",47),t._uU(23,"Hours"),t.qZA(),t.TgZ(24,"td",48),t._uU(25," : "),t.qZA(),t.TgZ(26,"td",49),t._uU(27,"0-23"),t.qZA()(),t.TgZ(28,"tr")(29,"td",47),t._uU(30,"Day of Month"),t.qZA(),t.TgZ(31,"td",48),t._uU(32," : "),t.qZA(),t.TgZ(33,"td",49),t._uU(34,"1-31"),t.qZA()(),t.TgZ(35,"tr")(36,"td",47),t._uU(37,"Months"),t.qZA(),t.TgZ(38,"td",48),t._uU(39," : "),t.qZA(),t.TgZ(40,"td",49),t._uU(41,"0-11 (Jan-Dec)"),t.qZA()(),t.TgZ(42,"tr")(43,"td",47),t._uU(44,"Day of Week"),t.qZA(),t.TgZ(45,"td",48),t._uU(46," : "),t.qZA(),t.TgZ(47,"td",49),t._uU(48,"0-6 (Sun-Sat)"),t.qZA()()()()(),t.TgZ(49,"div",50)(50,"span"),t._uU(51,"Note:- "),t.qZA(),t.TgZ(52,"span")(53,"a",40),t._uU(54,"Reference"),t.qZA(),t._uU(55," is having only 5 fields and this cron expression support 6 fields, precision upto seconds."),t.qZA()()()())}function Q(l,h){1&l&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function q(l,h){1&l&&(t.TgZ(0,"span"),t._uU(1,"Update interval"),t.qZA())}function G(l,h){if(1&l){const i=t.EpF();t.TgZ(0,"button",51),t.NdJ("click",function(){t.CHM(i);const d=t.oxw();return t.KtG(d.save())}),t._UZ(1,"i",52),t.YNc(2,Q,2,0,"span",4),t.YNc(3,q,2,0,"span",4),t.qZA()}if(2&l){const i=t.oxw();t.Q6J("disabled",i.form.invalid),t.xp6(2),t.Q6J("ngIf",i.data.mode===i.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",i.data.mode===i.EFormMode.EDIT)}}function x(l,h){1&l&&t._UZ(0,"p-progressSpinner",53)}let k=(()=>{class l{fb;ns;schedulerS;generalS;constantsS;authCS;monacoS;dataProviderS;eventCenterCS;data;loading={form:!1};EFormMode=u.D;form;ESchedulerInterval=M.M;subscriptions=[];intervalList=[];timezoneList=[];constructor(i,c,d,D,R,H,j,z,X){this.fb=i,this.ns=c,this.schedulerS=d,this.generalS=D,this.constantsS=R,this.authCS=H,this.monacoS=j,this.dataProviderS=z,this.eventCenterCS=X}ngOnInit(){var i=this;this.intervalList=this.dataProviderS.getSchedulerIntervals(),this.timezoneList=this.dataProviderS.getTimeZones(),this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var c=(0,g.Z)(function*(d){d&&(i.form.enable(),d.action===m.F.OPEN_FORM_IN_EDIT_MODE?(i.form.reset(),i.form.patchValue(i.data.formData)):d.action===m.F.OPEN_FORM_IN_VIEW_MODE?(i.form.patchValue(i.data.formData),i.form.reset(),i.form.disable()):d.action===m.F.OPEN_FORM_IN_ADD_MODE&&(i.form.reset(),i.form.get("active").setValue(!1)))});return function(d){return c.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({timeZone:[null,[e.kI.required]],timeInterval:[null,[e.kI.required]],customInterval:[null,[]],active:[null,[]]}),this.manageValidations()}showModal(){$("#idIntervals").modal("show"),this.form.get(f._h.active).setValue(!0)}hideModal(){$("#idIntervals").modal("hide")}manageValidations(){const i=this.form.get("timeInterval"),c=this.form.get("customInterval");i.valueChanges.subscribe(d=>{c.setValidators(d===M.M.CUSTOM?[e.kI.required]:[]),c.updateValueAndValidity()})}validateCronExpression(i){var c=this;return(0,g.Z)(function*(){const d=c.form.get("customInterval"),D=d.value;(yield c.schedulerS.isCronExpressionValid(D).toPromise()).data.valid||d.setValue("")})()}save(){var i=this;return(0,g.Z)(function*(){const c=i.form.value;try{if(i.data.mode===u.D.ADD)i.eventCenterCS.intervalArr.next(c);else if(i.data.mode===u.D.EDIT){const d=Object.assign(i.data.formData,c);i.eventCenterCS.intervalArr.next(d)}i.data.eventChannel.emit({action:i.data.mode===u.D.ADD?m.F.SAVED:m.F.UPDATED})}catch(d){console.log(d)}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(c){return new(c||l)(t.Y36(e.qu),t.Y36(I.W),t.Y36(S.Z),t.Y36(C.b),t.Y36(A.L),t.Y36(y.D),t.Y36(F.b),t.Y36(O.B),t.Y36(L.M))};static \u0275cmp=t.Xpm({type:l,selectors:[["app-intervals-add-edit"]],inputs:{data:"data"},decls:50,vars:13,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idIntervals","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html#interval-time","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-2","input-group","input-group-sm"],[1,"input-group-prepend"],["id","spanTimeInterval",1,"input-group-text","form-control","form-control-sm"],[1,"col-10","pl-0"],["formControlName","timeInterval","optionLabel","name","optionValue","id","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-4"],["class","row",4,"ngIf"],["formControlName","timeZone","optionLabel","name","optionValue","id","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-6","col-form-label","col-form-label-sm","text-right"],[1,"col-6","col-form-label","col-form-label-sm","align-middle","mb-0","pt-1"],["formControlName","active",3,"binary"],["class","form-group row mt-5",4,"ngIf"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","customInterval","name","customInterval","placeholder","Custom","spellcheck","false","type","text",1,"form-control","form-control-sm",3,"blur"],["class","text-center",4,"ngIf"],[1,"text-center"],["href","https://crontab.guru","target","_blank",1,"text-info",2,"text-decoration","underline"],[1,"form-group","row","mt-5"],[1,"col-12"],[1,"border"],[1,"h6","border-bottom","p-3","m-0","text-center"],[1,"p-3","font-monospaced"],[1,"table","table-sm","table-condensed","w-100","mb-0"],[1,"text-right","pr-1","border-0",2,"width","49%"],[1,"border-0",2,"width","10px"],[1,"border-0"],[1,"text-center","small","border-left","border-right","border-bottom","p-2"],["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(c,d){1&c&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,K,3,0,"span",4),t.YNc(5,B,3,0,"span",4),t.YNc(6,J,3,0,"span",4),t.TgZ(7,"div",5)(8,"button",6)(9,"span",7),t._UZ(10,"i",8),t.qZA()(),t.TgZ(11,"a",9),t._UZ(12,"img",10),t.qZA()()(),t.TgZ(13,"div",11)(14,"form",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"label",16),t._uU(19,"Time Interval"),t.qZA(),t.TgZ(20,"div",14)(21,"div",15)(22,"div",17)(23,"div",18)(24,"span",19),t._uU(25,"Every "),t.qZA()()(),t.TgZ(26,"div",20),t._UZ(27,"p-dropdown",21),t.qZA()()()()(),t.TgZ(28,"div",22),t.YNc(29,V,6,1,"div",23),t.qZA()(),t.TgZ(30,"div",13)(31,"div",14)(32,"div",15)(33,"label",16),t._uU(34,"Time Zone"),t.qZA(),t.TgZ(35,"div",14),t._UZ(36,"p-dropdown",24),t.qZA()()(),t.TgZ(37,"div",22)(38,"div",15)(39,"label",25),t._uU(40,"Active"),t.qZA(),t.TgZ(41,"label",26),t._UZ(42,"p-checkbox",27),t.qZA()()()(),t.YNc(43,U,56,0,"div",28),t.qZA()(),t.TgZ(44,"div",29)(45,"button",30),t._UZ(46,"i",31),t._uU(47," Close"),t.qZA(),t.YNc(48,G,4,3,"button",32),t.qZA(),t.YNc(49,x,1,0,"p-progressSpinner",33),t.qZA()()()),2&c&&(t.xp6(4),t.Q6J("ngIf",d.data.mode===d.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",d.data.mode===d.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",d.data.mode===d.EFormMode.EDIT),t.xp6(8),t.Q6J("formGroup",d.form),t.xp6(13),t.Q6J("options",d.intervalList)("filter",!0),t.xp6(2),t.Q6J("ngIf",d.form.get("timeInterval").value===d.ESchedulerInterval.CUSTOM),t.xp6(7),t.Q6J("options",d.timezoneList)("filter",!0),t.xp6(6),t.Q6J("binary",!0),t.xp6(1),t.Q6J("ngIf",d.form.get("timeInterval").value===d.ESchedulerInterval.CUSTOM),t.xp6(5),t.Q6J("ngIf",d.data.mode!==d.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",d.loading.form))},dependencies:[e._Y,e.Fj,e.JJ,e.JL,e.sg,e.u,P.O5,w.y,b.G,W.Lt,N.XZ],encapsulation:2})}return l})()},8479:(ee,Z,s)=>{s.d(Z,{o:()=>he});var g=s(5861),e=s(4946),f=s(95),u=s(3157),m=s(328),M=s(6990),I=s(9490),S=s(9361),C=s(1162),A=s(553),y=s(5085),F=s(1601),O=s(3531),L=s(9989),P=s(9961),w=s(1042),b=s(7240),W=s(7414),N=s(5852),K=s(2304),B=s(3429),J=s(5405),Y=s(2915),V=s(1429),U=s(6814),Q=s(2660),q=s(5860),G=s(756),x=s(5431),k=s(5219),l=s(7680),h=s(4844),i=s(3259),c=s(8057),d=s(5025),D=s(8487);const R=["intervalsAddEditC"],H=["insertCodeModalC"],j=["monacoEditorModalC"];function z(r,p){1&r&&(e.TgZ(0,"span"),e._UZ(1,"i",53),e._uU(2," Add Scheduler"),e.qZA())}function X(r,p){1&r&&(e.TgZ(0,"span"),e._UZ(1,"i",54),e._uU(2," View Scheduler"),e.qZA())}function te(r,p){if(1&r&&(e.TgZ(0,"span"),e._UZ(1,"i",55),e._uU(2," Edit Scheduler "),e.TgZ(3,"span",56),e._uU(4),e.qZA()()),2&r){const o=e.oxw();e.xp6(4),e.Oqu(o.form.get("name").value)}}function ae(r,p){1&r&&(e.TgZ(0,"span",57),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function oe(r,p){if(1&r&&(e.TgZ(0,"span",58),e._uU(1),e.qZA()),2&r){const o=e.oxw();e.xp6(1),e.hij("The system will allow ",o.form.get(o.ISchedulerProps.schedulerTimeoutInMinutes).value," minutes for the scheduler to complete its work.")}}function ne(r,p){if(1&r){const o=e.EpF();e.TgZ(0,"div",59)(1,"app-monaco-editor",60),e.NdJ("editorGenerated",function(n){e.CHM(o);const _=e.oxw();return e.KtG(_.editorGenerated(n))}),e.qZA()()}if(2&r){const o=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",o.editorOptionsSchedulers)}}function se(r,p){if(1&r){const o=e.EpF();e.TgZ(0,"span",61),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.add())}),e._UZ(1,"i",62),e.qZA()}}function re(r,p){1&r&&(e.TgZ(0,"tr"),e._UZ(1,"th",63),e.TgZ(2,"th"),e._uU(3,"Time Interval"),e.qZA(),e.TgZ(4,"th"),e._uU(5,"Time Zone"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Custom Interval"),e.qZA(),e.TgZ(8,"th",64),e._uU(9,"Action"),e.qZA()())}function ie(r,p){1&r&&e._UZ(0,"i",69)}function de(r,p){1&r&&e._UZ(0,"i",70)}function le(r,p){if(1&r){const o=e.EpF();e.TgZ(0,"div",71)(1,"button",72),e.NdJ("click",function(n){e.CHM(o);const _=e.oxw().$implicit,v=e.oxw();return e.KtG(v.edit(n,_))}),e._UZ(2,"i",73),e.qZA(),e.TgZ(3,"button",74),e.NdJ("click",function(n){e.CHM(o);const _=e.oxw().$implicit,v=e.oxw();return e.KtG(v.deleteInterval(n,_))}),e._UZ(4,"i",75),e.qZA()()}}function _e(r,p){if(1&r&&(e.TgZ(0,"tr",65)(1,"td"),e.YNc(2,ie,1,0,"i",66),e.YNc(3,de,1,0,"i",67),e.qZA(),e.TgZ(4,"td")(5,"span"),e._uU(6),e.qZA()(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td")(10,"span"),e._uU(11),e.qZA()(),e.TgZ(12,"td"),e.YNc(13,le,5,0,"div",68),e.qZA()()),2&r){const o=p.$implicit,a=e.oxw();e.Q6J("pSelectableRow",o),e.xp6(2),e.Q6J("ngIf",o.active),e.xp6(1),e.Q6J("ngIf",!o.active),e.xp6(3),e.hij("Every ",a.intervalListMap[o.timeInterval].name,""),e.xp6(2),e.Oqu(o.timeZone),e.xp6(3),e.Oqu(a.intervalListMap[o.timeInterval].name===a.ESchedulerInterval.CUSTOM?o.customInterval:""),e.xp6(2),e.Q6J("ngIf",!o.isReadOnly&&a.data.mode!==a.EFormMode.VIEW)}}function ce(r,p){if(1&r){const o=e.EpF();e.TgZ(0,"a",76),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.viewError())}),e._uU(1,"View error"),e.qZA()}}function me(r,p){1&r&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function ue(r,p){1&r&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function pe(r,p){if(1&r){const o=e.EpF();e.TgZ(0,"button",77),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.save(!0))}),e._UZ(1,"i",78),e.YNc(2,me,2,0,"span",4),e.YNc(3,ue,2,0,"span",4),e.qZA()}if(2&r){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 fe(r,p){1&r&&e._UZ(0,"p-progressSpinner",79)}const ve=function(r){return{"text-danger font-weight-bold":r}};let he=(()=>{class r{fb;ns;schedulerS;generalS;constantsS;authCS;monacoS;instanceS;notificationS;eventCenterCS;eventCenterS;dataProviderS;generalCS;data;loading={form:!1};EFormMode=m.D;form;subscriptions=[];ESchedulerInterval=I.M;editorSchedulers;editorOptionsSchedulers={readOnly:!1,language:"typescript",contextmenu:!0};intervalList=[];selectedRows=[];rows=[];rowsMap={};dataItem={mode:m.D.ADD,eventChannel:new e.vpe,formData:void 0};intervalListMap={};gridKey="id";idCounter=0;BE_HOST_PORT=A.N.BE_HOST_PORT;DOCS_HOST_PORT=A.N.DOCS_HOST_PORT;shouldLoadMonacoEditor=!1;lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};ISchedulerProps=C.qH;intervalsAddEditC;insertCodeModalC;viewDockerfileModelC;constructor(o,a,n,_,v,T,E,Ee,ge,Me,Ie,Ce,Te){this.fb=o,this.ns=a,this.schedulerS=n,this.generalS=_,this.constantsS=v,this.authCS=T,this.monacoS=E,this.instanceS=Ee,this.notificationS=ge,this.eventCenterCS=Me,this.eventCenterS=Ie,this.dataProviderS=Ce,this.generalCS=Te}ngOnInit(){var o=this;this.intervalList=this.dataProviderS.getSchedulerIntervals(),this.intervalListMap=M.keyBy(this.intervalList,C.GR.id),this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,g.Z)(function*(n){if(n)if(o.form.enable(),n.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield o.updateEditCommon();else if(n.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield o.updateEditCommon(),o.form.disable();else if(n.action===u.F.OPEN_FORM_IN_ADD_MODE){o.form.reset(),o.rows=[];const _=yield o.instanceS.getDefaultContent(o.BE_HOST_PORT,y.R.SCHEDULERS).toPromise();o.generalCS.setValueInEditor(o,"editorSchedulers",_.data),o.form.get(C.qH.isActive).setValue(!1),o.form.get(C.qH.runOnNativeProcess).setValue(!1)}});return function(n){return a.apply(this,arguments)}}())),this.subscriptions.push(this.dataItem.eventChannel.subscribe(function(){var a=(0,g.Z)(function*(n){n&&(o.form.enable(),(n.action===u.F.SAVED||n.action===u.F.UPDATED)&&(o.intervalsAddEditC.hideModal(),o.loadGridData()))});return function(n){return a.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterCS.intervalArr.subscribe(a=>{this.dataItem.mode===m.D.ADD&&(this.rows.unshift(a),this.loadGridData())}))}createForm(){this.form=this.fb.group({name:[null,[f.kI.required]],schedulerTimeoutInMinutes:[null,[f.kI.min(1),f.kI.max(43200)]],isActive:[null,[]],runOnNativeProcess:[null,[]]})}showInsertCodeModel(){this.generalCS.messageReceivedFor=S.H.All,this.insertCodeModalC.showModal(O.b.SchedulerManFormC)}updateEditCommon(){var o=this;return(0,g.Z)(function*(){const a=yield o.schedulerS.getById(o.data.formData._id).toPromise();o.form.reset(),o.form.patchValue(a.data),o.rows=a.data?.intervalArr||[],o.generalCS.setValueInEditor(o,"editorSchedulers",a.data?.schedulerCode||""),o.loadGridData()})()}loadGridData(){this.selectedRows=[];for(const o of this.rows)o.id=this.idCounter++;this.rowsMap=M.keyBy(this.rows,this.gridKey)}reqActiveIndex=0;tabIndexReq={Basic:0,Code:1,Intervals:2};save(o){var a=this;return(0,g.Z)(function*(){const n=a.form.getRawValue();let _;_=a.data.formData&&a.data.formData._id?(yield a.schedulerS.getById(a.data.formData._id).toPromise()).data:{};const v=M.find(_.versions||[],{isActive:!0});v&&(v.apiCodeStr=a.editorSchedulers.getValue());const T=Object.assign({},_,n);T.user=a.authCS.getUserId(),T.intervalArr=a.rows,T.schedulerCode=a.editorSchedulers.getValue();for(const E of T?.versions||[])E.version=E.version.toString();try{let E;a.loading.form=!0,a.lastError=void 0,a.data.mode===m.D.ADD?E=yield a.schedulerS.post(T).toPromise():a.data.mode===m.D.EDIT&&(E=yield a.schedulerS.put(a.data.formData._id,T,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===m.D.ADD?a.constantsS.schedulers.addSuccess:a.constantsS.schedulers.editSuccess),a.data.eventChannel.emit({action:a.data.mode===m.D.ADD?u.F.SAVED:u.F.UPDATED,closeModal:o}),a.form.get("name").disable(),a.eventCenterS.schedulerSavedAndUpdate.next(!0),a.loading.form=!1}catch(E){"Please Provide Interval."===E.error.errors[0].message&&(a.reqActiveIndex=a.tabIndexReq.Intervals),a.loading.form=!1,a.ns.showErrorFromResponse(E.error||E,"Unable to save scheduler."),a.lastError=E.error}})()}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idSchedulerForm").modal("show")},100)}hideModal(){$("#idSchedulerForm").modal("hide")}add(){this.dataItem.formData=void 0,this.dataItem.mode=m.D.ADD,this.dataItem.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE}),this.intervalsAddEditC.showModal()}view(){this.dataItem.formData=this.rowsMap[this.selectedRows[0]],this.dataItem.mode=m.D.VIEW,this.dataItem.eventChannel.emit({action:u.F.OPEN_FORM_IN_VIEW_MODE}),this.intervalsAddEditC.showModal()}edit(o,a){o.stopPropagation(),o.preventDefault(),this.dataItem.formData=a,this.dataItem.mode=m.D.EDIT,this.dataItem.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.intervalsAddEditC.showModal()}deleteInterval(o,a){o.stopPropagation(),o.preventDefault(),this.rows.splice(this.rows.indexOf(a),1),this.notificationS.showSuccess(this.constantsS.interval.removePermanent)}editorGenerated(o){var a=this;return(0,g.Z)(function*(){a.editorSchedulers=o,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(o,n=>{a.form.valid&&a.save(!0)}),a.monacoS.addInsertCodeKeyBinding(o,n=>{a.generalCS.messageReceivedFor=S.H.All,a.data.mode!==m.D.VIEW&&a.insertCodeModalC.showModal(O.b.SchedulerManFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(n=>{n.type&&n.type===L.g.TEXT_COPIED&&n.componentName===O.b.SchedulerManFormC&&(a.monacoS.insertAtCursor(o,n.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),F.d.json)}dblClickIntervalOpenModel(o){this.selectedRows.length&&this.data.mode!==m.D.VIEW&&this.edit(o,this.selectedRows[0])}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.schedulerSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||r)(e.Y36(f.qu),e.Y36(P.W),e.Y36(w.Z),e.Y36(b.b),e.Y36(W.L),e.Y36(N.D),e.Y36(K.b),e.Y36(B.E),e.Y36(P.W),e.Y36(J.M),e.Y36(Y.u),e.Y36(V.B),e.Y36(b.b))};static \u0275cmp=e.Xpm({type:r,selectors:[["app-w-scheduler-man-form"]],viewQuery:function(a,n){if(1&a&&(e.Gf(R,5),e.Gf(H,5),e.Gf(j,5)),2&a){let _;e.iGM(_=e.CRH())&&(n.intervalsAddEditC=_.first),e.iGM(_=e.CRH())&&(n.insertCodeModalC=_.first),e.iGM(_=e.CRH())&&(n.viewDockerfileModelC=_.first)}},inputs:{data:"data"},decls:70,vars:31,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSchedulerForm","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/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"w-100",3,"activeIndex","activeIndexChange"],["header","Basic Info"],[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","schedulerTimeoutInMinutes","name","schedulerTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm",3,"min"],["class","mt-1px small text-info",4,"ngIf"],[1,"align-middle","mb-0","pt-1"],["formControlName","isActive","label","Active",3,"binary"],["formControlName","runOnNativeProcess","pTooltip","Code will run on actual process and not in sandbox, so be careful with code. You can not use sandbox packages in this mode. You can use all Node.js packages + some packages on which API Maker is dependent on. You can use features of global variable 'g'.","label","Run Native",3,"ngClass","binary"],["header","Code"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],["header","Intervals"],[1,"overflow-auto",2,"height","calc(100vh - 206px)"],[1,"card","shadow-sm","h-100","mr-1","ml-1"],[1,"card-header"],[1,"fas","fa-stopwatch","text-warning","fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html#create-intervals-in-scheduler","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Add New",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","200px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],[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,"data"],["intervalsAddEditC",""],[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,"mt-1px","small"],[1,"mt-1px","small","text-info"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[2,"width","40px"],[2,"width","100px"],[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"],["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"],[1,"text-center"],["pTooltip","Edit",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Delete",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","text-danger","fa-fw","cursor-pointer"],["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,n){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,z,3,0,"span",4),e.YNc(5,X,3,0,"span",4),e.YNc(6,te,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return n.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return n.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",14),e.NdJ("activeIndexChange",function(v){return n.reqActiveIndex=v}),e.TgZ(17,"p-tabPanel",15)(18,"form",16)(19,"div",17)(20,"label",18),e._uU(21,"Name"),e.qZA(),e.TgZ(22,"div",19),e._UZ(23,"input",20),e.YNc(24,ae,2,0,"span",21),e.qZA()(),e.TgZ(25,"div",17)(26,"label",18),e._uU(27,"Timeout in minutes"),e.qZA(),e.TgZ(28,"div",19),e._UZ(29,"input",22),e.YNc(30,oe,2,1,"span",23),e.qZA()(),e.TgZ(31,"div",17),e._UZ(32,"label",18),e.TgZ(33,"div",19)(34,"label",24),e._UZ(35,"p-checkbox",25),e.qZA()()(),e.TgZ(36,"div",17),e._UZ(37,"label",18),e.TgZ(38,"div",19)(39,"label",24),e._UZ(40,"p-checkbox",26),e.qZA()()()()(),e.TgZ(41,"p-tabPanel",27),e.YNc(42,ne,2,2,"div",28),e.qZA(),e.TgZ(43,"p-tabPanel",29)(44,"div",30)(45,"div",31)(46,"div",32)(47,"span"),e._UZ(48,"i",33),e._uU(49," Interval"),e.qZA(),e.TgZ(50,"a",34),e._UZ(51,"img",35),e.qZA(),e.YNc(52,se,2,0,"span",36),e.qZA(),e.TgZ(53,"div",37)(54,"p-table",38),e.NdJ("selectionChange",function(v){return n.selectedRows=v})("dblclick",function(v){return n.dblClickIntervalOpenModel(v)}),e.YNc(55,re,10,0,"ng-template",39),e.YNc(56,_e,14,7,"ng-template",40),e.qZA()()()()()()(),e.TgZ(57,"div",41),e.YNc(58,ce,2,0,"a",42),e.TgZ(59,"button",43),e.NdJ("click",function(){return n.hideModal()}),e._UZ(60,"i",44),e._uU(61," Close"),e.qZA(),e.YNc(62,pe,4,3,"button",45),e.qZA(),e.YNc(63,fe,1,0,"p-progressSpinner",46),e.qZA()()(),e._UZ(64,"app-intervals-add-edit",47,48)(66,"app-insert-code-modal",49,50)(68,"app-monaco-editor-modal",51,52)),2&a&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(10),e.Q6J("activeIndex",n.reqActiveIndex),e.xp6(2),e.Q6J("formGroup",n.form),e.xp6(6),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(5),e.Q6J("min",1),e.xp6(1),e.Q6J("ngIf",n.form.get(n.ISchedulerProps.schedulerTimeoutInMinutes).value),e.xp6(5),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngClass",e.VKq(29,ve,!0===n.form.get(n.ISchedulerProps.runOnNativeProcess).value))("binary",!0),e.xp6(2),e.Q6J("ngIf",n.shouldLoadMonacoEditor),e.xp6(10),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(4),e.Q6J("ngIf",n.lastError),e.xp6(4),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form),e.xp6(1),e.Q6J("data",n.dataItem),e.xp6(2),e.Q6J("frameId","idInsertCodeSchedulers")("modalId","idInsertCodeSchedulersForm")("docsHostPort",n.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInScheduler")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[f._Y,f.Fj,f.wV,f.JJ,f.JL,f.qQ,f.sg,f.u,U.mk,U.O5,Q.y,q.P,G.O,x.iA,k.jx,x.Ei,l.G,h.xf,h.x4,i.u,c.XZ,d.A,D.L],encapsulation:2})}return r})()},885:(ee,Z,s)=>{s.d(Z,{R:()=>t});var g=s(7359),u=(s(8479),s(8487),s(4950)),m=s(4946);let t=(()=>{class I{static \u0275fac=function(A){return new(A||I)};static \u0275mod=m.oAB({type:I});static \u0275inj=m.cJS({imports:[g.u,u.A]})}return I})()}}]);
|