@sava-info-systems/api-maker-with-extensions 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/4575.584a2fd6d6505e7a.js +1 -0
- package/dist/6393.bff610fd50c307e8.js +1 -0
- package/dist/7368.102769b19d40d3e0.js +1 -0
- package/dist/assets/schema-types/types.ts +9 -0
- package/dist/index.html +1 -1
- package/dist/main.40b9c805b1ee0fc1.js +1 -0
- package/dist/{runtime.553fe0e243e03c0a.js → runtime.94df8f20f115da3f.js} +1 -1
- package/main.js +1 -1
- package/package.json +8 -4
- package/sandbox.js +1 -1
- package/src/assets/schema-types/types.ts +9 -0
- package/src/tools/.github/copilot-instructions.md +4 -4
- package/src/tools/local-client.js +1 -1
- package/dist/4575.a69d55da7b6dc4de.js +0 -1
- package/dist/6393.958d3e53cb6f8226.js +0 -1
- package/dist/7368.fa9ed2cea7c284b8.js +0 -1
- package/dist/main.d876eb0d409c6ceb.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4575],{24575:(B,m,i)=>{i.r(m),i.d(m,{DeploymentSettingsM:()=>G});var h=i(77664),Z=i(17017),T=i(81490),c=i(15861),l=i(60095),s=i(20553),t=i(94946),U=i(62304),f=i(95852),_=i(19394),C=i(46178),y=i(69862);let R=(()=>{class o extends C.g{http;authCS;constructor(e,a){super(e,_.k4.ROOT_USER_SETTINGS),this.http=e,this.authCS=a}saveRootUserSettings(e){return this.http.put(s.N.BE_HOST_PORT_SITES+`${this.modelPath}/set-root-user-settings`,e).toPromise()}getRootUserSettings(){return this.http.get(s.N.BE_HOST_PORT_SITES+`${this.modelPath}/get-root-user-settings`)}verifyRootUserSettings(e){return this.http.post(s.N.BE_HOST_PORT_SITES+`${this.modelPath}/verify-root-user-settings`,e).toPromise()}static \u0275fac=function(a){return new(a||o)(t.LFG(y.eN),t.LFG(f.D))};static \u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var b=i(77240),x=i(53429),v=i(99961),A=i(96814),D=i(32660),J=i(756),L=i(33259),O=i(96218),I=i(54323);function N(o,p){1&o&&t._UZ(0,"i",59)}function q(o,p){if(1&o&&t._UZ(0,"i",60),2&o){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.logDatabaseConnectionMessage)}}function E(o,p){1&o&&t._UZ(0,"i",59)}function k(o,p){if(1&o&&t._UZ(0,"i",60),2&o){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.externalRedisSettingsJsonMessage)}}function w(o,p){1&o&&t._UZ(0,"i",59)}function P(o,p){if(1&o&&t._UZ(0,"i",60),2&o){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.d2DiagramLibPathMessage)}}function M(o,p){if(1&o&&(t.TgZ(0,"span",61),t._uU(1),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.Oqu(e.validationResp.d2DiagramLibVersion)}}function V(o,p){if(1&o&&(t._UZ(0,"div",62),t.ALo(1,"safeHtml")),2&o){const e=t.oxw();t.Q6J("innerHTML",t.lcZ(1,1,e.d2InstallError),t.oJD)}}function W(o,p){if(1&o){const e=t.EpF();t.TgZ(0,"a",63),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.installAndDetectD2Lib())}),t._UZ(1,"i",64),t._uU(2," Auto Install "),t.qZA()}}const Y=[{path:"",component:(()=>{class o{fb;monacoS;authCS;rootUserSettings;generalS;instanceS;ns;cd;notificationS;form;formData;loading={form:!1};BE_HOST_PORT=s.N.BE_HOST_PORT;sampleConnectionString="mongodb://username:password@127.0.0.1:27017/databaseName?authSource=admin&replicaSet=rs0&directConnection=true";sampleJson='{\n "nodes": [\n {\n "port": 6390,\n "host": "127.0.0.1",\n "pass": ""\n }\n ],\n "otherRedisClusterOptions": null,\n "redisValueExpireInSeconds": 7200,\n "maxCharsResToCache": 1000000\n}';editorRedisConnectionJSON;editorOptionsRedisConnectionJSON={readOnly:!1,language:"json",contextmenu:!0};editorStartupScript;editorOptionsStartupScript={readOnly:!1,language:"bash",contextmenu:!0};d2InstallError;validationResp;constructor(e,a,n,r,d,u,g,j,Q){this.fb=e,this.monacoS=a,this.authCS=n,this.rootUserSettings=r,this.generalS=d,this.instanceS=u,this.ns=g,this.cd=j,this.notificationS=Q}ngOnInit(){var e=this;return(0,c.Z)(function*(){e.createForm(),yield e.loadData()})()}createForm(){this.form=this.fb.group({logDatabaseConnectionString:["",[]],externalRedisSettingsJsonString:["",[]],serverStartupScript:["",[]],universalLoginCaptcha:["",[]],logRemoveSchedulerInterval:["0 0 0 * * *",[]],passJWTOfAPIUsers:["",[]],jwtTokenExpiresInSeconds:[259200,[l.kI.min(60),l.kI.max(10368e4)]],maxLogsCount:[1e4,[]],d2DiagramLibPath:[1e4,[]]})}loadData(){var e=this;return(0,c.Z)(function*(){try{e.loading.form=!0;const a=(yield e.rootUserSettings.getRootUserSettings().toPromise()).data;if(e.form.reset(),e.form.patchValue(a),a?.logDatabaseConnectionString){const n=e.generalS.getDecryptedString(a.logDatabaseConnectionString,s.N.crypto.passCommunication);e.form.get("logDatabaseConnectionString").setValue(n)}if(a?.passJWTOfAPIUsers){const n=e.generalS.getDecryptedString(a.passJWTOfAPIUsers,s.N.crypto.passCommunication);e.form.get("passJWTOfAPIUsers").setValue(n)}if(a?.externalRedisSettingsJsonString){const n=e.generalS.getDecryptedString(a.externalRedisSettingsJsonString,s.N.crypto.passCommunication);e.editorRedisConnectionJSON.setValue(n)}if(a?.serverStartupScript&&e.editorStartupScript.setValue(a.serverStartupScript),a?.universalLoginCaptcha){const n=e.generalS.getDecryptedString(a.universalLoginCaptcha,s.N.crypto.passCommunication);e.form.get("universalLoginCaptcha").setValue(n)}e.loading.form=!1}catch(a){e.loading.form=!1,e.ns.showErrorFromResponse(a.error||a,"Unable to load data.")}})()}update(){var e=this;return(0,c.Z)(function*(){try{e.loading.form=!0,e.formData=e.form.getRawValue(),e.form.get("logDatabaseConnectionString").value&&(e.formData.logDatabaseConnectionString=e.generalS.getEncryptedString(e.form.get("logDatabaseConnectionString").value,s.N.crypto.passCommunication)),e.form.get("passJWTOfAPIUsers").value&&(e.formData.passJWTOfAPIUsers=e.generalS.getEncryptedString(e.form.get("passJWTOfAPIUsers").value,s.N.crypto.passCommunication)),e.editorRedisConnectionJSON.getValue()&&(e.formData.externalRedisSettingsJsonString=e.generalS.getEncryptedString(e.editorRedisConnectionJSON.getValue(),s.N.crypto.passCommunication)),e.editorStartupScript.getValue()&&(e.formData.serverStartupScript=e.editorStartupScript.getValue()),e.form.get("universalLoginCaptcha").value&&(e.formData.universalLoginCaptcha=e.generalS.getEncryptedString(e.form.get("universalLoginCaptcha").value,s.N.crypto.passCommunication)),yield e.verifyRootUser(e.formData),!e.validationResp.logDatabaseConnectionMessage&&!e.validationResp.externalRedisSettingsJsonMessage&&(yield e.rootUserSettings.saveRootUserSettings(e.formData),e.loading.form=!1,e.ns.showSuccess("Settings verified and saved successfully.")),e.loading.form=!1}catch(a){e.loading.form=!1,e.ns.showErrorFromResponse(a.error||a,"Unable to update.")}})()}verifyRootUser(e){var a=this;return(0,c.Z)(function*(){const n=yield a.rootUserSettings.verifyRootUserSettings(e);a.validationResp=n.data,setTimeout(()=>{a.cd.detectChanges()},1e3)})()}copyToClipboard(e){var a=this;return(0,c.Z)(function*(){"json"===e?yield navigator.clipboard.writeText(a.sampleJson):yield navigator.clipboard.writeText(a.sampleConnectionString),a.notificationS.showSuccess("Copied to clipboard.")})()}editorGenerated(e){var a=this;return(0,c.Z)(function*(){a.loading.form=!0,a.editorRedisConnectionJSON=e,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(e,n=>{a.form.valid&&a.update()}),a.loading.form=!1})()}editorGeneratedStartupScript(e){var a=this;return(0,c.Z)(function*(){a.loading.form=!0,a.editorStartupScript=e,a.monacoS.addSaveCodeKeyBinding(e,n=>{a.form.valid&&a.update()}),a.loading.form=!1})()}installAndDetectD2Lib(){var e=this;return(0,c.Z)(function*(){e.loading.form=!0;try{const n=(yield e.instanceS.installAndDetectD2Lib()).data,r=n[0].d2InstallOutput?.data?.d2LibPath;if(r)e.form.patchValue({d2DiagramLibPath:r}),e.ns.showSuccess("D2 library installed successfully.");else{const d=n[0].d2InstallOutput?.errors?.[0]?.message;e.ns.showError(d),e.d2InstallError=d}}catch(a){e.ns.showErrorFromResponse(a.error||a,"Unable to install d2 diagram library.")}e.loading.form=!1,e.cd.detectChanges()})()}generateRandomValue(e){const a=this.generalS.getRandomStringWithCapitals(5),n=this.generalS.getRandomStringWithCapitals(5),r=this.generalS.getRandomStringWithCapitals(5),d=this.generalS.getRandomStringWithCapitals(5),u=this.generalS.getRandomStringWithCapitals(5),g=this.generalS.getRandomStringWithCapitals(5);this.form.get(e).setValue(`${a}_${n}_${r}_${d}_${u}_${g}`)}static \u0275fac=function(a){return new(a||o)(t.Y36(l.qu),t.Y36(U.b),t.Y36(f.D),t.Y36(R),t.Y36(b.b),t.Y36(x.E),t.Y36(v.W),t.Y36(t.sBO),t.Y36(v.W))};static \u0275cmp=t.Xpm({type:o,selectors:[["app-dep-set-layout"]],decls:196,vars:23,consts:[[1,"pt-1","pl-3","pr-3","full-body","overflow-auto"],[1,"text-right",2,"position","sticky","top","0","z-index","100","padding","6px 5px"],["sava-no-dbl-click","","type","button",1,"btn","btn-success","btn-sm",3,"click"],[1,"fas","fa-save","fa-fw","mr-1"],[3,"formGroup"],[1,"card","shadow-sm","mr-1","mb-3"],[1,"card-header"],[1,"fas","fa-database","text-info","fa-fw","mr-1"],[1,"card-body","p-3"],[1,"container"],[1,"row"],[1,"col-2","col-form-label","col-form-label-sm","text-right"],["class","fas fa-check-circle text-success ml-1",4,"ngIf"],["class","fas fa-times-circle text-danger ml-1",3,"pTooltip",4,"ngIf"],[1,"col-6"],["rows","3","formControlName","logDatabaseConnectionString","spellcheck","false","placeholder","mongodb://username:password@host:port/db","pInputTextarea","",1,"form-control","form-control-sm","font-monospaced",3,"autoResize"],[1,"text-danger","small"],[1,"col-4","pl-2"],[1,"border","rounded","p-2","h-100","d-flex","flex-column","justify-content-between",2,"background","rgba(255,255,255,.03)"],[1,"d-flex","justify-content-between","mb-1"],[1,"text-muted"],["pTooltip","Copy example",1,"fas","fa-copy","text-warning","fa-fw","cursor-pointer",3,"click"],[1,"font-monospaced","text-secondary",2,"word-break","break-all","line-height","1.5"],[1,"row","mt-3"],["formControlName","logRemoveSchedulerInterval","spellcheck","false","type","text","placeholder","0 0 0 * * *",1,"form-control","form-control-sm","font-monospaced"],[1,"col-4","pl-2","d-flex","align-items-center"],[1,"small","text-info"],[1,"col-3"],["formControlName","maxLogsCount","spellcheck","false","type","number","placeholder","10000",1,"form-control","form-control-sm","font-monospaced"],[1,"col-7","pl-2","d-flex","align-items-center"],[1,"fas","fa-bolt","text-warning","fa-fw","mr-1"],[2,"height","220px"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"border","rounded","p-2","h-100","d-flex","flex-column",2,"background","rgba(255,255,255,.03)"],[1,"d-flex","justify-content-between","mb-2"],[1,"mb-0","small","font-monospaced",2,"white-space","pre-wrap","line-height","1.6"],[1,"text-info"],[1,"text-warning"],[1,"text-success"],[1,"fas","fa-shield-alt","text-success","fa-fw","mr-1"],["formControlName","universalLoginCaptcha","spellcheck","false","type","text","placeholder","Captcha key",1,"form-control","form-control-sm","font-monospaced"],["maxlength","32","formControlName","passJWTOfAPIUsers","spellcheck","false","type","text",1,"form-control","form-control-sm","font-monospaced"],["href","javascript:",1,"small","text-info","d-block",3,"click"],[1,"fas","fa-random","fa-fw"],[1,"small","text-muted"],["formControlName","jwtTokenExpiresInSeconds","spellcheck","false","type","number",1,"form-control","form-control-sm","font-monospaced"],[1,"fas","fa-tools","text-light","fa-fw","mr-1"],["formControlName","d2DiagramLibPath","spellcheck","false","type","text","placeholder","/usr/local/bin/d2",1,"form-control","form-control-sm","font-monospaced"],["class","small text-success",4,"ngIf"],["class","text-danger small mt-1",3,"innerHTML",4,"ngIf"],["class","small text-info d-block mb-1","href","javascript:",3,"click",4,"ngIf"],["href","https://docs.apimaker.dev/v1/docs/blog/install-d2.html","target","_blank",1,"small","text-warning"],[1,"fas","fa-link","fa-fw"],[1,"card","shadow-sm","mr-1","mb-5"],[1,"fas","fa-terminal","text-secondary","fa-fw","mr-1"],[1,"border","rounded","p-2",2,"background","rgba(255,255,255,.03)"],[1,"text-muted","d-block","mb-2"],[1,"small","text-secondary","pl-3","mb-2"],[1,"mb-0","mt-1","small","font-monospaced","text-warning"],[1,"fas","fa-check-circle","text-success","ml-1"],[1,"fas","fa-times-circle","text-danger","ml-1",3,"pTooltip"],[1,"small","text-success"],[1,"text-danger","small","mt-1",3,"innerHTML"],["href","javascript:",1,"small","text-info","d-block","mb-1",3,"click"],[1,"fas","fa-cloud-download-alt","fa-fw"]],template:function(a,n){1&a&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return n.update()}),t._UZ(3,"i",3),t._uU(4," Save "),t.qZA()(),t.TgZ(5,"form",4)(6,"div",5)(7,"div",6)(8,"span"),t._UZ(9,"i",7),t._uU(10," Logging"),t.qZA()(),t.TgZ(11,"div",8)(12,"div",9)(13,"div",10)(14,"label",11),t._uU(15," Log DB Connection String "),t.YNc(16,N,1,0,"i",12),t.YNc(17,q,1,1,"i",13),t.qZA(),t.TgZ(18,"div",14),t._UZ(19,"textarea",15),t.TgZ(20,"div",16),t._uU(21),t.qZA()(),t.TgZ(22,"div",17)(23,"div",18)(24,"div",19)(25,"small",20),t._uU(26,"Example"),t.qZA(),t.TgZ(27,"i",21),t.NdJ("click",function(){return n.copyToClipboard()}),t.qZA()(),t.TgZ(28,"small",22),t._uU(29),t.qZA()()()(),t.TgZ(30,"div",23)(31,"label",11),t._uU(32,"Log Remove CRON"),t.qZA(),t.TgZ(33,"div",14),t._UZ(34,"input",24),t.TgZ(35,"div",16),t._uU(36),t.qZA()(),t.TgZ(37,"div",25)(38,"span",26),t._uU(39,"Clean logs daily. Ex: "),t.TgZ(40,"code"),t._uU(41,"0 0 0 * * *"),t.qZA()()()(),t.TgZ(42,"div",23)(43,"label",11),t._uU(44,"Max Logs Count"),t.qZA(),t.TgZ(45,"div",27),t._UZ(46,"input",28),t.qZA(),t.TgZ(47,"div",29)(48,"span",26),t._uU(49,"Keeps the most recent N log entries."),t.qZA()()()()()(),t.TgZ(50,"div",5)(51,"div",6)(52,"span"),t._UZ(53,"i",30),t._uU(54," Cache (Redis)"),t.qZA()(),t.TgZ(55,"div",8)(56,"div",9)(57,"div",10)(58,"label",11),t._uU(59," Redis Connection JSON "),t.YNc(60,E,1,0,"i",12),t.YNc(61,k,1,1,"i",13),t.qZA(),t.TgZ(62,"div",14)(63,"div",31)(64,"app-monaco-editor",32),t.NdJ("editorGenerated",function(d){return n.editorGenerated(d)}),t.qZA()(),t.TgZ(65,"div",16),t._uU(66),t.qZA()(),t.TgZ(67,"div",17)(68,"div",33)(69,"div",34)(70,"small",20),t._uU(71,"Example"),t.qZA(),t.TgZ(72,"i",21),t.NdJ("click",function(){return n.copyToClipboard("json")}),t.qZA()(),t.TgZ(73,"pre",35),t._uU(74),t.TgZ(75,"span",36),t._uU(76,'"nodes"'),t.qZA(),t._uU(77),t.TgZ(78,"span",36),t._uU(79,'"port"'),t.qZA(),t._uU(80,": "),t.TgZ(81,"span",37),t._uU(82,"6390"),t.qZA(),t._uU(83,",\n "),t.TgZ(84,"span",36),t._uU(85,'"host"'),t.qZA(),t._uU(86,": "),t.TgZ(87,"span",38),t._uU(88,'"127.0.0.1"'),t.qZA(),t._uU(89,",\n "),t.TgZ(90,"span",36),t._uU(91,'"pass"'),t.qZA(),t._uU(92,": "),t.TgZ(93,"span",38),t._uU(94,'""'),t.qZA(),t._uU(95),t.TgZ(96,"span",36),t._uU(97,'"otherRedisClusterOptions"'),t.qZA(),t._uU(98,": "),t.TgZ(99,"span",20),t._uU(100,"null"),t.qZA(),t._uU(101,",\n "),t.TgZ(102,"span",36),t._uU(103,'"redisValueExpireInSeconds"'),t.qZA(),t._uU(104,": "),t.TgZ(105,"span",37),t._uU(106,"7200"),t.qZA(),t._uU(107,",\n "),t.TgZ(108,"span",36),t._uU(109,'"maxCharsResToCache"'),t.qZA(),t._uU(110,": "),t.TgZ(111,"span",37),t._uU(112,"1000000"),t.qZA(),t._uU(113),t.qZA()()()()()()(),t.TgZ(114,"div",5)(115,"div",6)(116,"span"),t._UZ(117,"i",39),t._uU(118," Security"),t.qZA()(),t.TgZ(119,"div",8)(120,"div",9)(121,"div",10)(122,"label",11),t._uU(123,"Universal Login Captcha"),t.qZA(),t.TgZ(124,"div",14),t._UZ(125,"input",40),t.qZA()(),t.TgZ(126,"div",23)(127,"label",11),t._uU(128,"JWT Password"),t.qZA(),t.TgZ(129,"div",14),t._UZ(130,"input",41),t.qZA(),t.TgZ(131,"div",25)(132,"div")(133,"a",42),t.NdJ("click",function(){return n.generateRandomValue("passJWTOfAPIUsers")}),t._UZ(134,"i",43),t._uU(135," Generate "),t.qZA(),t.TgZ(136,"span",44),t._uU(137,"Used to sign JWT tokens. Changing this logs out all app users."),t.qZA()()()(),t.TgZ(138,"div",23)(139,"label",11),t._uU(140,"JWT Expires (seconds)"),t.qZA(),t.TgZ(141,"div",27),t._UZ(142,"input",45),t.qZA(),t.TgZ(143,"div",29)(144,"span",26),t._uU(145,"259200 = 3 days \xa0|\xa0 86400 = 1 day"),t.qZA()()()()()(),t.TgZ(146,"div",5)(147,"div",6)(148,"span"),t._UZ(149,"i",46),t._uU(150," Tools"),t.qZA()(),t.TgZ(151,"div",8)(152,"div",9)(153,"div",10)(154,"label",11),t._uU(155," D2 Diagram Library "),t.YNc(156,w,1,0,"i",12),t.YNc(157,P,1,1,"i",13),t.qZA(),t.TgZ(158,"div",14),t._UZ(159,"input",47),t.YNc(160,M,2,1,"span",48),t.YNc(161,V,2,3,"div",49),t.qZA(),t.TgZ(162,"div",25)(163,"div"),t.YNc(164,W,3,0,"a",50),t.TgZ(165,"a",51),t._UZ(166,"i",52),t._uU(167," Install Guide "),t.qZA()()()()()()(),t.TgZ(168,"div",53)(169,"div",6)(170,"span"),t._UZ(171,"i",54),t._uU(172," Scripts"),t.qZA()(),t.TgZ(173,"div",8)(174,"div",9)(175,"div",10)(176,"label",11),t._uU(177,"Server Startup Script"),t.qZA(),t.TgZ(178,"div",14)(179,"div",31)(180,"app-monaco-editor",32),t.NdJ("editorGenerated",function(d){return n.editorGeneratedStartupScript(d)}),t.qZA()()(),t.TgZ(181,"div",17)(182,"div",55)(183,"small",56),t._uU(184,"Notes"),t.qZA(),t.TgZ(185,"ul",57)(186,"li"),t._uU(187,"Direct bash script, runs once on process/worker start."),t.qZA(),t.TgZ(188,"li"),t._uU(189,"All environment variables are available."),t.qZA(),t.TgZ(190,"li"),t._uU(191,"Useful for installing NPM packages for native APIs."),t.qZA()(),t.TgZ(192,"small",20),t._uU(193,"Example:"),t.qZA(),t.TgZ(194,"pre",58),t._uU(195,"npm install is-even"),t.qZA()()()()()()()()()),2&a&&(t.xp6(5),t.Q6J("formGroup",n.form),t.xp6(11),t.Q6J("ngIf",n.validationResp&&(null==n.formData?null:n.formData.logDatabaseConnectionString)&&!(null!=n.validationResp&&n.validationResp.logDatabaseConnectionMessage)),t.xp6(1),t.Q6J("ngIf",null==n.validationResp?null:n.validationResp.logDatabaseConnectionMessage),t.xp6(2),t.Q6J("autoResize",!0),t.xp6(2),t.Oqu(null==n.validationResp?null:n.validationResp.logDatabaseConnectionMessage),t.xp6(8),t.Oqu(n.sampleConnectionString),t.xp6(7),t.Oqu(null==n.validationResp?null:n.validationResp.logRemoveSchedulerIntervalMessage),t.xp6(24),t.Q6J("ngIf",n.validationResp&&(null==n.formData?null:n.formData.externalRedisSettingsJsonString)&&!(null!=n.validationResp&&n.validationResp.externalRedisSettingsJsonMessage)),t.xp6(1),t.Q6J("ngIf",null==n.validationResp?null:n.validationResp.externalRedisSettingsJsonMessage),t.xp6(3),t.Q6J("isSchemaEditor",!1)("editorOptions",n.editorOptionsRedisConnectionJSON),t.xp6(2),t.Oqu(null==n.validationResp?null:n.validationResp.externalRedisSettingsJsonMessage),t.xp6(8),t.hij("","{","\n "),t.xp6(3),t.hij(": [","{","\n "),t.xp6(18),t.hij("\n ","}","],\n "),t.xp6(18),t.hij("\n","}",""),t.xp6(43),t.Q6J("ngIf",null==n.validationResp?null:n.validationResp.d2DiagramLibVersion),t.xp6(1),t.Q6J("ngIf",null==n.validationResp?null:n.validationResp.d2DiagramLibPathMessage),t.xp6(3),t.Q6J("ngIf",null==n.validationResp?null:n.validationResp.d2DiagramLibVersion),t.xp6(1),t.Q6J("ngIf",n.d2InstallError),t.xp6(3),t.Q6J("ngIf","Linux"===n.authCS.backendSettings.osType),t.xp6(16),t.Q6J("isSchemaEditor",!1)("editorOptions",n.editorOptionsStartupScript))},dependencies:[l._Y,l.Fj,l.wV,l.JJ,l.JL,l.nD,l.sg,l.u,A.O5,D.y,J.O,L.u,O.g,I.z],encapsulation:2})}return o})(),canActivate:[T.g]}];let G=(()=>{class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=t.oAB({type:o});static \u0275inj=t.cJS({imports:[h.Bz.forChild(Y),Z.u]})}return o})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6393],{66393:(ie,U,i)=>{i.r(U),i.d(U,{AdminUserM:()=>ae});var b=i(77664),E=i(17017),e=i(94946),m=i(15861),c=i(33157),p=i(90328),f=i(56212),x=i(6990),u=i(60921),h=i(51162),C=i(33835),A=i(77240),Z=i(99961),y=i(85219),M=i(92189),T=i(90204),P=i(32915),g=i(96814),_=i(95431),S=i(97680),N=i(33259),o=i(60095),D=i(20553),R=i(95852),O=i(32660),Y=i(45609);function J(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",22),e._uU(2," Add User"),e.qZA())}function Q(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," View User"),e.qZA())}function k(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," Edit User"),e.qZA())}function q(n,l){1&n&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",25),e.qZA()())}function V(n,l){1&n&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Active"),e.qZA(),e.TgZ(3,"div",26),e._UZ(4,"p-inputSwitch",27),e.qZA()())}function G(n,l){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function W(n,l){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function K(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.save())}),e._UZ(1,"i",29),e.YNc(2,G,2,0,"span",4),e.YNc(3,W,2,0,"span",4),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function H(n,l){1&n&&e._UZ(0,"p-progressSpinner",30)}let w=(()=>{class n{fb;ns;userS;generalS;constantsCS;authCS;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];constructor(t,s,a,r,d,v){this.fb=t,this.ns=s,this.userS=a,this.generalS=r,this.constantsCS=d,this.authCS=v}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,m.Z)(function*(a){if(a)if(t.form.enable(),a.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(a.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else a.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([o.kI.required,o.kI.minLength(4),o.kI.maxLength(40)]),t.form.get("password").updateValueAndValidity())});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[o.kI.required]],email:[null,[o.kI.required,o.kI.email]],apiPath:[null,[o.kI.required,o.kI.minLength(3),o.kI.maxLength(25),o.kI.pattern("[a-z0-9]*")]],password:[null,[]],active:[!0,[]]})}showModal(){$("#idAMUsersForm").modal("show")}hideModal(){$("#idAMUsersForm").modal("hide")}save(){var t=this;return(0,m.Z)(function*(){const s=t.form.getRawValue();s.user=t.authCS.getUserId(),s.userType=u.d.ADMIN;try{let a;t.loading.form=!0,t.data.mode===p.D.ADD?(s.password=t.generalS.getEncryptedString(s.password,D.N.crypto.passCommunication),a=yield t.userS.post(s).toPromise(),t.ns.showSuccess(t.constantsCS.user.addSuccess)):t.data.mode===p.D.EDIT&&(t.data.formData._id&&(s.userType=t.data.formData.userType,t.form.get("password").value?s.password=t.generalS.getEncryptedString(s.password,D.N.crypto.passCommunication):delete s.password),a=yield t.userS.put(t.data.formData._id,s,{select:h.iH._id}).toPromise(),t.ns.showSuccess(t.constantsCS.user.editSuccess)),t.data.eventChannel.emit({action:t.data.mode===p.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save user info.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.Y36(o.qu),e.Y36(Z.W),e.Y36(C.K),e.Y36(A.b),e.Y36(T.s),e.Y36(R.D))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-w-admin-user-form"]],inputs:{data:"data"},decls:35,vars:8,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idAMUsersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","email","name","email","spellcheck","false","type","text","placeholder","Please provide email",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],["formControlName","apiPath","name","apiPath","spellcheck","false","type","text","placeholder","Please provide api path",1,"form-control","text-lowercase","form-control-sm"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],[1,"col-6","d-flex","align-items-center"],["formControlName","active"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,J,3,0,"span",4),e.YNc(5,Q,3,0,"span",4),e.YNc(6,k,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Email"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,q,5,0,"div",15),e.TgZ(23,"div",10)(24,"label",11),e._uU(25,"API Path"),e.qZA(),e.TgZ(26,"div",12),e._UZ(27,"input",16),e.qZA()(),e.YNc(28,V,5,0,"div",15),e.qZA()(),e.TgZ(29,"div",17)(30,"button",18),e._UZ(31,"i",19),e._uU(32," Close"),e.qZA(),e.YNc(33,K,4,3,"button",20),e.qZA(),e.YNc(34,H,1,0,"p-progressSpinner",21),e.qZA()()()),2&s&&(e.xp6(4),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",a.form),e.xp6(11),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(6),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(5),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.loading.form))},dependencies:[o._Y,o.Fj,o.JJ,o.JL,o.sg,o.u,g.O5,O.y,S.G,Y.Ql],encapsulation:2})}return n})();const L=["adminUserFormC"];function B(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"span",14),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.edit())}),e._UZ(1,"i",15),e.qZA()}}function j(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"span",16),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.removePermanentDialog())}),e._UZ(1,"i",17),e.qZA()}}function X(n,l){1&n&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Email"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"API Path"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Active"),e.qZA()())}function z(n,l){if(1&n&&(e.TgZ(0,"tr",19)(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",20),e._UZ(8,"i",21),e.qZA()()),2&n){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.email),e.xp6(2),e.Oqu(t.apiPath),e.xp6(2),e.Q6J("ngClass",t.active?"fa-check-circle text-success":"fa-times-circle text-danger")("pTooltip",t.active?"Active":"Inactive")}}function ee(n,l){1&n&&e._UZ(0,"p-progressSpinner",22)}let F=(()=>{class n{userS;generalS;notificationS;confirmationService;navigationCS;constantsCS;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!0;selectedRows=[];gridKey=h.iH._id;adminUserFormC;constructor(t,s,a,r,d,v,ne){this.userS=t,this.generalS=s,this.notificationS=a,this.confirmationService=r,this.navigationCS=d,this.constantsCS=v,this.eventCenterS=ne}ngOnInit(){this.eventCenterS.user.selectedUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.adminUserFormC.hideModal(),this.loadGridData())}))}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{active:!0,userType:{$in:[u.d.ROOT,u.d.ADMIN]}},select:{name:1,email:1,apiPath:1,active:1,userType:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.userS.query(s).subscribe(function(){var a=(0,m.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=x.keyBy(t.rows,h.iH._id));const d=t.navigationCS.getQueryParam(f.p.user);t.rowsMap[d]&&(t.eventCenterS.user.selectedUsers.next([t.rowsMap[d]]),t.selectedRows=[t.rowsMap[d]],yield t.fillData()),t.loading.grid=!1});return function(r){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.adminUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=p.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.adminUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.adminUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,m.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsCS.user.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,m.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,m.Z)(function*(){t.loading.grid=!0;const s=yield t.userS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsCS.user.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsCS.user.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.user.selectedUsers.next([])}resetDependents(){var t=this;return(0,m.Z)(function*(){t.eventCenterS.user.selectedUsers.next([]),yield t.navigationCS.setQueryParam(f.p.user,null)})()}adminUserSelected(t){var s=this;return(0,m.Z)(function*(){s.selectedRows=t,s.resetDependents(),s.fillData()})()}fillData(){var t=this;return(0,m.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.user,""),void t.eventCenterS.user.selectedUsers.next([]);const s=(yield t.userS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?(yield t.navigationCS.setQueryParam(f.p.user,s._id),t.eventCenterS.user.selectedUsers.next([s])):t.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(C.K),e.Y36(A.b),e.Y36(Z.W),e.Y36(y.YP),e.Y36(M.S),e.Y36(T.s),e.Y36(P.u))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-w-admin-users"]],viewQuery:function(s,a){if(1&s&&e.Gf(L,5),2&s){let r;e.iGM(r=e.CRH())&&(a.adminUserFormC=r.first)}},decls:16,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-users","text-info","fa-fw","mr-1"],["pTooltip","Add New","tooltipPosition","left",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit","tooltipPosition","left",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Remove permananent","tooltipPosition","left",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 94px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["adminUserFormC",""],["pTooltip","Edit","tooltipPosition","left",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Remove permananent","tooltipPosition","left",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","70px","text-align","center"],[3,"pSelectableRow"],[2,"text-align","center"],[1,"fas","fa-fw",3,"ngClass","pTooltip"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Users"),e.qZA(),e.TgZ(5,"span",3),e.NdJ("click",function(){return a.add()}),e._UZ(6,"i",4),e.qZA(),e.YNc(7,B,2,0,"span",5),e.YNc(8,j,2,0,"span",6),e.qZA(),e.TgZ(9,"div",7)(10,"p-table",8),e.NdJ("selectionChange",function(d){return a.selectedRows=d})("dblclick",function(){return a.dblClickUsers()})("selectionChange",function(d){return a.adminUserSelected(d)}),e.YNc(11,X,9,0,"ng-template",9),e.YNc(12,z,9,6,"ng-template",10),e.qZA(),e.YNc(13,ee,1,0,"p-progressSpinner",11),e.qZA()(),e._UZ(14,"app-w-admin-user-form",12,13)),2&s&&(e.xp6(7),e.Q6J("ngIf",a.selectedRows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.xp6(3),e.Q6J("ngIf",a.loading.grid),e.xp6(1),e.Q6J("data",a.data))},dependencies:[g.mk,g.O5,_.iA,y.jx,_.Ei,S.G,N.u,w],encapsulation:2})}return n})();const se=[{path:"",component:(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=e.Xpm({type:n,selectors:[["app-admin-user-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"],[1,"w-100"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0),e._UZ(1,"app-w-admin-users",1),e.qZA())},dependencies:[F],encapsulation:2})}return n})(),canActivate:[i(81490).g]}];let ae=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[b.Bz.forChild(se),E.u]})}return n})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7368],{67368:(he,S,s)=>{s.r(S),s.d(S,{SandboxSettingsM:()=>fe});var O=s(77664),D=s(63726),y=s(17017),M=s(70292),r=s(15861),e=s(94946),u=s(6990),v=s(33157),c=s(90328),k=s(51162),x=s(20553),I=s(54371),h=s(95852),b=s(33835),w=s(25405),Z=s(99961),p=s(85219),T=s(27414),U=s(62304),N=s(24977),P=s(53429),E=s(81344),J=s(77240),g=s(60095),_=s(96814),R=s(38147),G=s(91861),q=s(756),f=s(95431),K=s(97680),C=s(14844),A=s(33259),Y=s(32660);function F(a,l){1&a&&(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(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"div",31)(1,"button",32),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw();return e.KtG(d.editAllowedOrigin(n,o))}),e._UZ(2,"i",33),e.qZA(),e.TgZ(3,"button",34),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw();return e.KtG(d.removeAllowedOrigin(n,o))}),e._UZ(4,"i",35),e.qZA()()}}function L(a,l){if(1&a&&(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&a){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(a,l){if(1&a){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 a{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,o,d,m){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=o,this.cs=d,this.confirmationService=m}ngOnInit(){}save(){var t=this;return(0,r.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=u.uniqBy(t.allowedOriginsGridData,"name"),t.saveSettings.emit(),t.hideAllowedOriginModal()})()}showAllowedOriginModal(){$("#idAllowedOriginModal").modal("show")}hideAllowedOriginModal(){$("#idAllowedOriginModal").modal("hide")}addAllowedOrigin(){var t=this;return(0,r.Z)(function*(){t.allowedOriginModel.domainNameBak=t.allowedOriginModel.domainName="",t.allowedOriginData.mode=c.D.ADD,t.showAllowedOriginModal()})()}editAllowedOrigin(t,i){var n=this;return(0,r.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,r.Z)(function*(){var o;n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentAllowedOriginConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,r.Z)(function*(){yield n.removeAO(t,i)}),function(){return o.apply(this,arguments)})})})()}removeAO(t,i){var n=this;return(0,r.Z)(function*(){const o=n.allowedOriginsGridData.findIndex(d=>d.name===i.name);n.allowedOriginsGridData.splice(o,1),n.saveSettings.emit()})()}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||a)(e.Y36(h.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:a,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(d){return n.selectedRowsUI=d})("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(d){return n.allowedOriginModel.domainName=d}),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,_.O5,Y.y,f.iA,p.jx,f.Ei,A.u],encapsulation:2})}return a})();const B=["addNpmLibC"],j=["allowedOriginC"],W=["SandboxSettingsPkgVersionsModalC"];function z(a,l){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",49)(2,"th",50),e.TgZ(3,"th",51),e._uU(4,"Version"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Name"),e.qZA(),e.TgZ(7,"th",52),e._uU(8,"Sub Dependencies"),e.qZA(),e.TgZ(9,"th",53),e._uU(10,"Third Party API"),e.qZA(),e.TgZ(11,"th",54),e._uU(12,"Default"),e.qZA(),e.TgZ(13,"th",55),e._uU(14,"Action"),e.qZA()())}function X(a,l){1&a&&e._UZ(0,"i",64)}function ee(a,l){1&a&&e._UZ(0,"i",65)}function te(a,l){if(1&a&&(e.TgZ(0,"div",67),e._uU(1),e.qZA()),2&a){const t=l.$implicit;e.xp6(1),e.AsE("",t.name," @",t.version,"")}}function ne(a,l){if(1&a&&(e.TgZ(0,"div"),e.YNc(1,te,2,2,"div",66),e.qZA()),2&a){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.dependencies)}}function ie(a,l){1&a&&e._UZ(0,"i",68)}function ae(a,l){1&a&&e._UZ(0,"i",68)}function oe(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"div",61)(1,"button",69),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.editData(n,o))}),e._UZ(2,"i",70),e.qZA(),e.TgZ(3,"button",71),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.removePermanentDialog(n,o))}),e._UZ(4,"i",72),e.qZA()()}}function se(a,l){if(1&a&&(e.TgZ(0,"tr",56)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,X,1,0,"i",57),e.YNc(5,ee,1,0,"i",58),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",59),e.YNc(12,ne,2,1,"div",60),e.qZA()(),e.TgZ(13,"td",61),e.YNc(14,ie,1,0,"i",62),e.qZA(),e.TgZ(15,"td",61),e.YNc(16,ae,1,0,"i",62),e.qZA(),e.TgZ(17,"td"),e.YNc(18,oe,5,0,"div",63),e.qZA()()),2&a){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(a,l){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",49),e.TgZ(2,"th",51),e._uU(3,"Version"),e.qZA(),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th",73),e._uU(7,"Third Party API"),e.qZA(),e.TgZ(8,"th",51),e._uU(9,"Default"),e.qZA()())}function de(a,l){1&a&&e._UZ(0,"i",68)}function re(a,l){1&a&&e._UZ(0,"i",68)}function ce(a,l){if(1&a&&(e.TgZ(0,"tr",56)(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,de,1,0,"i",62),e.qZA(),e.TgZ(9,"td"),e.YNc(10,re,1,0,"i",62),e.qZA()()),2&a){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(a,l){1&a&&e._UZ(0,"p-progressSpinner",74)}function me(a,l){if(1&a){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,"div",18)(19,"input",19),e.NdJ("ngModelChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.settings.sandbox.sandboxCountOverrideAdmin=n)}),e.qZA()(),e.TgZ(20,"div",20)(21,"span",21),e._uU(22,"1 CPU core \u2192 1 process \u2192 N sandboxes. Ideally 1\u20132."),e.qZA()()(),e.TgZ(23,"div",22)(24,"label",17),e._uU(25,"Auto Restart (seconds)"),e.qZA(),e.TgZ(26,"div",18)(27,"input",23),e.NdJ("ngModelChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.settings.sandbox.automaticSandboxRestartInSeconds=n)}),e.qZA()(),e.TgZ(28,"div",20)(29,"span",21),e._uU(30,"All sandboxes restart automatically after this interval across all servers, without dropping requests."),e.qZA()()()()()(),e.TgZ(31,"div",11)(32,"div",12)(33,"span"),e._UZ(34,"i",24),e._uU(35," Sandbox Dependencies"),e.qZA(),e.TgZ(36,"div",25)(37,"a",26),e._UZ(38,"img",27),e.qZA()(),e.TgZ(39,"span",28),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showLibraryModel())}),e._UZ(40,"i",29),e.qZA()(),e.TgZ(41,"div",30)(42,"p-tabView",31)(43,"p-tabPanel",32)(44,"p-table",33),e.NdJ("selectionChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.selectedRowsUI=n)})("dblclick",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.summaryTableDoubleClick())}),e.YNc(45,z,15,0,"ng-template",34),e.YNc(46,se,19,10,"ng-template",35),e.qZA()(),e.TgZ(47,"p-tabPanel",36)(48,"p-table",37),e.NdJ("selectionChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.selectedRowsPackageJson=n)}),e.YNc(49,le,10,0,"ng-template",34),e.YNc(50,ce,11,6,"ng-template",35),e.qZA()()(),e.YNc(51,ge,1,0,"p-progressSpinner",38),e.qZA()(),e.TgZ(52,"div",11)(53,"div",12)(54,"span"),e._UZ(55,"i",39),e._uU(56," Docker File"),e.qZA(),e.TgZ(57,"span",40),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.resetDockerfileToDefault())}),e._UZ(58,"i",41),e.qZA(),e.TgZ(59,"span",42),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showDockerImageBuildLogs())}),e._UZ(60,"i",43),e.qZA()(),e.TgZ(61,"div",44)(62,"app-monaco-editor",45),e.NdJ("editorGenerated",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.editorGenerated(n))}),e.qZA()()(),e.TgZ(63,"allowed-origin-c",46,47),e.NdJ("saveSettings",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e.qZA(),e.TgZ(65,"div",48),e._uU(66,"\xa0"),e.qZA()()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngModel",t.settings.sandbox.sandboxCountOverrideAdmin),e.xp6(8),e.Q6J("ngModel",t.settings.sandbox.automaticSandboxRestartInSeconds),e.xp6(17),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 a{authCS;userS;eventCenterCS;notificationS;confirmationService;cs;monacoS;tpStoreApiVersionS;instanceS;feStoreCS;generalCS;STORE_BE_HOST_PORT=x.N.STORE_BE_HOST_PORT;BE_HOST_PORT=x.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,o,d,m,ue,_e,Se,ve,xe){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=o,this.confirmationService=d,this.cs=m,this.monacoS=ue,this.tpStoreApiVersionS=_e,this.instanceS=Se,this.feStoreCS=ve,this.generalCS=xe}ngOnInit(){var t=this;return(0,r.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,r.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||[];t.settings.sandbox&&(t.settings.sandbox.automaticSandboxRestartInSeconds=t.settings.sandbox.automaticSandboxRestartInSeconds||null),n.sort(),t.settings.allowedOrigins=u.map(n,o=>({name:o})),t.rowIdSet();for(const o of t.finalPackageJson)o.rowId=(t.counter++).toString();t.generalCS.setValueInEditor(t,"editorDocker",t.settings.dockerFile||"")})()}editorGenerated(t){var i=this;return(0,r.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,r.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 o={settings:{sandbox:{sandboxCountOverrideAdmin:i.settings.sandbox.sandboxCountOverrideAdmin,automaticSandboxRestartInSeconds:i.settings.sandbox.automaticSandboxRestartInSeconds||null,dependencies:{nodeJS:i.packageSummary.filter(m=>!m.isReadOnly&&!m.isThirdPartyApi&&!m.isDefault)}},dockerFile:i.editorDocker.getValue(),allowedOrigins:u.map(i.allowedOriginC.allowedOriginsGridData,"name").sort()}};(yield i.userS.put(n,o,{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,r.Z)(function*(){var o;t.stopPropagation(),t.preventDefault(),n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,r.Z)(function*(){yield n.removePermanent(i)}),function(){return o.apply(this,arguments)})})})()}removePermanent(t){var i=this;return(0,r.Z)(function*(){i.packageSummary.splice(i.packageSummary.indexOf(t),1),i.saveSettings("DELETE").then()})()}loadDependenciesAndSchemas(){var t=this;return(0,r.Z)(function*(){const{tpNpmPackageAndVersion:i,tpApiBundleIdMap:n,tpApiVersionIdMap:o}=(yield t.instanceS.getInstalledPackagesAndSchemas().toPromise()).data;t.tpNpmPackageAndVersion=i,t.tpApiBundleIdMap=n,t.tpApiVersionIdMap=o})()}commonPackageAddRemoveTasks(){var t=this;return(0,r.Z)(function*(){yield t.loadDependenciesAndSchemas()})()}editData(t,i){var n=this;return(0,r.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,r.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,r.Z)(function*(){const i=t.eventCenterCS.headerC,n=i.systemLogsModelC.systemLogsListC.filterOptions.find(o=>o.value===I.g.DOCKER_IMAGE_BUILD_LOGS);i.showSystemLogsModal(n)})()}summaryTableDoubleClick(){var t=this;setTimeout((0,r.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||a)(e.Y36(h.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(p.YP),e.Y36(T.L),e.Y36(U.b),e.Y36(N.f),e.Y36(P.E),e.Y36(E.e),e.Y36(J.b))};static \u0275cmp=e.Xpm({type:a,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 o;e.iGM(o=e.CRH())&&(n.addNpmLibC=o.first),e.iGM(o=e.CRH())&&(n.allowedOriginC=o.first),e.iGM(o=e.CRH())&&(n.SandboxSettingsPkgVersionsModalC=o.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,"text-right",2,"position","sticky","top","0","z-index","100","padding","6px 5px"],[1,"btn","btn-primary","btn-sm","mr-1",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],[1,"btn","btn-success","btn-sm",3,"click"],[1,"fas","fa-save","fa-fw"],[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-2","col-form-label","col-form-label-sm","text-right"],[1,"col-2"],["name","Setting","type","number","placeholder","1",1,"form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"col-8","d-flex","align-items-center"],[1,"small","text-info"],[1,"row","mt-3"],["name","automaticSandboxRestartInSeconds","type","number","placeholder","seconds",1,"form-control","form-control-sm",3,"ngModel","ngModelChange"],[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,67,17,"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(d){return n.saveSettings(d)})("hideLibraryModelEventEmitter",function(){return n.hideNpmLibModel()})("installed",function(){return n.commonPackageAddRemoveTasks()}),e.qZA()),2&i){const o=e.MAs(4);e.Q6J("ngIf",n.settings),e.xp6(1),e.Q6J("data",n.data)("pkgVersionModal",o)("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,_.sg,_.O5,R.K,G.S,q.O,f.iA,p.jx,f.Ei,K.G,C.xf,C.x4,A.u,V],encapsulation:2})}return a})(),canActivate:[D.P]}];let fe=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[O.Bz.forChild(pe),y.u,M.ApiTestingM]})}return a})()}}]);
|
|
@@ -4083,6 +4083,7 @@ export enum EDBMasterConfigGridColumnVisibilityStatus {
|
|
|
4083
4083
|
* Form field configuration for UI controls.
|
|
4084
4084
|
* Defines the appearance, behavior, and validation of individual form inputs.
|
|
4085
4085
|
*/
|
|
4086
|
+
// genericConfig : start
|
|
4086
4087
|
export interface IDBMasterConfigFormField {
|
|
4087
4088
|
/**
|
|
4088
4089
|
* Unique identifier for programmatic element access.
|
|
@@ -4166,6 +4167,7 @@ export interface IDBMasterConfigFormField {
|
|
|
4166
4167
|
/**
|
|
4167
4168
|
* Multi-line text input configuration.
|
|
4168
4169
|
*/
|
|
4170
|
+
// textAreaSettings : start
|
|
4169
4171
|
textAreaSettings?: {
|
|
4170
4172
|
/** Inline style object (Angular style binding format). */
|
|
4171
4173
|
style?: any;
|
|
@@ -4222,6 +4224,7 @@ export interface IDBMasterConfigFormField {
|
|
|
4222
4224
|
code: string | (($scope: IDBMasterUIPageUtilsScope) => any),
|
|
4223
4225
|
}[],
|
|
4224
4226
|
};
|
|
4227
|
+
// textAreaSettings : end
|
|
4225
4228
|
|
|
4226
4229
|
// editorSettings : start
|
|
4227
4230
|
editorSettings?: {
|
|
@@ -5235,6 +5238,7 @@ export interface IDBMasterConfigFormField {
|
|
|
5235
5238
|
* Dropdown (select) control configuration.
|
|
5236
5239
|
* Supports static data, database queries, and custom API calls.
|
|
5237
5240
|
*/
|
|
5241
|
+
// dropdownSettings : start
|
|
5238
5242
|
dropdownSettings?: {
|
|
5239
5243
|
/** Inline style object (Angular style binding format). */
|
|
5240
5244
|
style?: any;
|
|
@@ -5369,6 +5373,7 @@ export interface IDBMasterConfigFormField {
|
|
|
5369
5373
|
*/
|
|
5370
5374
|
apiCallOverrides?: IDBMasterAPICallOverrides;
|
|
5371
5375
|
};
|
|
5376
|
+
// dropdownSettings : end
|
|
5372
5377
|
|
|
5373
5378
|
/**
|
|
5374
5379
|
* Autocomplete control configuration.
|
|
@@ -6504,6 +6509,7 @@ export interface IDBMasterConfigFormField {
|
|
|
6504
6509
|
* Validation rules for schema properties and form fields.
|
|
6505
6510
|
* Define constraints that values must satisfy before being saved.
|
|
6506
6511
|
*/
|
|
6512
|
+
// genericConfig : start
|
|
6507
6513
|
export interface IPropertyValidation {
|
|
6508
6514
|
/**
|
|
6509
6515
|
* Field is mandatory and must have a non-null, non-empty value.
|
|
@@ -6554,6 +6560,8 @@ export interface IPropertyValidation {
|
|
|
6554
6560
|
enum?: any[];
|
|
6555
6561
|
}
|
|
6556
6562
|
|
|
6563
|
+
// genericConfig : end
|
|
6564
|
+
|
|
6557
6565
|
// dropdownSettings : start
|
|
6558
6566
|
export enum EDBMasterDropdownAppendTo {
|
|
6559
6567
|
visible = 'visible',
|
|
@@ -6948,6 +6956,7 @@ export enum EDBMasterConfigAppendTo {
|
|
|
6948
6956
|
* Available form control types for UI generation.
|
|
6949
6957
|
* Each control type has specific settings and behavior.
|
|
6950
6958
|
*/
|
|
6959
|
+
// genericConfig : start
|
|
6951
6960
|
export enum EDBMasterFormControl {
|
|
6952
6961
|
/** Single-line text input. */
|
|
6953
6962
|
input = 'input',
|
package/dist/index.html
CHANGED
|
@@ -173,5 +173,5 @@
|
|
|
173
173
|
</style>
|
|
174
174
|
</noscript>
|
|
175
175
|
|
|
176
|
-
<script src="runtime.
|
|
176
|
+
<script src="runtime.94df8f20f115da3f.js" type="module"></script><script src="polyfills.47193e1d7d4041b5.js" type="module"></script><script src="main.40b9c805b1ee0fc1.js" type="module"></script></body>
|
|
177
177
|
</html>
|