@sava-info-systems/api-maker-with-extensions 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/{1025.95948d3d2668bb14.js → 1025.a0db9347453600d0.js} +1 -1
  2. package/dist/{1097.ea0e6db47339f73f.js → 1097.d0d6fd13031aa1f0.js} +1 -1
  3. package/dist/{1928.5c81326985ca5f64.js → 1928.2b376f7cf66ed038.js} +1 -1
  4. package/dist/{2714.9880836f6b8b78a7.js → 2714.0d6939336a02dd0a.js} +1 -1
  5. package/dist/2735.86437a8639a0c1bb.js +1 -0
  6. package/dist/292.c7c794ff29abbe37.js +1 -0
  7. package/dist/{4110.c8b37cab34b21d0d.js → 4110.d108e786ecbdfd1b.js} +1 -1
  8. package/dist/{4186.3bd4de588fe7617d.js → 4186.ac3e8af0efeeac14.js} +1 -1
  9. package/dist/{4211.188f84c688ab656f.js → 4211.1bfe72ce0b7b2f76.js} +1 -1
  10. package/dist/4575.6ad36e53bd72fb6f.js +1 -0
  11. package/dist/485.b546656b466cb8a4.js +1 -0
  12. package/dist/{6236.5b62431db131ce4d.js → 6236.6c0fc469f0c96549.js} +1 -1
  13. package/dist/6393.173ecdfc3b022973.js +1 -0
  14. package/dist/{7368.102769b19d40d3e0.js → 7368.9ebf62d518f8ad7a.js} +1 -1
  15. package/dist/7470.b1ce7eedb9cedb2d.js +1 -0
  16. package/dist/{7975.6f386123f5c64f78.js → 7975.578a00ebd1160a1e.js} +1 -1
  17. package/dist/{7987.d15aacc264588b12.js → 7987.5958ad5b81873058.js} +1 -1
  18. package/dist/{8125.35fe2368910566d5.js → 8125.b2f908096882ed45.js} +1 -1
  19. package/dist/{8296.e4e3f60f70779a30.js → 8296.a387c28f5702c5e8.js} +1 -1
  20. package/dist/{885.c5fd870ec02f004d.js → 885.be44d92efca1aaf6.js} +1 -1
  21. package/dist/assets/public/monaco-editor/index.html +61 -0
  22. package/dist/assets/public/monaco-editor/index.js +1 -0
  23. package/dist/assets/schema-types/InterfaceProps.ts +2 -0
  24. package/dist/assets/schema-types/types.ts +28 -27
  25. package/dist/index.html +1 -28
  26. package/dist/main.d3c81428418939dc.js +1 -0
  27. package/dist/{runtime.94df8f20f115da3f.js → runtime.2f0f434d4763c970.js} +1 -1
  28. package/main.js +1 -1
  29. package/package.json +11 -11
  30. package/sandbox.js +1 -1
  31. package/src/assets/schema-types/types.ts +28 -27
  32. package/src/public/dist-db-masters/browser/index.html +1 -1
  33. package/src/public/dist-db-masters/browser/main-6YSY4AYM.js +139 -0
  34. package/src/tools/local-client.js +1 -1
  35. package/dist/2735.a66ecf607b9654e0.js +0 -1
  36. package/dist/292.885b93c9e38b775a.js +0 -1
  37. package/dist/4575.584a2fd6d6505e7a.js +0 -1
  38. package/dist/485.ec283c2f8b792308.js +0 -1
  39. package/dist/6393.bff610fd50c307e8.js +0 -1
  40. package/dist/7470.1bdcf8e01acb62bd.js +0 -1
  41. package/dist/assets/monaco-assets/configurations/cpp.json +0 -34
  42. package/dist/assets/monaco-assets/configurations/csharp.json +0 -32
  43. package/dist/assets/monaco-assets/configurations/dart.json +0 -29
  44. package/dist/assets/monaco-assets/configurations/go.json +0 -37
  45. package/dist/assets/monaco-assets/configurations/java.json +0 -33
  46. package/dist/assets/monaco-assets/configurations/javascript.json +0 -140
  47. package/dist/assets/monaco-assets/configurations/json.json +0 -22
  48. package/dist/assets/monaco-assets/configurations/python.json +0 -56
  49. package/dist/assets/monaco-assets/configurations/ruby.json +0 -31
  50. package/dist/assets/monaco-assets/configurations/rust.json +0 -34
  51. package/dist/assets/monaco-assets/configurations/swift.json +0 -27
  52. package/dist/assets/monaco-assets/configurations/typescript.json +0 -140
  53. package/dist/assets/monaco-assets/configurations/xml.json +0 -39
  54. package/dist/assets/monaco-assets/configurations/yaml.json +0 -35
  55. package/dist/assets/monaco-assets/grammars/cpp.tmLanguage.json +0 -16309
  56. package/dist/assets/monaco-assets/grammars/csharp.tmLanguage.json +0 -4984
  57. package/dist/assets/monaco-assets/grammars/dart.tmLanguage.json +0 -521
  58. package/dist/assets/monaco-assets/grammars/go.tmLanguage.json +0 -1017
  59. package/dist/assets/monaco-assets/grammars/java.tmLanguage.json +0 -1855
  60. package/dist/assets/monaco-assets/grammars/javascript.tmLanguage.json +0 -5914
  61. package/dist/assets/monaco-assets/grammars/json.tmLanguage.json +0 -213
  62. package/dist/assets/monaco-assets/grammars/magicpython.tmLanguage.json +0 -4213
  63. package/dist/assets/monaco-assets/grammars/ruby.tmLanguage.json +0 -2775
  64. package/dist/assets/monaco-assets/grammars/rust.tmLanguage.json +0 -1170
  65. package/dist/assets/monaco-assets/grammars/swift.tmLanguage.json +0 -3303
  66. package/dist/assets/monaco-assets/grammars/typescript.tmLanguage.json +0 -5665
  67. package/dist/assets/monaco-assets/grammars/xml.tmLanguage.json +0 -387
  68. package/dist/assets/monaco-assets/grammars/yaml.tmLanguage.json +0 -621
  69. package/dist/assets/monaco-assets/onig.wasm +0 -0
  70. package/dist/main.40b9c805b1ee0fc1.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4575],{24575:(ut,m,i)=>{i.r(m),i.d(m,{DeploymentSettingsM:()=>rt});var C=i(77664),S=i(17017),h=i(81490),p=i(15861),r=i(60095),l=i(20553),t=i(94946),T=i(45809),f=i(95852),Z=i(19394),U=i(46178),x=i(69862);let y=(()=>{class a extends U.g{http;authCS;constructor(e,o){super(e,Z.k4.ROOT_USER_SETTINGS),this.http=e,this.authCS=o}saveRootUserSettings(e){return this.http.put(l.N.BE_HOST_PORT_SITES+`${this.modelPath}/set-root-user-settings`,e).toPromise()}getRootUserSettings(){return this.http.get(l.N.BE_HOST_PORT_SITES+`${this.modelPath}/get-root-user-settings`)}verifyRootUserSettings(e){return this.http.post(l.N.BE_HOST_PORT_SITES+`${this.modelPath}/verify-root-user-settings`,e).toPromise()}static \u0275fac=function(o){return new(o||a)(t.LFG(x.eN),t.LFG(f.D))};static \u0275prov=t.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var A=i(77240),b=i(53429),_=i(99961),R=i(96814),D=i(32660),J=i(756),k=i(33259),w=i(38057),L=i(96218),I=i(54323);function N(a,s){1&a&&t._UZ(0,"i",64)}function F(a,s){if(1&a&&t._UZ(0,"i",65),2&a){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.logDatabaseConnectionMessage)}}function q(a,s){if(1&a){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",66)(2,"span",67),t._uU(3,"\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf"),t.qZA(),t.TgZ(4,"a",68),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.showLogDbConnection=!0)}),t._UZ(5,"i",69),t._uU(6," Show "),t.qZA()(),t.BQk()}}function O(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"a",71),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.showLogDbConnection=!1)}),t._UZ(1,"i",72),t._uU(2," Hide "),t.qZA()}}function E(a,s){if(1&a&&(t._UZ(0,"textarea",70),t.YNc(1,O,3,0,"a",36)),2&a){const e=t.oxw();t.Q6J("autoResize",!0),t.xp6(1),t.Q6J("ngIf",e.showLogDbConnection)}}function P(a,s){1&a&&t._UZ(0,"i",64)}function M(a,s){if(1&a&&t._UZ(0,"i",65),2&a){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.externalRedisSettingsJsonMessage)}}function Y(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",66)(1,"span",67),t._uU(2,"\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf"),t.qZA(),t.TgZ(3,"a",68),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.showRedisJson=!0)}),t._UZ(4,"i",69),t._uU(5," Show "),t.qZA()()}}function Q(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"a",71),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.showRedisJson=!1)}),t._UZ(1,"i",72),t._uU(2," Hide "),t.qZA()}}function V(a,s){if(1&a){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",66)(2,"span",67),t._uU(3,"\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf"),t.qZA(),t.TgZ(4,"a",68),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.showJwtPassword=!0)}),t._UZ(5,"i",69),t._uU(6," Show "),t.qZA()(),t.BQk()}}function G(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"a",71),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.showJwtPassword=!1)}),t._UZ(1,"i",72),t._uU(2," Hide "),t.qZA()}}function H(a,s){if(1&a&&(t._UZ(0,"input",73),t.YNc(1,G,3,0,"a",36)),2&a){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.showJwtPassword)}}function W(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",24)(1,"label",11),t._uU(2,"API URL"),t.qZA(),t.TgZ(3,"div",80)(4,"code",81),t._uU(5),t.qZA(),t.TgZ(6,"i",82),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.copyToClipboard(n.BE_HOST_PORT+"/api/sites/root-user-settings/operate-api-maker-using-api"))}),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(5),t.hij("",e.BE_HOST_PORT,"/api/sites/root-user-settings/operate-api-maker-using-api")}}function j(a,s){if(1&a){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",66)(2,"span",67),t._uU(3,"\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf\u25cf"),t.qZA(),t.TgZ(4,"a",68),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(3);return t.KtG(n.showCommunicationToken=!0)}),t._UZ(5,"i",69),t._uU(6," Show "),t.qZA()(),t.BQk()}}function B(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"a",71),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(4);return t.KtG(n.showCommunicationToken=!1)}),t._UZ(1,"i",72),t._uU(2," Hide "),t.qZA()}}function K(a,s){if(1&a&&(t._UZ(0,"input",85),t.YNc(1,B,3,0,"a",36)),2&a){const e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",e.showCommunicationToken)}}function $(a,s){1&a&&(t.TgZ(0,"div",86),t._uU(1," Communication Token is required. "),t.qZA())}function z(a,s){if(1&a&&(t.TgZ(0,"div",86),t._uU(1),t.qZA()),2&a){const e=t.oxw(3);t.xp6(1),t.hij(" Minimum 48 characters required (current: ",(null==e.form.get("rootUserCommunicationToken").value?null:e.form.get("rootUserCommunicationToken").value.length)||0,"). ")}}function X(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"div",24)(1,"label",11),t._uU(2,"Communication Token"),t.qZA(),t.TgZ(3,"div",14),t.YNc(4,j,7,0,"ng-container",15),t.YNc(5,K,2,1,"ng-template",null,83,t.W1O),t.YNc(7,$,2,0,"div",84),t.YNc(8,z,2,1,"div",84),t.qZA(),t.TgZ(9,"div",26)(10,"div")(11,"a",46),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.generateRootUserCommunicationToken())}),t._UZ(12,"i",47),t._uU(13," Generate "),t.qZA(),t.TgZ(14,"span",48),t._uU(15,"Used to authenticate API Maker API calls. Min 48 characters."),t.qZA()()()()}if(2&a){const e=t.MAs(6),o=t.oxw(2);t.xp6(4),t.Q6J("ngIf",o.form.get("rootUserCommunicationToken").value&&!o.showCommunicationToken)("ngIfElse",e),t.xp6(3),t.Q6J("ngIf",null==o.form.get("rootUserCommunicationToken").errors?null:o.form.get("rootUserCommunicationToken").errors.required),t.xp6(1),t.Q6J("ngIf",null==o.form.get("rootUserCommunicationToken").errors?null:o.form.get("rootUserCommunicationToken").errors.minlength)}}function tt(a,s){if(1&a&&(t.TgZ(0,"div",5)(1,"div",6)(2,"span"),t._UZ(3,"i",74),t._uU(4," API Access"),t.qZA()(),t.TgZ(5,"div",8)(6,"div",9)(7,"div",10)(8,"label",11),t._uU(9,"Operate API Maker Using API"),t.qZA(),t.TgZ(10,"div",75),t._UZ(11,"p-checkbox",76),t.qZA(),t.TgZ(12,"div",26)(13,"a",77),t._UZ(14,"i",78),t._uU(15," Documentation "),t.qZA()()(),t.YNc(16,W,7,1,"div",79),t.YNc(17,X,16,4,"div",79),t.qZA()()()),2&a){const e=t.oxw();t.xp6(11),t.Q6J("binary",!0),t.xp6(5),t.Q6J("ngIf",e.form.get("operateUsingApi").value),t.xp6(1),t.Q6J("ngIf",e.form.get("operateUsingApi").value)}}function et(a,s){1&a&&t._UZ(0,"i",64)}function nt(a,s){if(1&a&&t._UZ(0,"i",65),2&a){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.d2DiagramLibPathMessage)}}function ot(a,s){if(1&a&&(t.TgZ(0,"span",87),t._uU(1),t.qZA()),2&a){const e=t.oxw();t.xp6(1),t.Oqu(e.validationResp.d2DiagramLibVersion)}}function at(a,s){if(1&a&&(t._UZ(0,"div",88),t.ALo(1,"safeHtml")),2&a){const e=t.oxw();t.Q6J("innerHTML",t.lcZ(1,1,e.d2InstallError),t.oJD)}}function it(a,s){if(1&a){const e=t.EpF();t.TgZ(0,"a",89),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.installAndDetectD2Lib())}),t._UZ(1,"i",90),t._uU(2," Auto Install "),t.qZA()}}const st=[{path:"",component:(()=>{class a{fb;monacoS;authCS;rootUserSettings;generalS;instanceS;ns;cd;notificationS;form;formData;loading={form:!1};BE_HOST_PORT=l.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};pendingRedisJSON;editorStartupScript;editorOptionsStartupScript={readOnly:!1,language:"bash",contextmenu:!0};pendingStartupScript;d2InstallError;validationResp;showLogDbConnection=!1;showRedisJson=!1;showJwtPassword=!1;showCommunicationToken=!1;hasRedisJsonValue=!1;showApiAccessSection=!0;constructor(e,o,n,c,u,d,g,lt,ct){this.fb=e,this.monacoS=o,this.authCS=n,this.rootUserSettings=c,this.generalS=u,this.instanceS=d,this.ns=g,this.cd=lt,this.notificationS=ct}ngOnInit(){var e=this;return(0,p.Z)(function*(){e.createForm(),yield e.loadData(),e.form.get("operateUsingApi").valueChanges.subscribe(o=>{const n=e.form.get("rootUserCommunicationToken");n.setValidators(o?[r.kI.required,r.kI.minLength(48)]:[r.kI.minLength(48)]),n.updateValueAndValidity()})})()}createForm(){this.form=this.fb.group({logDatabaseConnectionString:["",[]],externalRedisSettingsJsonString:["",[]],serverStartupScript:["",[]],universalLoginCaptcha:["",[]],logRemoveSchedulerInterval:["0 0 0 * * *",[]],passJWTOfAPIUsers:["",[]],jwtTokenExpiresInSeconds:[259200,[r.kI.min(60),r.kI.max(10368e4)]],maxLogsCount:[1e4,[]],d2DiagramLibPath:[1e4,[]],operateUsingApi:[!1,[]],rootUserCommunicationToken:["",[r.kI.minLength(48)]]})}loadData(){var e=this;return(0,p.Z)(function*(){try{e.loading.form=!0;const o=(yield e.rootUserSettings.getRootUserSettings().toPromise()).data;if(e.form.reset(),e.form.patchValue(o),o?.logDatabaseConnectionString){const n=e.generalS.getDecryptedString(o.logDatabaseConnectionString,l.N.crypto.passCommunication);e.form.get("logDatabaseConnectionString").setValue(n)}if(o?.passJWTOfAPIUsers){const n=e.generalS.getDecryptedString(o.passJWTOfAPIUsers,l.N.crypto.passCommunication);e.form.get("passJWTOfAPIUsers").setValue(n)}if(o?.externalRedisSettingsJsonString){const n=e.generalS.getDecryptedString(o.externalRedisSettingsJsonString,l.N.crypto.passCommunication);e.editorRedisConnectionJSON?e.editorRedisConnectionJSON.setValue(n):e.pendingRedisJSON=n,e.hasRedisJsonValue=!0}if(o?.serverStartupScript&&(e.editorStartupScript?e.editorStartupScript.setValue(o.serverStartupScript):e.pendingStartupScript=o.serverStartupScript),o?.universalLoginCaptcha){const n=e.generalS.getDecryptedString(o.universalLoginCaptcha,l.N.crypto.passCommunication);e.form.get("universalLoginCaptcha").setValue(n)}if(o?.rootUserCommunicationToken){const n=e.generalS.getDecryptedString(o.rootUserCommunicationToken,l.N.crypto.passCommunication);e.form.get("rootUserCommunicationToken").setValue(n)}e.loading.form=!1}catch(o){e.loading.form=!1,e.ns.showErrorFromResponse(o.error||o,"Unable to load data.")}})()}update(){var e=this;return(0,p.Z)(function*(){try{if(e.loading.form=!0,e.formData=e.form.getRawValue(),e.form.get("operateUsingApi").value&&e.form.get("rootUserCommunicationToken").invalid)return e.ns.showError("Communication Token is required and must be at least 48 characters."),void(e.loading.form=!1);e.form.get("logDatabaseConnectionString").value&&(e.formData.logDatabaseConnectionString=e.generalS.getEncryptedString(e.form.get("logDatabaseConnectionString").value,l.N.crypto.passCommunication)),e.form.get("passJWTOfAPIUsers").value&&(e.formData.passJWTOfAPIUsers=e.generalS.getEncryptedString(e.form.get("passJWTOfAPIUsers").value,l.N.crypto.passCommunication)),e.editorRedisConnectionJSON.getValue()&&(e.formData.externalRedisSettingsJsonString=e.generalS.getEncryptedString(e.editorRedisConnectionJSON.getValue(),l.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,l.N.crypto.passCommunication)),e.form.get("rootUserCommunicationToken").value&&(e.formData.rootUserCommunicationToken=e.generalS.getEncryptedString(e.form.get("rootUserCommunicationToken").value,l.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(o){e.loading.form=!1,e.ns.showErrorFromResponse(o.error||o,"Unable to update.")}})()}verifyRootUser(e){var o=this;return(0,p.Z)(function*(){const n=yield o.rootUserSettings.verifyRootUserSettings(e);o.validationResp=n.data,setTimeout(()=>{o.cd.detectChanges()},1e3)})()}copyToClipboard(e){var o=this;return(0,p.Z)(function*(){"json"===e?yield navigator.clipboard.writeText(o.sampleJson):e?yield navigator.clipboard.writeText(e):yield navigator.clipboard.writeText(o.sampleConnectionString),o.notificationS.showSuccess("Copied to clipboard.")})()}editorGenerated(e){var o=this;return(0,p.Z)(function*(){o.loading.form=!0,o.editorRedisConnectionJSON=e,o.pendingRedisJSON&&(o.editorRedisConnectionJSON.setValue(o.pendingRedisJSON),o.pendingRedisJSON=null),yield o.monacoS.loadSchemaEditorSettings(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.monacoS.addSaveCodeKeyBinding(e,n=>{o.form.valid&&o.update()}),o.loading.form=!1})()}editorGeneratedStartupScript(e){var o=this;return(0,p.Z)(function*(){o.loading.form=!0,o.editorStartupScript=e,o.pendingStartupScript&&(o.editorStartupScript.setValue(o.pendingStartupScript),o.pendingStartupScript=null),o.monacoS.addSaveCodeKeyBinding(e,n=>{o.form.valid&&o.update()}),o.loading.form=!1})()}installAndDetectD2Lib(){var e=this;return(0,p.Z)(function*(){e.loading.form=!0;try{const n=(yield e.instanceS.installAndDetectD2Lib()).data,c=n[0].d2InstallOutput?.data?.d2LibPath;if(c)e.form.patchValue({d2DiagramLibPath:c}),e.ns.showSuccess("D2 library installed successfully.");else{const u=n[0].d2InstallOutput?.errors?.[0]?.message;e.ns.showError(u),e.d2InstallError=u}}catch(o){e.ns.showErrorFromResponse(o.error||o,"Unable to install d2 diagram library.")}e.loading.form=!1,e.cd.detectChanges()})()}generateRandomValue(e){const o=this.generalS.getRandomStringWithCapitals(5),n=this.generalS.getRandomStringWithCapitals(5),c=this.generalS.getRandomStringWithCapitals(5),u=this.generalS.getRandomStringWithCapitals(5),d=this.generalS.getRandomStringWithCapitals(5),g=this.generalS.getRandomStringWithCapitals(5);this.form.get(e).setValue(`${o}_${n}_${c}_${u}_${d}_${g}`)}generateRootUserCommunicationToken(){const e=Array.from({length:10},()=>this.generalS.getRandomStringWithCapitals(5));this.form.get("rootUserCommunicationToken").setValue(e.join("_"))}static \u0275fac=function(o){return new(o||a)(t.Y36(r.qu),t.Y36(T.b),t.Y36(f.D),t.Y36(y),t.Y36(A.b),t.Y36(b.E),t.Y36(_.W),t.Y36(t.sBO),t.Y36(_.W))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-dep-set-layout"]],decls:204,vars:30,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"],[4,"ngIf","ngIfElse"],["logDbInput",""],[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"],["class","d-flex align-items-center","style","padding-top: calc(.25rem + 1px); padding-bottom: calc(.25rem + 1px);",4,"ngIf"],[3,"hidden"],[2,"height","220px"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:","class","small text-muted d-inline-block mt-1",3,"click",4,"ngIf"],[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"],["jwtInput",""],["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"],["class","card shadow-sm mr-1 mb-3",4,"ngIf"],[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,"d-flex","align-items-center",2,"padding-top","calc(.25rem + 1px)","padding-bottom","calc(.25rem + 1px)"],[1,"text-muted","font-monospaced"],["href","javascript:",1,"small","text-info","ml-2",3,"click"],[1,"fas","fa-eye","fa-fw"],["rows","3","formControlName","logDatabaseConnectionString","spellcheck","false","placeholder","mongodb://username:password@host:port/db","pInputTextarea","",1,"form-control","form-control-sm","font-monospaced",3,"autoResize"],["href","javascript:",1,"small","text-muted","d-inline-block","mt-1",3,"click"],[1,"fas","fa-eye-slash","fa-fw"],["maxlength","32","formControlName","passJWTOfAPIUsers","spellcheck","false","type","text",1,"form-control","form-control-sm","font-monospaced"],[1,"fas","fa-plug","text-primary","fa-fw","mr-1"],[1,"col-6","d-flex","align-items-center"],["formControlName","operateUsingApi","inputId","operateUsingApi",3,"binary"],["href","https://docs.apimaker.dev/v1/docs/am-resources/operate-api-maker-using-api.html","target","_blank",1,"small","text-info"],[1,"fas","fa-book","fa-fw"],["class","row mt-3",4,"ngIf"],[1,"col-10","d-flex","align-items-center"],[1,"small","text-warning","font-monospaced"],["pTooltip","Copy URL",1,"fas","fa-copy","text-muted","ml-2","cursor-pointer",3,"click"],["commTokenInput",""],["class","text-danger small mt-1",4,"ngIf"],["formControlName","rootUserCommunicationToken","spellcheck","false","type","text","placeholder","Minimum 48 characters",1,"form-control","form-control-sm","font-monospaced"],[1,"text-danger","small","mt-1"],[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(o,n){if(1&o&&(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,F,1,1,"i",13),t.qZA(),t.TgZ(18,"div",14),t.YNc(19,q,7,0,"ng-container",15),t.YNc(20,E,2,2,"ng-template",null,16,t.W1O),t.TgZ(22,"div",17),t._uU(23),t.qZA()(),t.TgZ(24,"div",18)(25,"div",19)(26,"div",20)(27,"small",21),t._uU(28,"Example"),t.qZA(),t.TgZ(29,"i",22),t.NdJ("click",function(){return n.copyToClipboard()}),t.qZA()(),t.TgZ(30,"small",23),t._uU(31),t.qZA()()()(),t.TgZ(32,"div",24)(33,"label",11),t._uU(34,"Log Remove CRON"),t.qZA(),t.TgZ(35,"div",14),t._UZ(36,"input",25),t.TgZ(37,"div",17),t._uU(38),t.qZA()(),t.TgZ(39,"div",26)(40,"span",27),t._uU(41,"Clean logs daily. Ex: "),t.TgZ(42,"code"),t._uU(43,"0 0 0 * * *"),t.qZA()()()(),t.TgZ(44,"div",24)(45,"label",11),t._uU(46,"Max Logs Count"),t.qZA(),t.TgZ(47,"div",28),t._UZ(48,"input",29),t.qZA(),t.TgZ(49,"div",30)(50,"span",27),t._uU(51,"Keeps the most recent N log entries."),t.qZA()()()()()(),t.TgZ(52,"div",5)(53,"div",6)(54,"span"),t._UZ(55,"i",31),t._uU(56," Cache (Redis)"),t.qZA()(),t.TgZ(57,"div",8)(58,"div",9)(59,"div",10)(60,"label",11),t._uU(61," Redis Connection JSON "),t.YNc(62,P,1,0,"i",12),t.YNc(63,M,1,1,"i",13),t.qZA(),t.TgZ(64,"div",14),t.YNc(65,Y,6,0,"div",32),t.TgZ(66,"div",33)(67,"div",34)(68,"app-monaco-editor",35),t.NdJ("editorGenerated",function(u){return n.editorGenerated(u)}),t.qZA()(),t.YNc(69,Q,3,0,"a",36),t.qZA(),t.TgZ(70,"div",17),t._uU(71),t.qZA()(),t.TgZ(72,"div",18)(73,"div",37)(74,"div",38)(75,"small",21),t._uU(76,"Example"),t.qZA(),t.TgZ(77,"i",22),t.NdJ("click",function(){return n.copyToClipboard("json")}),t.qZA()(),t.TgZ(78,"pre",39),t._uU(79),t.TgZ(80,"span",40),t._uU(81,'"nodes"'),t.qZA(),t._uU(82),t.TgZ(83,"span",40),t._uU(84,'"port"'),t.qZA(),t._uU(85,": "),t.TgZ(86,"span",41),t._uU(87,"6390"),t.qZA(),t._uU(88,",\n "),t.TgZ(89,"span",40),t._uU(90,'"host"'),t.qZA(),t._uU(91,": "),t.TgZ(92,"span",42),t._uU(93,'"127.0.0.1"'),t.qZA(),t._uU(94,",\n "),t.TgZ(95,"span",40),t._uU(96,'"pass"'),t.qZA(),t._uU(97,": "),t.TgZ(98,"span",42),t._uU(99,'""'),t.qZA(),t._uU(100),t.TgZ(101,"span",40),t._uU(102,'"otherRedisClusterOptions"'),t.qZA(),t._uU(103,": "),t.TgZ(104,"span",21),t._uU(105,"null"),t.qZA(),t._uU(106,",\n "),t.TgZ(107,"span",40),t._uU(108,'"redisValueExpireInSeconds"'),t.qZA(),t._uU(109,": "),t.TgZ(110,"span",41),t._uU(111,"7200"),t.qZA(),t._uU(112,",\n "),t.TgZ(113,"span",40),t._uU(114,'"maxCharsResToCache"'),t.qZA(),t._uU(115,": "),t.TgZ(116,"span",41),t._uU(117,"1000000"),t.qZA(),t._uU(118),t.qZA()()()()()()(),t.TgZ(119,"div",5)(120,"div",6)(121,"span"),t._UZ(122,"i",43),t._uU(123," Security"),t.qZA()(),t.TgZ(124,"div",8)(125,"div",9)(126,"div",10)(127,"label",11),t._uU(128,"Universal Login Captcha"),t.qZA(),t.TgZ(129,"div",14),t._UZ(130,"input",44),t.qZA()(),t.TgZ(131,"div",24)(132,"label",11),t._uU(133,"JWT Password"),t.qZA(),t.TgZ(134,"div",14),t.YNc(135,V,7,0,"ng-container",15),t.YNc(136,H,2,1,"ng-template",null,45,t.W1O),t.qZA(),t.TgZ(138,"div",26)(139,"div")(140,"a",46),t.NdJ("click",function(){return n.generateRandomValue("passJWTOfAPIUsers")}),t._UZ(141,"i",47),t._uU(142," Generate "),t.qZA(),t.TgZ(143,"span",48),t._uU(144,"Used to sign JWT tokens. Changing this logs out all app users."),t.qZA()()()(),t.TgZ(145,"div",24)(146,"label",11),t._uU(147,"JWT Expires (seconds)"),t.qZA(),t.TgZ(148,"div",28),t._UZ(149,"input",49),t.qZA(),t.TgZ(150,"div",30)(151,"span",27),t._uU(152,"259200 = 3 days \xa0|\xa0 86400 = 1 day"),t.qZA()()()()()(),t.YNc(153,tt,18,3,"div",50),t.TgZ(154,"div",5)(155,"div",6)(156,"span"),t._UZ(157,"i",51),t._uU(158," Tools"),t.qZA()(),t.TgZ(159,"div",8)(160,"div",9)(161,"div",10)(162,"label",11),t._uU(163," D2 Diagram Library "),t.YNc(164,et,1,0,"i",12),t.YNc(165,nt,1,1,"i",13),t.qZA(),t.TgZ(166,"div",14),t._UZ(167,"input",52),t.YNc(168,ot,2,1,"span",53),t.YNc(169,at,2,3,"div",54),t.qZA(),t.TgZ(170,"div",26)(171,"div"),t.YNc(172,it,3,0,"a",55),t.TgZ(173,"a",56),t._UZ(174,"i",57),t._uU(175," Install Guide "),t.qZA()()()()()()(),t.TgZ(176,"div",58)(177,"div",6)(178,"span"),t._UZ(179,"i",59),t._uU(180," Scripts"),t.qZA()(),t.TgZ(181,"div",8)(182,"div",9)(183,"div",10)(184,"label",11),t._uU(185,"Server Startup Script"),t.qZA(),t.TgZ(186,"div",14)(187,"div",34)(188,"app-monaco-editor",35),t.NdJ("editorGenerated",function(u){return n.editorGeneratedStartupScript(u)}),t.qZA()()(),t.TgZ(189,"div",18)(190,"div",60)(191,"small",61),t._uU(192,"Notes"),t.qZA(),t.TgZ(193,"ul",62)(194,"li"),t._uU(195,"Direct bash script, runs once on process/worker start."),t.qZA(),t.TgZ(196,"li"),t._uU(197,"All environment variables are available."),t.qZA(),t.TgZ(198,"li"),t._uU(199,"Useful for installing NPM packages for native APIs."),t.qZA()(),t.TgZ(200,"small",21),t._uU(201,"Example:"),t.qZA(),t.TgZ(202,"pre",63),t._uU(203,"npm install is-even"),t.qZA()()()()()()()()()),2&o){const c=t.MAs(21),u=t.MAs(137);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("ngIf",n.form.get("logDatabaseConnectionString").value&&!n.showLogDbConnection)("ngIfElse",c),t.xp6(4),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(2),t.Q6J("ngIf",n.hasRedisJsonValue&&!n.showRedisJson),t.xp6(1),t.Q6J("hidden",n.hasRedisJsonValue&&!n.showRedisJson),t.xp6(2),t.Q6J("isSchemaEditor",!1)("editorOptions",n.editorOptionsRedisConnectionJSON),t.xp6(1),t.Q6J("ngIf",n.showRedisJson),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(17),t.Q6J("ngIf",n.form.get("passJWTOfAPIUsers").value&&!n.showJwtPassword)("ngIfElse",u),t.xp6(18),t.Q6J("ngIf",n.showApiAccessSection),t.xp6(11),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:[r._Y,r.Fj,r.wV,r.JJ,r.JL,r.nD,r.sg,r.u,R.O5,D.y,J.O,k.u,w.XZ,L.g,I.z],encapsulation:2})}return a})(),canActivate:[h.g]}];let rt=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[C.Bz.forChild(st),S.u]})}return a})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[485],{60485:(U,c,n)=>{n.r(c),n.d(c,{TsGenInterfacesM:()=>N});var g=n(77664),u=n(17017),h=n(63726),l=n(15861),v=n(51162),p=n(20553),e=n(94946),T=n(53429),y=n(45809),S=n(69862),G=n(77240),I=n(96814),C=n(756),f=n(95431),Z=n(85219),O=n(97680),w=n(33259);function R(a,d){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA()())}function A(a,d){if(1&a&&(e.TgZ(0,"tr",19)(1,"td"),e._uU(2),e.qZA()()),2&a){const t=d.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name)}}function L(a,d){1&a&&e._UZ(0,"p-progressSpinner",20)}const P=[{path:"main",component:(()=>{class a{cd;instanceS;monacoS;http;generalS;projectType="AM";BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;loading={grid:!1};editorGeneratedInterfaces;editorOptions={readOnly:!1,language:"typescript",contextmenu:!0};gridKey=v.iH._id;rows=[];selectedRow=null;constructor(t,s,i,o,r){this.cd=t,this.instanceS=s,this.monacoS=i,this.http=o,this.generalS=r}ngOnInit(){this.rows.push({_id:"db-interfaces.ts",name:"db-interfaces.ts"},{_id:"types.ts",name:"types.ts"}),setTimeout(()=>{this.selectedRow=this.rows[0],this.itemSelected().then()},100)}itemSelected(){var t=this;return(0,l.Z)(function*(){if(!t.editorGeneratedInterfaces)return;if(!t.selectedRow)return void t.editorGeneratedInterfaces.setValue("");let s;t.loading.grid=!0,"db-interfaces.ts"===t.selectedRow._id?s=(yield t.instanceS.getGeneratedInterfaceCode(t.selectedRow)).data["file:///node_modules/@types/db-interfaces.d.ts"]:"types.ts"===t.selectedRow._id&&(s=yield t.getP("/assets/schema-types/types.ts"),s=t.cleanTagLines(s)),t.editorGeneratedInterfaces.setValue(s),t.monacoS.formatDocument(t.editorGeneratedInterfaces),setTimeout(()=>{t.loading.grid=!1},500)})()}cleanTagLines(t){const s=t.split("\n"),i=[];for(const o of s)o.endsWith(" : start")||o.endsWith(" : end")||i.push(o);return i.join("\n")}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editorGeneratedInterfaces=t,yield s.itemSelected()})()}getP(t){return this.http.get(t,{responseType:"text"}).toPromise()}downloadTSGeneratedInterfaces(){var t=this;return(0,l.Z)(function*(){t.generalS.downloadFile(t.editorGeneratedInterfaces.getValue(),t.selectedRow.name)})()}static \u0275fac=function(s){return new(s||a)(e.Y36(e.sBO),e.Y36(T.E),e.Y36(y.b),e.Y36(S.eN),e.Y36(G.b))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-ts-gen-interfaces-layout"]],decls:26,vars:9,consts:[["id","idUtilityClassesFormPanel",1,"pt-1","pl-1","pr-1","overflow-auto"],[1,"row","m-0","full-body"],[1,"p-0","col-3"],[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/typescript.svg","alt","System Generated Interfaces",1,"fa-fw","mr-1",2,"vertical-align","text-bottom"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/features/ts-generated-interfaces.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped utility-classes-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],[1,"p-0","col-9"],["src","/assets/images/icons/typescript.svg",1,"fa-fw","mr-1",2,"vertical-align","text-bottom"],["tooltipPosition","left","pTooltip","Download",1,"fas","fa-file-download","text-success","fa-fw","float-right","cursor-pointer","line-height-1-3","mr-2",3,"click"],[1,"overflow-hidden",2,"height","calc(100vh - 90px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,i){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span"),e._UZ(6,"img",5),e._uU(7," Interfaces"),e.qZA(),e.TgZ(8,"div",6)(9,"a",7),e._UZ(10,"img",8),e.qZA()()(),e.TgZ(11,"div",9)(12,"p-table",10),e.NdJ("selectionChange",function(r){return i.selectedRow=r})("selectionChange",function(){return i.itemSelected()}),e.YNc(13,R,3,0,"ng-template",11),e.YNc(14,A,3,2,"ng-template",12),e.qZA()()()(),e.TgZ(15,"div",13)(16,"div",3)(17,"div",4)(18,"span"),e._UZ(19,"img",14),e._uU(20," Code"),e.qZA(),e.TgZ(21,"i",15),e.NdJ("click",function(){return i.downloadTSGeneratedInterfaces()}),e.qZA()(),e.TgZ(22,"div",9)(23,"div",16)(24,"app-monaco-editor",17),e.NdJ("editorGenerated",function(r){return i.editorGenerated(r)}),e.qZA()()()(),e.YNc(25,L,1,0,"p-progressSpinner",18),e.qZA()()()),2&s&&(e.xp6(12),e.Q6J("selectionMode","single")("metaKeySelection",!0)("selection",i.selectedRow)("dataKey",i.gridKey)("scrollable",!0)("value",i.rows),e.xp6(12),e.Q6J("isSchemaEditor",!0)("editorOptions",i.editorOptions),e.xp6(1),e.Q6J("ngIf",i.loading.grid))},dependencies:[I.O5,C.O,f.iA,Z.jx,f.Ei,O.G,w.u]})}return a})(),canActivate:[h.P]}];let N=(()=>{class a{static \u0275fac=function(s){return new(s||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[g.Bz.forChild(P),u.u]})}return a})()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6236],{34491:(C,u,s)=>{s.d(u,{g:()=>q});var m=s(15861),r=s(60095),c=s(33157),l=s(90328),E=s(59361),I=s(51162),p=s(20553),D=s(45085),g=s(91601),f=s(3531),h=s(39989),e=s(94946),v=s(99961),M=s(77240),O=s(27414),T=s(62694),A=s(95852),S=s(62304),U=s(53429),Z=s(32915),F=s(33835),z=s(96814),b=s(32660),R=s(5860),y=s(756),x=s(97680),P=s(14844),L=s(33259),B=s(25025);const W=["insertCodeModalC"],K=["monacoEditorModalC"];function N(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Add Process Initializer"),e.qZA())}function J(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," View Process Initializer"),e.qZA())}function Y(i,_){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," Edit Process Initializer "),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(4),e.Oqu(o.form.get("name").value)}}function w(i,_){1&i&&(e.TgZ(0,"span",39),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function V(i,_){if(1&i&&(e.TgZ(0,"div")(1,"form",31)(2,"div",32)(3,"label",33),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",34),e._UZ(6,"input",35),e.YNc(7,w,2,0,"span",36),e.qZA()(),e.TgZ(8,"div",32)(9,"label",33),e._uU(10,"Order"),e.qZA(),e.TgZ(11,"div",34),e._UZ(12,"input",37),e.qZA()(),e.TgZ(13,"div",32)(14,"label",33),e._uU(15,"Timeout in minutes"),e.qZA(),e.TgZ(16,"div",34),e._UZ(17,"input",38),e.qZA()()()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("formGroup",o.form),e.xp6(6),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD)}}function Q(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"div",40)(1,"app-monaco-editor",41),e.NdJ("editorGenerated",function(t){e.CHM(o);const n=e.oxw();return e.KtG(n.editorGenerated(t))}),e.qZA()()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",o.editorOptionsProcessInitializer)}}function G(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"a",42),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function k(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function j(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.save())}),e._UZ(1,"i",44),e.YNc(2,H,2,0,"span",4),e.YNc(3,k,2,0,"span",4),e.qZA()}if(2&i){const o=e.oxw();e.Q6J("disabled",o.form.invalid),e.xp6(2),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT)}}function X(i,_){1&i&&e._UZ(0,"p-progressSpinner",45)}let q=(()=>{class i{fb;ns;generalS;constantsS;processInitializersS;authCS;monacoS;instanceS;eventCenterS;generalCS;userS;cd;data;loading={form:!1};EFormMode=l.D;form;subscriptions=[];formData;IEventData=c.F;id;BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptionsProcessInitializer={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(o,a,t,n,d,ee,oe,te,se,ae,ie,ne){this.fb=o,this.ns=a,this.generalS=t,this.constantsS=n,this.processInitializersS=d,this.authCS=ee,this.monacoS=oe,this.instanceS=te,this.eventCenterS=se,this.generalCS=ae,this.userS=ie,this.cd=ne}ngOnInit(){var o=this;return(0,m.Z)(function*(){o.createForm(),o.subscriptions.push(o.data.eventChannel.subscribe(function(){var a=(0,m.Z)(function*(t){if(t)if(o.form.enable(),t.action===c.F.OPEN_FORM_IN_EDIT_MODE)yield o.editViewLoadData(),o.form.get("name").disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_VIEW_MODE)yield o.editViewLoadData(),o.form.disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_ADD_MODE){o.form.reset(),o.form.patchValue(t.data||{});const n=yield o.instanceS.getDefaultContent(o.BE_HOST_PORT,D.R.PROCESS_INITIALIZER).toPromise();o.editorOptionsProcessInitializer={readOnly:!1},o.generalCS.setValueInEditor(o,"editorPI",n.data),o.cd.detectChanges()}});return function(t){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var o=this;return(0,m.Z)(function*(){const a=yield o.processInitializersS.queryOne({find:{guid:o.data.formData.guid,user:o.authCS.gUser._id}});o.form.reset(),o.form.patchValue(a),o.generalCS.setValueInEditor(o,"editorPI",a?.processInitializerCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[r.kI.required]],order:[null,[r.kI.required]],processInitializerTimeoutInMinutes:[null,[]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idProcessInitializerForm").modal("show")},100)}hideModal(){$("#idProcessInitializerForm").modal("hide")}save(){var o=this;return(0,m.Z)(function*(){const a=o.form.getRawValue();let t;t=o.data.formData&&o.data.formData._id?yield o.processInitializersS.queryOne({find:{guid:o.data.formData.guid,user:o.authCS.gUser._id}}):{};const n=Object.assign({},t,a);n.user=o.authCS.getUserId(),n.processInitializerCode=o.editorPI.getValue();try{let d;o.loading.form=!0,o.lastError=void 0,o.monacoS.clearEditorDecorations(o.editorPI,o.monacoDecorations),o.data.mode===l.D.ADD?d=yield o.processInitializersS.post(n).toPromise():o.data.mode===l.D.EDIT&&(d=yield o.processInitializersS.put(n._id,n,{select:I.iH._id}).toPromise()),o.ns.showSuccess(o.data.mode===l.D.ADD?o.constantsS.processInitializer.addSuccess:o.constantsS.processInitializer.editSuccess),o.data.eventChannel.emit({action:o.data.mode===l.D.ADD?c.F.SAVED:c.F.UPDATED,data:d}),o.eventCenterS.processInitializersSavedAndUpdate.next(!0),o.loading.form=!1}catch(d){o.loading.form=!1,o.ns.showErrorFromResponse(d.error||d,"Unable to save process initializer."),o.lastError=d.error,o.tab=o.tab||{},o.tab.axiosResponse={data:d.error},o.monacoS.highlightErrorInMonacoEditor(o.editorPI,o.tab,"MainSandbox.ts",o.monacoDecorations)}o.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=E.H.All,this.insertCodeModalC.showModal(f.b.ProcessInitializersFormC).then()}editorGenerated(o){var a=this;return(0,m.Z)(function*(){a.editorPI=o,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(o,t=>{a.form.valid&&a.save()}),a.monacoS.addInsertCodeKeyBinding(o,t=>{a.generalCS.messageReceivedFor=E.H.All,a.data.mode!==l.D.VIEW&&a.insertCodeModalC.showModal(f.b.ProcessInitializersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(t=>{t.type&&t.type===h.g.TEXT_COPIED&&t.componentName===f.b.ProcessInitializersFormC&&(a.monacoS.insertAtCursor(o,t.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),g.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.processInitializersSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.Y36(r.qu),e.Y36(v.W),e.Y36(M.b),e.Y36(O.L),e.Y36(T.e),e.Y36(A.D),e.Y36(S.b),e.Y36(U.E),e.Y36(Z.u),e.Y36(M.b),e.Y36(F.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-process-initializers-form"]],viewQuery:function(a,t){if(1&a&&(e.Gf(W,5),e.Gf(K,5)),2&a){let n;e.iGM(n=e.CRH())&&(t.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(t.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:32,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idProcessInitializerForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/docs/features/process-initializers.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["class","mt-1px small",4,"ngIf"],["formControlName","order","name","order","spellcheck","false","type","number","placeholder","Please provide order",1,"form-control","form-control-sm"],["formControlName","processInitializerTimeoutInMinutes","name","processInitializerTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm"],[1,"mt-1px","small"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,t){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,N,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return t.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return t.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.YNc(18,V,18,2,"div",4),e.qZA(),e.TgZ(19,"p-tabPanel",15),e.YNc(20,Q,2,2,"div",16),e.qZA()()(),e.TgZ(21,"div",17),e.YNc(22,G,2,0,"a",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return t.hideModal()}),e._UZ(24,"i",20),e._uU(25," Close"),e.qZA(),e.YNc(26,j,4,3,"button",21),e.qZA(),e.YNc(27,X,1,0,"p-progressSpinner",22),e.qZA()()(),e._UZ(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&a&&(e.xp6(4),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.lastError),e.xp6(4),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysProcessInitializer")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[r._Y,r.Fj,r.wV,r.JJ,r.JL,r.sg,r.u,z.O5,b.y,R.P,y.O,x.G,P.xf,P.x4,L.u,B.A],encapsulation:2,changeDetection:0})}return i})()},56236:(C,u,s)=>{s.d(u,{e:()=>I});var m=s(17017),c=(s(34491),s(44950)),l=s(94946);let I=(()=>{class p{static \u0275fac=function(f){return new(f||p)};static \u0275mod=l.oAB({type:p});static \u0275inj=l.cJS({imports:[m.u,c.A]})}return p})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6236],{34491:(C,u,s)=>{s.d(u,{g:()=>q});var m=s(15861),r=s(60095),c=s(33157),l=s(90328),E=s(59361),I=s(51162),p=s(20553),D=s(45085),g=s(91601),f=s(3531),h=s(39989),e=s(94946),v=s(99961),M=s(77240),O=s(27414),T=s(62694),A=s(95852),S=s(45809),U=s(53429),Z=s(32915),F=s(33835),z=s(96814),b=s(32660),R=s(5860),y=s(756),x=s(97680),P=s(14844),L=s(33259),B=s(25025);const W=["insertCodeModalC"],K=["monacoEditorModalC"];function N(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Add Process Initializer"),e.qZA())}function J(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," View Process Initializer"),e.qZA())}function Y(i,_){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," Edit Process Initializer "),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(4),e.Oqu(o.form.get("name").value)}}function w(i,_){1&i&&(e.TgZ(0,"span",39),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function V(i,_){if(1&i&&(e.TgZ(0,"div")(1,"form",31)(2,"div",32)(3,"label",33),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",34),e._UZ(6,"input",35),e.YNc(7,w,2,0,"span",36),e.qZA()(),e.TgZ(8,"div",32)(9,"label",33),e._uU(10,"Order"),e.qZA(),e.TgZ(11,"div",34),e._UZ(12,"input",37),e.qZA()(),e.TgZ(13,"div",32)(14,"label",33),e._uU(15,"Timeout in minutes"),e.qZA(),e.TgZ(16,"div",34),e._UZ(17,"input",38),e.qZA()()()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("formGroup",o.form),e.xp6(6),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD)}}function Q(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"div",40)(1,"app-monaco-editor",41),e.NdJ("editorGenerated",function(t){e.CHM(o);const n=e.oxw();return e.KtG(n.editorGenerated(t))}),e.qZA()()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",o.editorOptionsProcessInitializer)}}function G(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"a",42),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function k(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function j(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.save())}),e._UZ(1,"i",44),e.YNc(2,H,2,0,"span",4),e.YNc(3,k,2,0,"span",4),e.qZA()}if(2&i){const o=e.oxw();e.Q6J("disabled",o.form.invalid),e.xp6(2),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT)}}function X(i,_){1&i&&e._UZ(0,"p-progressSpinner",45)}let q=(()=>{class i{fb;ns;generalS;constantsS;processInitializersS;authCS;monacoS;instanceS;eventCenterS;generalCS;userS;cd;data;loading={form:!1};EFormMode=l.D;form;subscriptions=[];formData;IEventData=c.F;id;BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptionsProcessInitializer={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(o,a,t,n,d,ee,oe,te,se,ae,ie,ne){this.fb=o,this.ns=a,this.generalS=t,this.constantsS=n,this.processInitializersS=d,this.authCS=ee,this.monacoS=oe,this.instanceS=te,this.eventCenterS=se,this.generalCS=ae,this.userS=ie,this.cd=ne}ngOnInit(){var o=this;return(0,m.Z)(function*(){o.createForm(),o.subscriptions.push(o.data.eventChannel.subscribe(function(){var a=(0,m.Z)(function*(t){if(t)if(o.form.enable(),t.action===c.F.OPEN_FORM_IN_EDIT_MODE)yield o.editViewLoadData(),o.form.get("name").disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_VIEW_MODE)yield o.editViewLoadData(),o.form.disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_ADD_MODE){o.form.reset(),o.form.patchValue(t.data||{});const n=yield o.instanceS.getDefaultContent(o.BE_HOST_PORT,D.R.PROCESS_INITIALIZER).toPromise();o.editorOptionsProcessInitializer={readOnly:!1},o.generalCS.setValueInEditor(o,"editorPI",n.data),o.cd.detectChanges()}});return function(t){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var o=this;return(0,m.Z)(function*(){const a=yield o.processInitializersS.queryOne({find:{guid:o.data.formData.guid,user:o.authCS.gUser._id}});o.form.reset(),o.form.patchValue(a),o.generalCS.setValueInEditor(o,"editorPI",a?.processInitializerCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[r.kI.required]],order:[null,[r.kI.required]],processInitializerTimeoutInMinutes:[null,[]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idProcessInitializerForm").modal("show")},100)}hideModal(){$("#idProcessInitializerForm").modal("hide")}save(){var o=this;return(0,m.Z)(function*(){const a=o.form.getRawValue();let t;t=o.data.formData&&o.data.formData._id?yield o.processInitializersS.queryOne({find:{guid:o.data.formData.guid,user:o.authCS.gUser._id}}):{};const n=Object.assign({},t,a);n.user=o.authCS.getUserId(),n.processInitializerCode=o.editorPI.getValue();try{let d;o.loading.form=!0,o.lastError=void 0,o.monacoS.clearEditorDecorations(o.editorPI,o.monacoDecorations),o.data.mode===l.D.ADD?d=yield o.processInitializersS.post(n).toPromise():o.data.mode===l.D.EDIT&&(d=yield o.processInitializersS.put(n._id,n,{select:I.iH._id}).toPromise()),o.ns.showSuccess(o.data.mode===l.D.ADD?o.constantsS.processInitializer.addSuccess:o.constantsS.processInitializer.editSuccess),o.data.eventChannel.emit({action:o.data.mode===l.D.ADD?c.F.SAVED:c.F.UPDATED,data:d}),o.eventCenterS.processInitializersSavedAndUpdate.next(!0),o.loading.form=!1}catch(d){o.loading.form=!1,o.ns.showErrorFromResponse(d.error||d,"Unable to save process initializer."),o.lastError=d.error,o.tab=o.tab||{},o.tab.axiosResponse={data:d.error},o.monacoS.highlightErrorInMonacoEditor(o.editorPI,o.tab,"MainSandbox.ts",o.monacoDecorations)}o.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=E.H.All,this.insertCodeModalC.showModal(f.b.ProcessInitializersFormC).then()}editorGenerated(o){var a=this;return(0,m.Z)(function*(){a.editorPI=o,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(o,t=>{a.form.valid&&a.save()}),a.monacoS.addInsertCodeKeyBinding(o,t=>{a.generalCS.messageReceivedFor=E.H.All,a.data.mode!==l.D.VIEW&&a.insertCodeModalC.showModal(f.b.ProcessInitializersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(t=>{t.type&&t.type===h.g.TEXT_COPIED&&t.componentName===f.b.ProcessInitializersFormC&&(a.monacoS.insertAtCursor(o,t.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),g.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.processInitializersSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.Y36(r.qu),e.Y36(v.W),e.Y36(M.b),e.Y36(O.L),e.Y36(T.e),e.Y36(A.D),e.Y36(S.b),e.Y36(U.E),e.Y36(Z.u),e.Y36(M.b),e.Y36(F.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-process-initializers-form"]],viewQuery:function(a,t){if(1&a&&(e.Gf(W,5),e.Gf(K,5)),2&a){let n;e.iGM(n=e.CRH())&&(t.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(t.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:32,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idProcessInitializerForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/docs/features/process-initializers.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["class","mt-1px small",4,"ngIf"],["formControlName","order","name","order","spellcheck","false","type","number","placeholder","Please provide order",1,"form-control","form-control-sm"],["formControlName","processInitializerTimeoutInMinutes","name","processInitializerTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm"],[1,"mt-1px","small"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,t){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,N,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return t.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return t.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.YNc(18,V,18,2,"div",4),e.qZA(),e.TgZ(19,"p-tabPanel",15),e.YNc(20,Q,2,2,"div",16),e.qZA()()(),e.TgZ(21,"div",17),e.YNc(22,G,2,0,"a",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return t.hideModal()}),e._UZ(24,"i",20),e._uU(25," Close"),e.qZA(),e.YNc(26,j,4,3,"button",21),e.qZA(),e.YNc(27,X,1,0,"p-progressSpinner",22),e.qZA()()(),e._UZ(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&a&&(e.xp6(4),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.lastError),e.xp6(4),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysProcessInitializer")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[r._Y,r.Fj,r.wV,r.JJ,r.JL,r.sg,r.u,z.O5,b.y,R.P,y.O,x.G,P.xf,P.x4,L.u,B.A],encapsulation:2,changeDetection:0})}return i})()},56236:(C,u,s)=>{s.d(u,{e:()=>I});var m=s(17017),c=(s(34491),s(44950)),l=s(94946);let I=(()=>{class p{static \u0275fac=function(f){return new(f||p)};static \u0275mod=l.oAB({type:p});static \u0275inj=l.cJS({imports:[m.u,c.A]})}return p})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6393],{66393:(ne,U,i)=>{i.r(U),i.d(U,{AdminUserM:()=>se});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),Z=i(77240),A=i(99961),y=i(85219),M=i(92189),T=i(90204),P=i(32915),g=i(96814),S=i(95431),_=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",24),e._uU(2," Add User"),e.qZA())}function Q(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," View User"),e.qZA())}function k(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," Edit User"),e.qZA())}function V(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",27),e.qZA()())}function q(n,l){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function G(n,l){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function W(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,q,2,0,"span",4),e.YNc(3,G,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 K(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("active").setValue(!0),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(A.W),e.Y36(C.K),e.Y36(Z.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:39,vars:7,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,"col-6","d-flex","align-items-center"],["formControlName","active"],[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"],["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,V,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.TgZ(28,"div",10)(29,"label",11),e._uU(30,"Active"),e.qZA(),e.TgZ(31,"div",17),e._UZ(32,"p-inputSwitch",18),e.qZA()()()(),e.TgZ(33,"div",19)(34,"button",20),e._UZ(35,"i",21),e._uU(36," Close"),e.qZA(),e.YNc(37,W,4,3,"button",22),e.qZA(),e.YNc(38,K,1,0,"p-progressSpinner",23),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(15),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,_.G,Y.Ql],encapsulation:2})}return n})();const H=["adminUserFormC"];function L(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 B(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 j(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 X(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 z(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,ae){this.userS=t,this.generalS=s,this.notificationS=a,this.confirmationService=r,this.navigationCS=d,this.constantsCS=v,this.eventCenterS=ae}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(Z.b),e.Y36(A.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(H,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,L,2,0,"span",5),e.YNc(8,B,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,j,9,0,"ng-template",9),e.YNc(12,X,9,6,"ng-template",10),e.qZA(),e.YNc(13,z,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,S.iA,y.jx,S.Ei,_.G,N.u,w],encapsulation:2})}return n})();const te=[{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 se=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[b.Bz.forChild(te),E.u]})}return n})()}}]);
@@ -1 +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})()}}]);
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(45809),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(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,d=e.oxw();return e.KtG(d.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,d=e.oxw();return e.KtG(d.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,d,m){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=a,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 a;n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentAllowedOriginConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,r.Z)(function*(){yield n.removeAO(t,i)}),function(){return a.apply(this,arguments)})})})()}removeAO(t,i){var n=this;return(0,r.Z)(function*(){const a=n.allowedOriginsGridData.findIndex(d=>d.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(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: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(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 o})();const B=["addNpmLibC"],j=["allowedOriginC"],W=["SandboxSettingsPkgVersionsModalC"];function z(o,l){1&o&&(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(o,l){1&o&&e._UZ(0,"i",64)}function ee(o,l){1&o&&e._UZ(0,"i",65)}function te(o,l){if(1&o&&(e.TgZ(0,"div",67),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",66),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",68)}function oe(o,l){1&o&&e._UZ(0,"i",68)}function ae(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",61)(1,"button",69),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.editData(n,a))}),e._UZ(2,"i",70),e.qZA(),e.TgZ(3,"button",71),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.removePermanentDialog(n,a))}),e._UZ(4,"i",72),e.qZA()()}}function se(o,l){if(1&o&&(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,oe,1,0,"i",62),e.qZA(),e.TgZ(17,"td"),e.YNc(18,ae,5,0,"div",63),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",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(o,l){1&o&&e._UZ(0,"i",68)}function re(o,l){1&o&&e._UZ(0,"i",68)}function ce(o,l){if(1&o&&(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&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",74)}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,"div",18)(19,"input",19),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.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 a=e.oxw();return e.KtG(a.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 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(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 a=e.oxw();return e.KtG(a.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 a=e.oxw();return e.KtG(a.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&o){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 o{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,a,d,m,ue,_e,Se,ve,xe){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=a,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,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,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 a={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,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,r.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,r.Z)(function*(){yield n.removePermanent(i)}),function(){return a.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:a}=(yield t.instanceS.getInstalledPackagesAndSchemas().toPromise()).data;t.tpNpmPackageAndVersion=i,t.tpApiBundleIdMap=n,t.tpApiVersionIdMap=a})()}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&&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(a=>a.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||o)(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: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,"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 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,_.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 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})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7470],{92883:(v,P,a)=>{a.d(P,{c:()=>C});var c=a(94946),p=a(53300);let C=(()=>{class n{hideCodeFinderModel=new c.vpe;loading={form:!1,response:!1};constructor(){}ngOnInit(){}showModal(){$("#idCodeFinder").modal("show")}hideModal(){$("#idCodeFinder").modal("hide")}hideModalEvent(){this.hideCodeFinderModel.emit(!0)}ngOnDestroy(){}static \u0275fac=function(d){return new(d||n)};static \u0275cmp=c.Xpm({type:n,selectors:[["app-code-finder-modal"]],outputs:{hideCodeFinderModel:"hideCodeFinderModel"},decls:8,vars:1,consts:[["id","idCodeFinder","role","dialog","data-backdrop","static","data-keyboard","false",1,"pt-1","pl-1","pr-1","overflow-auto","modal","parent-notes-modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content","border-0"],["aria-label","Close","type","button",1,"close","position-absolute",2,"top","0.25rem","right","0.5rem","z-index","1",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close","m-1"],[1,"modal-body","p-0"],[3,"modalId"]],template:function(d,b){1&d&&(c.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),c.NdJ("click",function(){return b.hideModalEvent()}),c.TgZ(4,"span",4),c._UZ(5,"i",5),c.qZA()(),c.TgZ(6,"div",6),c._UZ(7,"app-code-finder-w",7),c.qZA()()()()),2&d&&(c.xp6(7),c.Q6J("modalId","idCodeFinder"))},dependencies:[p.k],encapsulation:2,changeDetection:0})}return n})()},365:(v,P,a)=>{a.d(P,{n:()=>xe});var c=a(15861),p=a(6990),n=a(11440),O=a(51162),A=a(20553),d=a(45085),b=a(91601),j=a(3531),M=a(39989),S=a(22583),e=a(94946),T=a(77240),E=a(27414),U=a(45809),f=a(95852),y=a(67629),D=a(31042),l=a(90602),m=a(10262),r=a(62694),h=a(12559),_=a(25394),u=a(79448),x=a(3366),N=a(93645),F=a(45800),B=a(56457),H=a(67145),L=a(99961),J=a(32915),K=a(81344),k=a(56233),Y=a(60115),W=a(61252),Q=a(39530),w=a(99729),q=a(26125),V=a(90204),Z=a(96814),G=a(5860),z=a(756),X=a(33259),ee=a(25025);const oe=["insertCodeModalC"],te=["monacoEditorModalC"];function se(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.qZA(),e.TgZ(11,"span",16),e._uU(12),e.qZA(),e.TgZ(13,"span",17),e._uU(14),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ie(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ae(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",16),e._uU(8),e.qZA(),e.TgZ(9,"span",17),e._uU(10),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ne(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",16),e._uU(10),e.qZA(),e.TgZ(11,"span",17),e._uU(12),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function de(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",15),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function re(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",15),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ce(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function _e(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function pe(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function le(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",19),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function Ce(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",21),e._uU(4),e.qZA(),e.TgZ(5,"span",22),e._uU(6),e.qZA(),e.TgZ(7,"span",20),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.eventName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.eventListenersName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function Oe(i,g){if(1&i&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.hij(" \u2192 ",o.codeObj.name,"")}}function ue(i,g){if(1&i&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.Oqu(o.codeObj.hookType)}}function ge(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",23),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA(),e.YNc(7,Oe,2,1,"span",24),e.YNc(8,ue,2,1,"span",25),e.qZA()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.customApiName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":""),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType)}}function he(i,g){if(1&i&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.hij(" \u2192 ",o.codeObj.name,"")}}function me(i,g){if(1&i&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.Oqu(o.codeObj.hookType)}}function Se(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",26),e._uU(4),e.qZA(),e.TgZ(5,"span",27),e._uU(6),e.qZA(),e.TgZ(7,"span",28),e._uU(8),e.qZA(),e.TgZ(9,"span",20),e._uU(10),e.qZA(),e.YNc(11,he,2,1,"span",24),e.YNc(12,me,2,1,"span",25),e.qZA()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.bundleName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.apiVersion),e.xp6(2),e.hij("",o.codeObj.apiName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":""),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType)}}function Te(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",29),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.utilityClassName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function Ee(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function fe(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Ie(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",31),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Ae(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiId," ")}}function ye(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",26),e._uU(4),e.qZA(),e.TgZ(5,"span",27),e._uU(6),e.qZA(),e.TgZ(7,"span",28),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.bundleName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiVersion," \u2192 "),e.xp6(2),e.hij("",o.codeObj.name," ")}}function Pe(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function be(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function je(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function Me(i,g){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Ue(i,g){if(1&i&&(e.TgZ(0,"span",38),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.Q6J("pTooltip",o.matchFound+" match found in this file."),e.xp6(1),e.Oqu(o.matchFound)}}function Re(i,g){if(1&i){const o=e.EpF();e.TgZ(0,"a",39),e.NdJ("click",function(){e.CHM(o);const s=e.oxw(2);return e.KtG(s.viewError())}),e._uU(1,"View error"),e.qZA()}}const ve=function(){return{"margin-right":"30px"}},De=function(){return{}};function Ze(i,g){if(1&i){const o=e.EpF();e.TgZ(0,"span")(1,"span",32),e.NdJ("click",function(){e.CHM(o);const s=e.oxw();return e.KtG(s.saveData())}),e._UZ(2,"i",33),e._uU(3,"Save "),e.qZA(),e.TgZ(4,"span",34),e.NdJ("click",function(){e.CHM(o);const s=e.oxw();return e.KtG(s.toggleResponseTab())}),e._UZ(5,"i",35),e.qZA(),e.YNc(6,Ue,2,2,"span",36),e.YNc(7,Re,2,0,"a",37),e.qZA()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("ngStyle",o.modalId?e.DdM(3,ve):e.DdM(4,De)),e.xp6(5),e.Q6J("ngIf",o.matchFound),e.xp6(1),e.Q6J("ngIf",o.lastError)}}let xe=(()=>{class i{generalCS;constantsS;monacoS;authCS;functionS;schedulerS;dbMigrationS;webSocketEventsS;processInitializersS;tpInstalledApisS;instanceApiSettingsS;instanceApiHooksS;instanceHooksS;databaseHooksS;collectionHooksS;systemApiSettingsS;amEventS;ns;eventCenterS;feStoreCS;i18nS;secretS;tpApiSettingsS;schemaS;dbMastersS;uiMakerUtilsS;constantsCS;cd;modalId;DOCS_HOST_PORT=A.N.DOCS_HOST_PORT;loading={grid:!1};subscriptions=[];editorCodeFinder;editorOptionsEditorCodeFinder={readOnly:!1,language:b.d.typescript,contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};gridKey=O.iH._id;BE_HOST_PORT=A.N.BE_HOST_PORT;EAPICategory=d.R;codeObj={};monacoDecorations=[];tab;insertCodeModalC;viewDockerfileModelC;lastCodeFinderObject={};matchFound=0;constructor(o,t,s,I,R,Ne,Fe,Be,He,Le,Je,Ke,ke,Ye,We,Qe,we,qe,Ve,Ge,$e,ze,Xe,eo,oo,to,so,io){this.generalCS=o,this.constantsS=t,this.monacoS=s,this.authCS=I,this.functionS=R,this.schedulerS=Ne,this.dbMigrationS=Fe,this.webSocketEventsS=Be,this.processInitializersS=He,this.tpInstalledApisS=Le,this.instanceApiSettingsS=Je,this.instanceApiHooksS=Ke,this.instanceHooksS=ke,this.databaseHooksS=Ye,this.collectionHooksS=We,this.systemApiSettingsS=Qe,this.amEventS=we,this.ns=qe,this.eventCenterS=Ve,this.feStoreCS=Ge,this.i18nS=$e,this.secretS=ze,this.tpApiSettingsS=Xe,this.schemaS=eo,this.dbMastersS=oo,this.uiMakerUtilsS=to,this.constantsCS=so,this.cd=io}ngOnInit(){this.subscriptions.push(this.eventCenterS.codeFinderResult.subscribe(o=>{if(o.length){this.codeObj=o[0],p.isEmpty(this.lastCodeFinderObject)||this.getBackupOfMonacoEditor(this.lastCodeFinderObject),this.lastCodeFinderObject=this.codeObj,this.generalCS.setValueInEditor(this,"editorCodeFinder",this.codeObj?.apiCodeStr),this.restoreBackupOfMonacoEditor(this.lastCodeFinderObject);const t=this.findMatchesInEditor(o[0].searchKeyWord);this.lastCodeFinderObject.cursorPosition={lineNumber:t[0]?.range?.startLineNumber,column:t[0]?.range?.startColumn},this?.lastCodeFinderObject?.cursorPosition?.lineNumber&&this.editorCodeFinder.setPosition(this?.lastCodeFinderObject?.cursorPosition),t[0]?.range?.startLineNumber&&this.editorCodeFinder.revealLineInCenter(t[0]?.range?.startLineNumber),t[0]?.range&&this.editorCodeFinder.revealRange(t[0].range,S.Up.REVEAL_RANGE_CENTER_IF_OUTSIDE_VIEWPORT),this.editorCodeFinder.deltaDecorations(this.monacoDecorations,[]),this.monacoDecorations=[];for(const s of t)if(this.editorCodeFinder){const R=this.editorCodeFinder.deltaDecorations([],[{range:{startLineNumber:s?.range?.startLineNumber,startColumn:s?.range?.startColumn,endLineNumber:s?.range?.endLineNumber,endColumn:s?.range?.endColumn},options:{inlineClassName:"highlightMatchedWord"}}]);this.monacoDecorations.push(...R)}this.matchFound=this.monacoDecorations.length,this.editorCodeFinder.focus()}else this.resetCodeObj();this.lastError=void 0,this.cd.detectChanges()}))}getBackupOfMonacoEditor(o){o.viewState=this.editorCodeFinder.saveViewState()}restoreBackupOfMonacoEditor(o){o.viewState&&this.editorCodeFinder.restoreViewState(o.viewState),o.cursorPosition?.lineNumber?this.editorCodeFinder.setPosition(o.cursorPosition):(o.cursorPosition={lineNumber:S.Up.DEFAULT_LINE_NUMBER,column:S.Up.DEFAULT_COLUMN_NUMBER},this.editorCodeFinder.setPosition(o.cursorPosition),this.editorCodeFinder.setScrollTop(0),this.editorCodeFinder.setScrollLeft(0)),this.editorCodeFinder.focus()}findMatchesInEditor(o){const t=(o||"").trim();if(!t||!this.editorCodeFinder)return[];const s=this.editorCodeFinder.getModel();if(s&&"function"==typeof s.findMatches){const I=s.findMatches(t,!0,!1,!1,null,!0);if(Array.isArray(I))return I}return[]}editorGenerated(o){var t=this;return(0,c.Z)(function*(){t.editorCodeFinder=o,yield t.monacoS.loadSchemaEditorSettings(t.BE_HOST_PORT,t.authCS.getUserId(),null),t.monacoS.addSaveCodeKeyBinding(o,s=>{t.codeObj&&t.saveData()}),t.editorCodeFinder.onDidChangeCursorPosition(s=>{t.lastCodeFinderObject&&1!==s.position.lineNumber&&1!==s.position.column&&(t.lastCodeFinderObject.cursorPosition=s.position)}),t.monacoS.addInsertCodeKeyBinding(o,s=>{(t.codeObj.apiCategory===d.R.INSTANCES||t.codeObj.apiCategory===d.R.THIRD_PARTY_APIS||t.codeObj.apiCategory===d.R.CUSTOM_APIS||t.codeObj.apiCategory===d.R.SYSTEM_APIS||t.codeObj.apiCategory===d.R.EVENTS||t.codeObj.apiCategory===d.R.SCHEDULERS||t.codeObj.apiCategory===d.R.UTILITY_CLASS||t.codeObj.apiCategory===d.R.MIGRATION_SCRIPT||t.codeObj.apiCategory===d.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE||t.codeObj.apiCategory===d.R.PROCESS_INITIALIZER||t.codeObj.apiCategory===d.R.INSTANCE_API_HOOKS_JSON||t.codeObj.apiCategory!==d.R.I18N_JSON&&t.codeObj.apiCategory!==d.R.SECRET_JSON&&t.codeObj.apiCategory!==d.R.INSTANCE_API_SETTINGS_JSON&&t.codeObj.apiCategory!==d.R.THIRD_PARTY_API_SETTINGS_JSON&&t.codeObj.apiCategory!==d.R.SCHEMA_JSON&&t.codeObj.apiCategory!==d.R.SYSTEM_API_SETTINGS_JSON)&&t.insertCodeModalC.showModal(j.b.CodeFinderResultC)}),t.subscriptions.push(t.generalCS.messageReceived.subscribe(s=>{s.type&&s.type===M.g.TEXT_COPIED&&s.componentName===j.b.CodeFinderResultC&&(t.monacoS.insertAtCursor(o,s.selectedText),t.insertCodeModalC.hideModal())})),t.monacoS.addToggleCodeKeyBinding(o,s=>{t.toggleResponseTab(),t.layout.cd.detectChanges(),t.cd.detectChanges()})})()}layout;saveData(){var o=this;return(0,c.Z)(function*(){o.monacoS.clearEditorDecorations(o.editorCodeFinder,o.monacoDecorations),yield o.customApisUpdateData(),yield o.schedulerApisUpdateData(),yield o.dbMigrationUpdateData(),yield o.webSocketNotificationUpdateData(),yield o.processInitializerUpdateData(),yield o.amEventsUpdateData(),yield o.tpApisUpdateData(),yield o.instanceApisSettingUpdateData(),yield o.instanceApisHooksUpdateData(),yield o.instanceHooksUpdateData(),yield o.databaseHooksUpdateData(),yield o.collectionHooksUpdateData(),yield o.sysApisSettingUpdateData(),yield o.utilityClassesUpdateData(),yield o.i18nUpdateData(),yield o.secretsUpdateData(),yield o.tpApiSettingUpdateData(),yield o.schemaUpdateData(),yield o.dbMasterUpdateData(),yield o.dbMasterUpdateJSUtilsData(),yield o.uiMakerUtilityUpdateData(),o.cd.detectChanges()})()}customApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.CUSTOM_APIS)try{const t=(yield o.functionS.getById(o.codeObj._id).toPromise()).data;o.setEditorValueInCodeOrHook(t.versions),yield o.functionS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.functions.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}if(o.codeObj.apiCategory===d.R.CUSTOM_API_JSON)try{const t=(yield o.functionS.getById(o.codeObj._id).toPromise()).data,s={_id:t._id,functionBasicInfo:o.editorCodeFinder.getValue()};yield o.functionS.put(t._id,s,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.functions.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}schedulerApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.SCHEDULERS)try{const t=(yield o.schedulerS.getById(o.codeObj._id).toPromise()).data;o.setEditorValueInCodeOrHook(t.versions),yield o.schedulerS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.schedulers.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}dbMigrationUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.MIGRATION_SCRIPT)try{const t=(yield o.dbMigrationS.getById(o.codeObj._id).toPromise()).data;t.dbMigrationScriptCode=o.editorCodeFinder.getValue(),yield o.dbMigrationS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.dbMigration.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}webSocketNotificationUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE)try{const t=(yield o.webSocketEventsS.getById(o.codeObj._id).toPromise()).data;o.getVersionObject(t.versions,o.codeObj.version).apiCodeStr=o.editorCodeFinder.getValue(),yield o.webSocketEventsS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.webSocketEvents.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}processInitializerUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.PROCESS_INITIALIZER)try{const t=(yield o.processInitializersS.getById(o.codeObj._id).toPromise()).data;t.processInitializerCode=o.editorCodeFinder.getValue(),yield o.processInitializersS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.processInitializer.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}amEventsUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.EVENTS)try{const t=(yield o.amEventS.getById(o.codeObj._id).toPromise()).data;for(const s of t.eventListeners)s._id===o.codeObj.eventListenersId&&s.name===o.codeObj.eventListenersName&&o.setEditorValueInCodeOrHook(s.versions);yield o.amEventS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.amEventListeners.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}tpApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.THIRD_PARTY_APIS)try{const t=(yield o.tpInstalledApisS.getById(o.codeObj._id).toPromise()).data;o.setEditorValueInCodeOrHook(t.versions),yield o.tpInstalledApisS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}instanceApisSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.INSTANCE_API_SETTINGS_JSON)try{const t=(yield o.instanceApiSettingsS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.INSTANCE_API_SETTINGS_JSON&&(t.instanceApiSettingCode=o.editorCodeFinder.getValue()),yield o.instanceApiSettingsS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}instanceApisHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.INSTANCE_API_HOOKS_JSON)try{const t=(yield o.instanceApiHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.INSTANCE_API_HOOKS_JSON&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceApiHooksS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}instanceHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.INSTANCE_HOOKS)try{const t=(yield o.instanceApiHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.INSTANCE_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceHooksS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}databaseHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.DATABASE_HOOKS)try{const t=(yield o.databaseHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.DATABASE_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.databaseHooksS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}collectionHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.COLLECTION_HOOKS)try{const t=(yield o.collectionHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.COLLECTION_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.collectionHooksS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}sysApisSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.SYSTEM_APIS||o.codeObj.apiCategory===d.R.SYSTEM_API_SETTINGS_JSON)try{const t=(yield o.systemApiSettingsS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.SYSTEM_API_SETTINGS_JSON&&(t.sysApiSettingCode=o.editorCodeFinder.getValue()),o.codeObj.apiCategory===d.R.SYSTEM_APIS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.systemApiSettingsS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}utilityClassesUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.UTILITY_CLASS)try{const t=(yield o.feStoreCS.getByIdUtilityClasses(o.BE_HOST_PORT,o.codeObj._id).toPromise()).data;o.setEditorValueInCodeOrHook(t.versions),yield o.feStoreCS.putUtilityClasses(o.BE_HOST_PORT,t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsCS.utilityClassesS.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}i18nUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.I18N_JSON)try{const t=(yield o.i18nS.getById(o.codeObj._id).toPromise()).data;t.keysCode=o.editorCodeFinder.getValue(),yield o.i18nS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.i18n.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}secretsUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.SECRET_JSON)try{const t=(yield o.secretS.getById(o.codeObj._id).toPromise()).data;t.keysCode=o.editorCodeFinder.getValue(),t.keysCode=o.generalCS.getEncryptedString(t.keysCode,A.N.crypto.passCommunication),yield o.secretS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsCS.secret.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}tpApiSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.THIRD_PARTY_API_SETTINGS_JSON)try{const t=(yield o.tpApiSettingsS.getById(o.codeObj._id).toPromise()).data;t.thirdPartyApiSettingsCode=o.editorCodeFinder.getValue(),yield o.tpApiSettingsS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.tpApiSettings.addOrUpdateSuccess)}catch(t){o.catchErrorCommon(t)}})()}schemaUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.SCHEMA_JSON)try{const t=(yield o.schemaS.getById(o.codeObj._id).toPromise()).data;t.propertiesCode=o.editorCodeFinder.getValue(),yield o.schemaS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("Schema updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}dbMasterUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.DB_MASTERS_JSON)try{const t=(yield o.dbMastersS.getById(o.codeObj._id).toPromise()).data;t.dbMasterConfigCode=o.editorCodeFinder.getValue(),o.codeObj[n.nA.dbMasterConfigCode]=t.dbMasterConfigCode,yield o.dbMastersS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("DB Master updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}dbMasterUpdateJSUtilsData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.DB_MASTERS_JS_UTILS)try{const t=(yield o.dbMastersS.getById(o.codeObj._id).toPromise()).data;t.pageUtilsCode=o.editorCodeFinder.getValue(),o.codeObj[n.nA.pageUtilsCode]=t.pageUtilsCode,yield o.dbMastersS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("DB Master utils updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}uiMakerUtilityUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.UI_MAKER_UTILITY_CLASS)try{const t=(yield o.uiMakerUtilsS.getById(o.codeObj._id).toPromise()).data;t.utilsCode=o.editorCodeFinder.getValue(),o.codeObj[n.Kr.utilsCode]=t.utilsCode,yield o.uiMakerUtilsS.put(t._id,t,{select:O.iH._id}).toPromise(),o.ns.showSuccess("UI Maker utility updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}setEditorValueInCodeOrHook(o){const t=this.getVersionObject(o,this.codeObj.version);this.codeObj.hookType?(this.codeObj.apiCategory===d.R.CUSTOM_APIS||this.codeObj.apiCategory===d.R.THIRD_PARTY_APIS||this.codeObj.apiCategory===d.R.SCHEDULERS||this.codeObj.apiCategory===d.R.UTILITY_CLASS||this.codeObj.apiCategory===d.R.EVENTS)&&this.prePostHooksCodeCommon(t):t.apiCodeStr=this.editorCodeFinder.getValue()}getVersionObject(o,t){for(const s of o)if(s.version===t)return s}prePostHooksCodeCommon(o){for(const t of o.preHooks)t.name===this.codeObj.name&&t._id===this.codeObj.preHookId&&"Pre Hook"===this.codeObj.hookType&&(t.hookCode=this.editorCodeFinder.getValue());for(const t of o.postHooks)t.name===this.codeObj.name&&t._id===this.codeObj.postHookId&&"Post Hook"===this.codeObj.hookType&&(t.hookCode=this.editorCodeFinder.getValue())}resetCodeObj(){this.codeObj={},this.editorCodeFinder.setValue("")}catchErrorCommon(o){this.ns.showErrorMessageFromErrorObject(o),this.lastError=o.error,this.tab=this.tab||{},this.tab.axiosResponse={data:o.error},this.monacoS.highlightErrorInMonacoEditor(this.editorCodeFinder,this.tab,"MainSandbox.ts",this.monacoDecorations)}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),b.d.json)}isResponseCollapsed=!1;toggleResponseTab(){this.isResponseCollapsed=!this.isResponseCollapsed,this.layout.isResponseCollapsed=!this.layout.isResponseCollapsed}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(t){return new(t||i)(e.Y36(T.b),e.Y36(E.L),e.Y36(U.b),e.Y36(f.D),e.Y36(y.d),e.Y36(D.Z),e.Y36(l.j),e.Y36(m.a),e.Y36(r.e),e.Y36(h.d),e.Y36(_.f),e.Y36(u.S),e.Y36(x.Q),e.Y36(N.y),e.Y36(F.l),e.Y36(B.J),e.Y36(H.l),e.Y36(L.W),e.Y36(J.u),e.Y36(K.e),e.Y36(k.q),e.Y36(Y.e),e.Y36(W.G),e.Y36(Q.$),e.Y36(w.z),e.Y36(q.L),e.Y36(V.s),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-code-finder-result"]],viewQuery:function(t,s){if(1&t&&(e.Gf(oe,5),e.Gf(te,5)),2&t){let I;e.iGM(I=e.CRH())&&(s.insertCodeModalC=I.first),e.iGM(I=e.CRH())&&(s.viewDockerfileModelC=I.first)}},inputs:{modalId:"modalId"},decls:34,vars:32,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header","font-weight-normal"],[2,"font-size","small"],[1,"fas","fa-list-alt","text-yellow","fa-fw","mr-1"],[4,"ngIf"],[1,"overflow-hidden","h-100"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["tooltipPosition","top",3,"pTooltip"],["pTooltip","Instances","tooltipPosition","top",1,"pl-1"],["pTooltip","Databases","tooltipPosition","top",1,"pl-1"],["pTooltip","Collections","tooltipPosition","top",1,"pl-1"],["pTooltip","API","tooltipPosition","top",1,"pl-1"],["pTooltip","Hook Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Hook Type","tooltipPosition","top",1,"pl-1","small","text-secondary"],["pTooltip","Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Schedulers Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Version","tooltipPosition","top",1,"pl-1","small","text-secondary"],["pTooltip","Event Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Listener Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Custom API Name","tooltipPosition","top",1,"pl-1"],["class","pl-1","pTooltip","Hook Name","tooltipPosition","top",4,"ngIf"],["class","pl-1 small text-secondary","pTooltip","Hook Type","tooltipPosition","top",4,"ngIf"],["pTooltip","Library","tooltipPosition","top",1,"pl-1"],["pTooltip","API Versions","tooltipPosition","top",1,"pl-1"],["pTooltip","API Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Utility Class Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Secret Name","tooltipPosition","top",1,"pl-1"],["pTooltip","System Api Name","tooltipPosition","top",1,"pl-1"],[1,"float-right","cursor-pointer",3,"ngStyle","click"],[1,"fas","fa-save","text-success","fa-fw"],["pTooltip","Toggle response panel","tooltipPosition","left",1,"float-right","cursor-pointer","mr-2",3,"click"],[1,"fas","fa-window-maximize","text-warning","fa-fw","fa-rotate-90"],["class","mr-2 font-weight-bold float-right matchCircle",3,"pTooltip",4,"ngIf"],["href","javascript:;","class","text-danger float-right mr-2",3,"click",4,"ngIf"],[1,"mr-2","font-weight-bold","float-right","matchCircle",3,"pTooltip"],["href","javascript:;",1,"text-danger","float-right","mr-2",3,"click"]],template:function(t,s){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span",2),e._UZ(3,"i",3),e.YNc(4,se,15,8,"span",4),e.YNc(5,ie,9,5,"span",4),e.YNc(6,ae,11,6,"span",4),e.YNc(7,ne,13,7,"span",4),e.YNc(8,de,9,5,"span",4),e.YNc(9,re,9,5,"span",4),e.YNc(10,ce,5,3,"span",4),e.YNc(11,_e,5,3,"span",4),e.YNc(12,pe,5,3,"span",4),e.YNc(13,le,7,4,"span",4),e.YNc(14,Ce,9,5,"span",4),e.YNc(15,ge,9,6,"span",4),e.YNc(16,Se,13,8,"span",4),e.YNc(17,Te,7,4,"span",4),e.YNc(18,Ee,5,3,"span",4),e.YNc(19,fe,5,3,"span",4),e.YNc(20,Ie,5,3,"span",4),e.YNc(21,Ae,11,6,"span",4),e.YNc(22,ye,9,5,"span",4),e.YNc(23,Pe,9,5,"span",4),e.YNc(24,be,9,5,"span",4),e.YNc(25,je,9,5,"span",4),e.YNc(26,Me,5,3,"span",4),e.qZA(),e.YNc(27,Ze,8,5,"span",4),e.qZA(),e.TgZ(28,"div",5)(29,"app-monaco-editor",6),e.NdJ("editorGenerated",function(R){return s.editorGenerated(R)}),e.qZA()()(),e._UZ(30,"app-insert-code-modal",7,8)(32,"app-monaco-editor-modal",9,10)),2&t&&(e.xp6(4),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_API_HOOKS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DATABASE_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.COLLECTION_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_API_HOOKS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.MIGRATION_SCRIPT),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.PROCESS_INITIALIZER),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SCHEDULERS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.EVENTS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.CUSTOM_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.THIRD_PARTY_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.UTILITY_CLASS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.I18N_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SECRET_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.THIRD_PARTY_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SCHEMA_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DB_MASTERS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DB_MASTERS_JS_UTILS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.UI_MAKER_UTILITY_CLASS),e.xp6(1),e.Q6J("ngIf",s.codeObj.apiCategory),e.xp6(2),e.Q6J("isSchemaEditor",!0)("editorOptions",s.editorOptionsEditorCodeFinder),e.xp6(1),e.Q6J("frameId","idInsertCodeFinder")("modalId","idInsertCodeFinderForm")("docsHostPort",s.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInCodeFinder")("editorOptionsMonacoEditorModal",s.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[Z.O5,Z.PC,G.P,z.O,X.u,ee.A],styles:[".from-modal[_ngcontent-%COMP%]{height:calc(100vh - 117px)}.from-page[_ngcontent-%COMP%]{height:calc(100vh - 87px)}.matchCircle[_ngcontent-%COMP%]{background-color:#ff0;border-radius:10px;padding:0 6px;color:#000}"],changeDetection:0})}return i})()},17566:(v,P,a)=>{a.d(P,{Q:()=>f});var c=a(15861),p=a(51162),C=a(45085),n=a(94946),O=a(53429),A=a(95852),d=a(99961),b=a(32915),j=a(77240),M=a(60095),S=a(96814),e=a(97680),T=a(33259);function E(y,D){if(1&y&&(n.TgZ(0,"span",23),n._uU(1),n.qZA()),2&y){const l=n.oxw();n.xp6(1),n.hij("Total Items: ",l.searchArrays.length,"")}}function U(y,D){1&y&&n._UZ(0,"p-progressSpinner",24)}let f=(()=>{class y{instanceS;authCS;ns;eventCenterS;cd;generalS;loading={grid:!1};subscriptions=[];searchArrays=[];gridKey=p.iH._id;searchText="";isCaseSensitive=!1;constructor(l,m,r,h,_,u){this.instanceS=l,this.authCS=m,this.ns=r,this.eventCenterS=h,this.cd=_,this.generalS=u}ngOnInit(){this.generalS.setNewTitle("API Maker - Code Finder")}codeSearch(){var l=this;return(0,c.Z)(function*(){try{l.loading.grid=!0;const m={text:l.searchText.trim(),user:l.authCS.getUserId(),isCaseSensitive:l.isCaseSensitive};if(m.text){const r=yield l.instanceS.codeFinderData(m);if(r.success)if(l.searchArrays=r.data,l.searchArrays.length)l.showDataInUI();else{const h=[];h.push('<div class="bold text-warning cursor-pointer pt-3 text-center">\n <span class="pl-2">No match found</span>\n </div>'),$("[name='codeBlock']").html(h.join("")),l.eventCenterS.codeFinderResult.next([])}}l.loading.grid=!1,l.cd.detectChanges()}catch(m){l.ns.showErrorFromResponse(m.error||m,"Unable to code search.")}})()}showDataInUI(){const l=[],m=[];for(const r of this.searchArrays){const h=this.searchArrays.indexOf(r);let _="",u="";r.apiCategory===C.R.SCHEDULERS?(_="SCH",u="Scheduler"):r.apiCategory===C.R.MIGRATION_SCRIPT?(_="DB-MS",u="Database Migration Script"):r.apiCategory===C.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE?(_="WSN",u="WebSocket User Can Connect"):r.apiCategory===C.R.PROCESS_INITIALIZER?(_="PI",u="Process Initializer"):r.apiCategory===C.R.EVENTS?(_="EV",u="Event"):r.apiCategory===C.R.CUSTOM_APIS?(_="CA",u="Custom APIs"):r.apiCategory===C.R.THIRD_PARTY_APIS?(_="TP",u="Third Party APIs"):r.apiCategory===C.R.THIRD_PARTY_API_SETTINGS_JSON?(_="TP-S",u="Third Party API Settings"):r.apiCategory===C.R.INSTANCE_API_SETTINGS_JSON?(_="INS-J",u="Instance APIs Settings"):r.apiCategory===C.R.INSTANCE_API_HOOKS_JSON?(_="INS-API-Hook",u="Instance APIs Hooks"):r.apiCategory===C.R.INSTANCE_HOOKS?(_="INS-Hook",u="Instance Hooks"):r.apiCategory===C.R.DATABASE_HOOKS?(_="DB-Hook",u="Database Hooks"):r.apiCategory===C.R.COLLECTION_HOOKS?(_="COL-Hook",u="Collection Hooks"):r.apiCategory===C.R.SYSTEM_API_SETTINGS_JSON?(_="SYS-J",u="System API Settings"):r.apiCategory===C.R.SYSTEM_API_HOOKS_JSON?(_="SYS-Hook",u="System API Hooks"):r.apiCategory===C.R.UTILITY_CLASS?(_="UTIL",u="Utility Classes"):r.apiCategory===C.R.I18N_JSON?(_="I18N",u="Internationalization Settings"):r.apiCategory===C.R.SECRET_JSON?(_="SEC",u="Secret"):r.apiCategory===C.R.SCHEMA_JSON?(_="SC",u="Schema"):r.apiCategory===C.R.DB_MASTERS_JSON?(_="DMC",u="DB Master Config"):r.apiCategory===C.R.DB_MASTERS_JS_UTILS?(_="DMU",u="DB Master Utils"):r.apiCategory===C.R.UI_MAKER_UTILITY_CLASS?(_="UMU",u="UI Maker Utils"):(_=r.categoryName,u=r.categoryName),r.prefix=_,r.tooltip=u,r.versionUI="-1"===r?.version?"Original":r?.version?r.version:"",l.push('<div class="bold cursor-pointer pt-1">'),l.push('<i class="fas fa-times fa-fw text-danger float-right pt-1 nameRemoveSearchResultBlock"></i>'),l.push(`<span class="pl-2 font-weight-bold" title="${u}">${_} :</span>`),r.name&&l.push(`<span class="pl-2">${r.name}</span>`),r.versionUI&&l.push(`<span class="pl-2 small text-secondary">${"("+r.versionUI+")"}</span>`),r.hookType&&l.push(`<span class="pl-2 small">${"["+r.hookType+"]"}</span>`),l.push(`<pre class="h-100 language-javascript m-1 cursor-pointer"><code name="namePrismCss" id="idCodeFinder_${h}" class="language-javascript"></code></pre>`),l.push("</div>"),m.push({i:h,code:r.apiCode})}$("[name='codeBlock']").html(l.join(""));for(const r of m)$(`#idCodeFinder_${r.i}`).text(r.code),Prism.highlightElement(document.getElementById(`idCodeFinder_${r.i}`));this.cd.detectChanges(),$("pre.language-javascript").on("click",r=>{$("pre.bg-primary").removeClass("bg-primary"),$(r.currentTarget.className+=" bg-primary");const h=$(r.currentTarget.childNodes).attr("id").split("_")[1];this.searchArrays[h].searchKeyWord=this.searchText.trim(),this.eventCenterS.codeFinderResult.next([this.searchArrays[h]])}),$("i.nameRemoveSearchResultBlock").on("click",r=>{const h=Number($(r.currentTarget).parent().find("code[name=namePrismCss]").attr("id").split("_")[1]);this.searchArrays.splice(h,1),this.showDataInUI()})}clear(){this.searchText="",this.eventCenterS.codeFinderResult.next([]),$("[name='codeBlock']").empty(),this.searchArrays=[]}static \u0275fac=function(m){return new(m||y)(n.Y36(O.E),n.Y36(A.D),n.Y36(d.W),n.Y36(b.u),n.Y36(n.sBO),n.Y36(j.b))};static \u0275cmp=n.Xpm({type:y,selectors:[["app-code-finder-search"]],decls:26,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header","font-weight-normal"],["src","/assets/images/icons/finder.svg","alt","Code Finder",1,"fa-fw","mr-1"],["class","pl-3 text-info",4,"ngIf"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/features/code-finder.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"pt-1","pl-1","pr-1"],[1,"input-group","input-group-sm","mb-1"],["name","searchText","id","code_search","placeholder","Enter To Search",1,"form-control","form-control-sm",3,"ngModel","ngModelChange","keyup.enter"],[1,"input-group-append"],["type","button","pTooltip","Clear","tooltipPosition","bottom",1,"btn","btn-outline-warning",3,"click"],[1,"fas","fa-ban","fa-fw"],["type","button","data-toggle","dropdown","pTooltip","Case Sensitive","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-info"],[1,"fas","fa-ellipsis-v"],[1,"dropdown-menu","pl-4"],["type","checkbox","name","idIsCaseSensitive","id","idIsCaseSensitive",1,"p-checkbox",2,"vertical-align","middle!important",3,"ngModel","ngModelChange"],["for","idIsCaseSensitive",1,"pt-1","pl-2"],[1,"card-body","p-0","h-100","overflow-auto"],[1,"position-relative","h-100"],[1,"overflow-auto"],["name","codeBlock"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"pl-3","text-info"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(m,r){1&m&&(n.TgZ(0,"div",0)(1,"div",1)(2,"span"),n._UZ(3,"img",2),n._uU(4," Search"),n.qZA(),n.YNc(5,E,2,1,"span",3),n.TgZ(6,"div",4)(7,"a",5),n._UZ(8,"img",6),n.qZA()()(),n.TgZ(9,"div",7)(10,"div",8)(11,"input",9),n.NdJ("ngModelChange",function(_){return r.searchText=_})("keyup.enter",function(){return r.codeSearch()}),n.qZA(),n.TgZ(12,"div",10)(13,"button",11),n.NdJ("click",function(){return r.clear()}),n._UZ(14,"i",12),n.qZA(),n.TgZ(15,"button",13),n._UZ(16,"i",14),n.qZA(),n.TgZ(17,"div",15)(18,"input",16),n.NdJ("ngModelChange",function(_){return r.isCaseSensitive=_}),n.qZA(),n.TgZ(19,"label",17),n._uU(20,"Case Sensitive"),n.qZA()()()()(),n.TgZ(21,"div",18)(22,"div",19)(23,"div",20),n._UZ(24,"div",21),n.YNc(25,U,1,0,"p-progressSpinner",22),n.qZA()()()()),2&m&&(n.xp6(5),n.Q6J("ngIf",r.searchArrays.length),n.xp6(6),n.Q6J("ngModel",r.searchText),n.xp6(7),n.Q6J("ngModel",r.isCaseSensitive),n.xp6(7),n.Q6J("ngIf",r.loading.grid))},dependencies:[M.Fj,M.Wl,M.JJ,M.On,S.O5,e.G,T.u],encapsulation:2,changeDetection:0})}return y})()},53300:(v,P,a)=>{a.d(P,{k:()=>M});var c=a(51162),p=a(94946),C=a(77240),n=a(96814),O=a(17566),A=a(365);const d=["codeFinderResult"],b=function(S,e){return{"col-4":S,"d-none":e}},j=function(S,e){return{"col-8":S,"col-12":e}};let M=(()=>{class S{cd;generalS;modalId="idDefaultCodeFinderId";loading={grid:!1};subscriptions=[];gridKey=c.iH._id;codeFinderResult;constructor(T,E){this.cd=T,this.generalS=E}ngOnInit(){setTimeout(()=>{this.codeFinderResult.layout=this},1e3)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(E){return new(E||S)(p.Y36(p.sBO),p.Y36(C.b))};static \u0275cmp=p.Xpm({type:S,selectors:[["app-code-finder-w"]],viewQuery:function(E,U){if(1&E&&p.Gf(d,5),2&E){let f;p.iGM(f=p.CRH())&&(U.codeFinderResult=f.first)}},inputs:{modalId:"modalId"},decls:7,vars:9,consts:[[1,"pt-1","pl-1","pr-1"],[1,"row","m-0","overflow-hidden","code-finder-height"],[1,"p-0","h-100",3,"ngClass"],[1,"w-100"],[1,"w-100",3,"modalId"],["codeFinderResult",""]],template:function(E,U){if(1&E&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._UZ(3,"app-code-finder-search",3),p.qZA(),p.TgZ(4,"div",2),p._UZ(5,"app-code-finder-result",4,5),p.qZA()()()),2&E){const f=p.MAs(6);p.xp6(2),p.Q6J("ngClass",p.WLB(3,b,!f.isResponseCollapsed,f.isResponseCollapsed)),p.xp6(2),p.Q6J("ngClass",p.WLB(6,j,!f.isResponseCollapsed,f.isResponseCollapsed)),p.xp6(1),p.Q6J("modalId",U.modalId)}},dependencies:[n.mk,O.Q,A.n],encapsulation:2,changeDetection:0})}return S})()},27470:(v,P,a)=>{a.r(P),a.d(P,{CodeFinderM:()=>e});var c=a(77664),p=a(17017),C=a(63726),n=a(53300),b=(a(92883),a(17566),a(365),a(44950)),j=a(94946);const M=[{path:"finder",component:n.k,canActivate:[C.P]}];let e=(()=>{class T{static \u0275fac=function(f){return new(f||T)};static \u0275mod=j.oAB({type:T});static \u0275inj=j.cJS({imports:[c.Bz.forChild(M),p.u,b.A]})}return T})()}}]);