@sava-info-systems/api-maker-with-extensions 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1025.js +1 -1
- package/dist/1097.js +1 -1
- package/dist/148.js +1 -1
- package/dist/1558.js +1 -1
- package/dist/1678.js +1 -1
- package/dist/1754.js +1 -1
- package/dist/1928.js +1 -1
- package/dist/1957.js +1 -1
- package/dist/2140.js +1 -1
- package/dist/2295.js +1 -1
- package/dist/2473.js +1 -1
- package/dist/2714.js +1 -1
- package/dist/2735.js +1 -1
- package/dist/2908.js +1 -1
- package/dist/3081.js +1 -0
- package/dist/3139.js +1 -1
- package/dist/3450.js +1 -1
- package/dist/4110.js +1 -1
- package/dist/4181.js +1 -1
- package/dist/4186.js +1 -1
- package/dist/4211.js +1 -1
- package/dist/4575.js +1 -1
- package/dist/4842.js +1 -1
- package/dist/485.js +1 -1
- package/dist/4895.js +1 -1
- package/dist/5249.js +1 -1
- package/dist/5334.js +1 -1
- package/dist/5421.js +1 -1
- package/dist/5679.js +1 -1
- package/dist/5761.js +1 -1
- package/dist/5765.js +1 -1
- package/dist/6236.js +1 -1
- package/dist/6393.js +1 -1
- package/dist/6401.js +1 -1
- package/dist/7368.js +1 -1
- package/dist/7436.js +1 -1
- package/dist/7470.js +1 -1
- package/dist/7649.js +1 -1
- package/dist/7975.js +1 -1
- package/dist/7977.js +1 -1
- package/dist/7987.js +1 -1
- package/dist/8125.js +1 -1
- package/dist/8266.js +1 -1
- package/dist/8296.js +1 -1
- package/dist/8841.js +1 -1
- package/dist/885.js +1 -1
- package/dist/891.js +1 -1
- package/dist/913.js +1 -1
- package/dist/9243.js +1 -1
- package/dist/9575.js +1 -1
- package/dist/9939.js +1 -1
- package/dist/assets/images/icons/api-maker-deployment.svg +5 -0
- package/dist/assets/schema-types/types.ts +357 -9
- package/dist/assets/styles/out/styles.css +1 -1
- package/dist/assets/styles/out/styles.css.map +1 -1
- package/dist/assets/styles/styles.scss +22 -0
- package/dist/common.js +1 -1
- package/dist/main.js +1 -1
- package/main.js +1 -1
- package/package.json +4 -4
- package/sandbox/assets/schema-types/types.js +38 -0
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/types.ts +357 -9
- package/src/public/dist-db-masters/browser/main.js +70 -68
package/dist/1025.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1025],{4061:(_e,k,c)=>{c.d(k,{T:()=>K});var S=c(5861),e=c(328),P=c(7850),M=c(6990),E=c(6212),O=c(1162),n=c(4946),I=c(95),w=c(7240),Z=c(262),W=c(9961),G=c(7414),i=c(5852),Y=c(3429),Q=c(2189),J=c(4977),V=c(2559),H=c(7629),U=c(1429),q=c(6814),N=c(5219),j=c(7680),D=c(3965);function R(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"Database"),n.qZA(),n.TgZ(3,"p-dropdown",9),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.database=p.value,n.KtG(r.loadCollections(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allDatabases)("ngModel",s.tab.database)("filter",!0)}}function X(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"Collections"),n.qZA(),n.TgZ(3,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.collection=p.value,n.KtG(r.loadInstanceAPIs(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allCollections)("ngModel",s.tab.collection)("filter",!0)}}function z(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",1)(1,"div",2)(2,"span",3),n._uU(3,"Instances"),n.qZA(),n.TgZ(4,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return r.tab.instance=p.value,n.KtG(r.loadDatabases(!0))}),n.qZA()(),n.YNc(5,R,4,3,"div",8),n.YNc(6,X,4,3,"div",8),n.qZA()}if(2&f){const s=n.oxw();n.xp6(4),n.Q6J("options",s.tab.allInstances)("ngModel",s.tab.instance)("filter",!0),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.INSTANCES),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.INSTANCES)}}function ee(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"API Versions"),n.qZA(),n.TgZ(3,"p-dropdown",10),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.tpStoreApiVersion=p.value,n.KtG(r.loadThirdPartyAPIs(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allStoreApiVersions)("ngModel",s.tab.tpStoreApiVersion)("filter",!0)}}function L(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",1)(1,"div",2)(2,"span",3),n._uU(3,"API Bundle"),n.qZA(),n.TgZ(4,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return r.tab.tpApiBundle=p.value,n.KtG(r.loadStoreApiVersions(!0))}),n.qZA()(),n.YNc(5,ee,4,3,"div",8),n.qZA()}if(2&f){const s=n.oxw();n.xp6(4),n.Q6J("options",s.tab.allApiBundles)("ngModel",s.tab.tpApiBundle)("filter",!0),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.THIRD_PARTY_APIS)}}function F(f,y){if(1&f&&(n.TgZ(0,"span",18),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function te(f,y){if(1&f&&(n.TgZ(0,"span",19),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function ne(f,y){if(1&f&&(n.TgZ(0,"div")(1,"span"),n._uU(2),n.qZA(),n.YNc(3,F,2,1,"span",16),n.YNc(4,te,2,1,"span",17),n.qZA()),2&f){const s=n.oxw().$implicit;n.xp6(2),n.Oqu(s.name),n.xp6(1),n.Q6J("ngIf","SCHEMA"===s.category),n.xp6(1),n.Q6J("ngIf","GEN"===s.category)}}function ae(f,y){1&f&&n.YNc(0,ne,5,3,"div",15),2&f&&n.Q6J("ngIf",y.$implicit)}function oe(f,y){if(1&f&&(n.TgZ(0,"span",18),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function se(f,y){if(1&f&&(n.TgZ(0,"span",19),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function ie(f,y){if(1&f&&(n.TgZ(0,"div")(1,"span"),n._uU(2),n.qZA(),n.YNc(3,oe,2,1,"span",16),n.YNc(4,se,2,1,"span",17),n.qZA()),2&f){const s=n.oxw().$implicit;n.xp6(2),n.Oqu(s.name),n.xp6(1),n.Q6J("ngIf","SCHEMA"===s.category),n.xp6(1),n.Q6J("ngIf","GEN"===s.category)}}function re(f,y){1&f&&n.YNc(0,ie,5,3,"div",15),2&f&&n.Q6J("ngIf",y.$implicit)}function ce(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",11)(1,"div",1)(2,"div",12)(3,"span",3),n._uU(4,"APIs"),n.qZA(),n.TgZ(5,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return n.KtG(r.tab.api=p.value)}),n.YNc(6,ae,1,1,"ng-template",13),n.YNc(7,re,1,1,"ng-template",14),n.qZA()()()()}if(2&f){const s=n.oxw();n.xp6(5),n.Q6J("options",s.tab.apiList)("ngModel",s.tab.api)("filter",!0)}}function B(f,y){1&f&&n._UZ(0,"p-progressSpinner",20)}let K=(()=>{class f{fb;generalS;webSocketEventsS;ns;constantsS;authCS;instanceS;navigationCS;tpStoreApiVersionS;tpInstalledApisS;functionS;dataProviderS;cd;EFormMode=e.D;form;subscriptions=[];tab={};apiCategories;loading={dropdown:!0};EAPICategory=P.R;tpAPIVersionMap={};apiCategoriesMap={};dbIdMap={};colIdMap={};tpLibraryMap={};tpPIMap={};constructor(s,t,p,r,d,C,l,g,v,T,h,_,b){this.fb=s,this.generalS=t,this.webSocketEventsS=p,this.ns=r,this.constantsS=d,this.authCS=C,this.instanceS=l,this.navigationCS=g,this.tpStoreApiVersionS=v,this.tpInstalledApisS=T,this.functionS=h,this.dataProviderS=_,this.cd=b}ngOnInit(){this.loadApiCategories().then()}loadApiCategories(){var s=this;return(0,S.Z)(function*(){const t=s.dataProviderS.getApiCategoriesForWebSocketAndGroup();s.apiCategories=t.filter(r=>r.id!==P.R.SCHEDULERS&&r.id!==P.R.EVENTS),s.apiCategoriesMap=M.keyBy(s.apiCategories,O.GR.id);const p=s.navigationCS.getQueryParam(E.p.at_category);p&&s.tab&&(s.tab.apiCategory=M.find(s.apiCategories,{id:p})),s.tab.apiCategory||(s.tab.apiCategory=s.apiCategories[0]),yield s.apiCategoryChangedEvent(!1),yield s.categorySelected(!1),s.cd.detectChanges()})()}apiCategoryChangedEvent(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0,t.resetDependentObjects("INSTANCE"),yield t.categorySelected(s),t.tab.apiCategory.id===P.R.INSTANCES?yield t.loadInstances(s):t.tab.apiCategory.id===P.R.THIRD_PARTY_APIS?yield t.loadLibraries(s):t.tab.apiCategory.id===P.R.CUSTOM_APIS?yield t.loadCustomAPIs(s):t.tab.apiCategory.id===P.R.SYSTEM_APIS&&(yield t.loadSystemAPIs(s)),t.loading.dropdown=!1})()}loadInstances(s){var t=this;return(0,S.Z)(function*(){t.resetDependentObjects("INSTANCE"),yield t.categorySelected(s),t.loading.dropdown=!0;try{const r={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(r).toPromise()).data||[]}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allInstances=[]}const p=t.navigationCS.getQueryParam(E.p.at_instance);p&&(t.tab.instance=M.find(t.tab.allInstances,{name:p})),!t.tab.instance&&t.tab.allInstances.length&&(t.tab.instance=t.tab.allInstances[0]),yield t.loadDatabases(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadDatabases(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("DATABASE"),yield t.setInstanceInURL(s),!t.tab.instance)return t.tab.allDatabases=[],t.tab.allCollections=[],void(t.tab.apiList=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance]).toPromise()).data||[])[0]||[],t.dbIdMap=M.keyBy(t.tab.allDatabases,O.N7.db)}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allDatabases=[]}const p=t.navigationCS.getQueryParam(E.p.at_database);p&&(t.tab.database=M.find(t.tab.allDatabases,{db:p})),!t.tab.database&&t.tab.allDatabases.length&&(t.tab.database=t.tab.allDatabases[0]),yield t.loadCollections(s),t.loading.dropdown=!1})()}loadCollections(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("COLLECTION"),yield t.setDatabaseInURL(s),!t.tab.instance||!t.tab.database)return t.tab.allCollections=[],void(t.tab.apiList=[]);try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database]).toPromise()).data||[])[0]||[],t.colIdMap=M.keyBy(t.tab.allCollections,O.GR.name)}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allCollections=[]}const p=t.navigationCS.getQueryParam(E.p.at_collection);t.tab.collection=p?M.find(t.tab.allCollections,{name:p}):t.tab.allCollections[0],yield t.loadInstanceAPIs(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadInstanceAPIs(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,yield t.setCollectionInURL(s),!t.tab.instance||!t.tab.database||!t.tab.collection)return t.tab.apiList=[],void(t.loading.dropdown=!1);try{const r=t.tab.collection;r.removeStreamApisInResponse=!0,t.tab.apiList=(yield t.instanceS.instanceAPIList([r])).data||[]}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.apiList=[]}const p=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(p)})()}loadLibraries(s){var t=this;return(0,S.Z)(function*(){t.resetDependentObjects("LIBRARY"),t.loading.dropdown=!0,t.tab.allApiBundles=yield t.tpStoreApiVersionS.getAllAPIBundles(),t.tpLibraryMap=M.keyBy(t.tab.allApiBundles,"value");const p=t.navigationCS.getQueryParam(E.p.at_bundleName);p&&(t.tab.tpApiBundle=M.find(t.tab.allApiBundles,{value:p})),!t.tab.tpApiBundle&&t.tab.allApiBundles.length&&(t.tab.tpApiBundle=t.tab.allApiBundles[0]),yield t.loadStoreApiVersions(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadStoreApiVersions(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("API_VERSION"),yield t.setLibraryInURL(s),!t.tab.tpApiBundle)return t.tab.allStoreApiVersions=[],void(t.tab.apiList=[]);t.tab.allStoreApiVersions=yield t.tpStoreApiVersionS.getAllStoreApiVersions([t.tab.tpApiBundle.value]);const p=t.navigationCS.getQueryParam(E.p.at_bundleName),r=t.navigationCS.getQueryParam(E.p.at_apiVersion);r&&(t.tab.tpStoreApiVersion=M.find(t.tab.allStoreApiVersions,{apiBundleName:p,storeApiVersion:r})),!t.tab.tpStoreApiVersion&&t.tab.allStoreApiVersions.length&&(t.tab.tpStoreApiVersion=t.tab.allStoreApiVersions[0]),yield t.loadThirdPartyAPIs(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadThirdPartyAPIs(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,yield t.setTPApiVersionInURL(s),!t.tab.tpApiBundle||!t.tab.tpStoreApiVersion)return void(t.tab.apiList=[]);t.tab.apiList=(yield t.tpInstalledApisS.getThirdPartyAPIListArray([t.tab.tpStoreApiVersion]).toPromise()).data,t.tpPIMap=M.keyBy(t.tab.apiList,O.iH._id);const p=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(p)})()}loadCustomAPIs(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0;const p=yield t.functionS.getFunctionsAsAPI().toPromise();p.success&&p.data&&p.data.length&&(t.tab.apiList=p.data||[]);const r=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(r)})()}loadSystemAPIs(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0;const p=yield t.instanceS.systemAPIList().toPromise();p?.data?.length&&(t.tab.apiList=p.data||[]);const r=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(r)})()}apiCommon(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0,s?(t.tab.api=M.find(t.tab.apiList,{id:s}),t.tab.api||(t.tab.api=M.find(t.tab.apiList,{name:s}))):t.tab.api=t.tab.apiList[0],yield t.setApiInURL(),t.loading.dropdown=!1})()}categorySelected(s){var t=this;return(0,S.Z)(function*(){t.tab.apiCategory&&(yield t.navigationCS.setQueryParam(E.p.at_category,t.tab.apiCategory.id),s&&(yield t.generalS.resetUrlParams([E.p.at_instance,E.p.at_database,E.p.at_collection,E.p.at_bundleName,E.p.at_apiVersion,E.p.at_api])))})()}resetDependentObjects(s){"INSTANCE"===s?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===s?(this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===s?(this.tab.allCollections=this.tab.apiList=[],this.tab.collection=this.tab.api=void 0):"LIBRARY"===s?(this.tab.allApiBundles=this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpApiBundle=this.tab.api=this.tab.tpStoreApiVersion=void 0):"API_VERSION"===s&&(this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpStoreApiVersion=this.tab.api=void 0)}setInstanceInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.instance&&t.tab.instance._id&&(yield t.navigationCS.setQueryParam(E.p.at_instance,t.tab.instance._id),s&&(yield t.generalS.resetUrlParams([E.p.at_database,E.p.at_collection,E.p.at_api])))})()}setDatabaseInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.database&&t.tab.database._id&&(yield t.navigationCS.setQueryParam(E.p.at_database,t.tab.database._id),s&&(yield t.generalS.resetUrlParams([E.p.at_collection,E.p.at_api])))})()}setCollectionInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.collection&&t.tab.collection._id&&(yield t.navigationCS.setQueryParam(E.p.at_collection,t.tab.collection._id),s&&(yield t.generalS.resetUrlParams([E.p.at_api])))})()}setLibraryInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.tpApiBundle&&t.tab.tpApiBundle.value&&(yield t.navigationCS.setQueryParam(E.p.at_bundleName,t.tab.tpApiBundle.value),s&&(yield t.generalS.resetUrlParams([E.p.at_apiVersion,E.p.at_api])))})()}setTPApiVersionInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.tpStoreApiVersion&&t.tab.tpStoreApiVersion._id&&(yield t.navigationCS.setQueryParam(E.p.at_apiVersion,t.tab.tpStoreApiVersion._id),s&&(yield t.generalS.resetUrlParams([E.p.at_api])))})()}setApiInURL(){var s=this;return(0,S.Z)(function*(){s.tab?.api?.id&&(yield s.navigationCS.setQueryParam(E.p.at_api,s.tab.api.id))})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(t){return new(t||f)(n.Y36(I.qu),n.Y36(w.b),n.Y36(Z.a),n.Y36(W.W),n.Y36(G.L),n.Y36(i.D),n.Y36(Y.E),n.Y36(Q.S),n.Y36(J.f),n.Y36(V.d),n.Y36(H.d),n.Y36(U.B),n.Y36(n.sBO))};static \u0275cmp=n.Xpm({type:f,selectors:[["app-web-socket-events-form-second"]],decls:13,vars:7,consts:[[1,"container","mt-3"],[1,"row"],[1,"col-4"],[1,"small"],["optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],["class","row",4,"ngIf"],["class","container mt-3 mb-3",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["class","col-4",4,"ngIf"],["optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],["optionLabel","displayText","filterBy","displayText","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],[1,"container","mt-3","mb-3"],[1,"col-8"],["pTemplate","item"],["pTemplate","selectedItem"],[4,"ngIf"],["class","small text-success italic",4,"ngIf"],["class","small text-info italic",4,"ngIf"],[1,"small","text-success","italic"],[1,"small","text-info","italic"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(t,p){1&t&&(n.TgZ(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"span",3),n._uU(5,"API Category"),n.qZA(),n.TgZ(6,"p-dropdown",4),n.NdJ("onChange",function(d){return p.tab.apiCategory=d.value,p.apiCategoryChangedEvent(!0)}),n.qZA()()()(),n.TgZ(7,"div",0),n.YNc(8,z,7,5,"div",5),n.qZA(),n.TgZ(9,"div",0),n.YNc(10,L,6,4,"div",5),n.qZA(),n.YNc(11,ce,8,3,"div",6),n.YNc(12,B,1,0,"p-progressSpinner",7),n.qZA()),2&t&&(n.xp6(6),n.Q6J("options",p.apiCategories)("ngModel",p.tab.apiCategory)("filter",!0),n.xp6(2),n.Q6J("ngIf",p.tab.apiCategory.id===p.EAPICategory.INSTANCES),n.xp6(2),n.Q6J("ngIf",p.tab.apiCategory.id===p.EAPICategory.THIRD_PARTY_APIS),n.xp6(1),n.Q6J("ngIf",p.tab.apiCategory.id!==p.EAPICategory.WEB_SOCKET_EVENT),n.xp6(1),n.Q6J("ngIf",p.loading.dropdown))},dependencies:[I.JJ,I.On,q.O5,N.jx,j.G,D.Lt],encapsulation:2})}return f})()},2726:(_e,k,c)=>{c.d(k,{x:()=>h});var S=c(5861),e=c(4946),P=c(3157),M=c(328),o=c(6990),O=c(5085),n=c(6212),I=c(1162),w=c(6925),Z=c(7240),W=c(9961),G=c(262),i=c(5852),Y=c(7414),Q=c(2915),J=c(5405),V=c(7629),H=c(2189),U=c(5219),q=c(7664),N=c(95),j=c(6814),D=c(5431),R=c(7680),X=c(3259),z=c(8057),ee=c(8980);const L=["webSocketEventsManFormC"];function F(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.navigateToTreeView())}),e._UZ(1,"i",18),e.qZA()}}function te(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.edit())}),e._UZ(1,"i",20),e.qZA()}}function ne(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function ae(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,te,2,0,"span",15),e.YNc(5,ne,2,0,"span",16),e.qZA()}if(2&_){const a=e.oxw();e.xp6(3),e.Q6J("ngIf",a.rows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length)}}function oe(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(u){e.CHM(a);const A=e.oxw();return e.KtG(A.eventCenterS.group.apisRegex.allWebSocketEvents=u)}),e.qZA()()()}if(2&_){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.group.apisRegex.allWebSocketEvents)("binary",!0)}}function se(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(u){e.CHM(a);const A=e.oxw();return e.KtG(A.eventCenterS.filterInLog.apisRegex.allWebSocketEvents=u)}),e.qZA()()()}if(2&_){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)("binary",!0)}}function ie(_,b){if(1&_&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&_){const a=e.oxw();e.xp6(2),e.Oqu(a.constantsS.group.allWebSocketEventsPermitted)}}function re(_,b){1&_&&(e.TgZ(0,"th",36),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function ce(_,b){1&_&&e._UZ(0,"th",37)}function B(_,b){1&_&&e._UZ(0,"th",38)}function K(_,b){if(1&_&&(e.TgZ(0,"tr"),e.YNc(1,re,2,0,"th",32),e.YNc(2,ce,1,0,"th",33),e.TgZ(3,"th",34),e._uU(4,"API Category"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Name"),e.qZA(),e.YNc(7,B,1,0,"th",35),e.qZA()),2&_){const a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(1),e.Q6J("ngIf",!a.isDependentOnGroup&&!a.isLPM&&!a.isFilterLogTable),e.xp6(5),e.Q6J("ngIf",a.isLPM)}}function f(_,b){if(1&_&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",41),e.qZA()),2&_){const a=e.oxw().$implicit;e.xp6(1),e.Q6J("value",a)("pSelectableRow",a)}}function y(_,b){if(1&_&&(e.TgZ(0,"td",42)(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().rowIndex;e.xp6(2),e.Oqu(a+1)}}function s(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"span"),e._uU(4," \u2192 "),e.qZA(),e.TgZ(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span"),e._uU(8," \u2192 "),e.qZA(),e.TgZ(9,"span"),e._uU(10),e.qZA(),e.TgZ(11,"span"),e._uU(12," \u2192 "),e.qZA(),e.TgZ(13,"span"),e._uU(14),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.instanceNameUI),e.xp6(4),e.Oqu(a.databaseName),e.xp6(4),e.Oqu(a.collectionName),e.xp6(4),e.Oqu(a.apiNameUI)}}function t(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"span"),e._uU(4," \u2192 "),e.qZA(),e.TgZ(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span"),e._uU(8," \u2192 "),e.qZA(),e.TgZ(9,"span"),e._uU(10),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiBundleNameUI),e.xp6(4),e.Oqu(a.storeApiVersionUI),e.xp6(4),e.Oqu(a.apiNameUI)}}function p(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function r(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function d(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function C(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"div")(1,"label",43)(2,"p-checkbox",44),e.NdJ("ngModelChange",function(){e.CHM(a);const u=e.oxw(2).$implicit,A=e.oxw(2);return e.KtG(A.checkedChangeGridItem(u))})("ngModelChange",function(u){e.CHM(a);const A=e.oxw(2).$implicit;return e.KtG(A.saveResponseInLog=u)}),e.qZA()()()}if(2&_){const a=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",a.saveResponseInLog)("binary",!0)}}function l(_,b){if(1&_&&(e.TgZ(0,"td"),e.YNc(1,C,3,2,"div",6),e.qZA()),2&_){const a=e.oxw().$implicit,m=e.oxw(2);e.xp6(1),e.Q6J("ngIf",m.selectedRows.indexOf(a)>=0)}}function g(_,b){if(1&_&&(e.TgZ(0,"tr",39),e.YNc(1,f,2,2,"td",6),e.YNc(2,y,3,1,"td",40),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e.YNc(6,s,15,4,"div",6),e.YNc(7,t,11,3,"div",6),e.YNc(8,p,3,1,"div",6),e.YNc(9,r,3,1,"div",6),e.YNc(10,d,3,1,"div",6),e.qZA(),e.YNc(11,l,2,1,"td",6),e.qZA()),2&_){const a=b.$implicit,m=e.oxw(2);e.Q6J("pSelectableRow",a),e.xp6(1),e.Q6J("ngIf",m.showCheckbox),e.xp6(1),e.Q6J("ngIf",!m.isDependentOnGroup&&!m.isLPM&&!m.isFilterLogTable),e.xp6(2),e.Oqu(a.categoryUI),e.xp6(2),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.INSTANCES),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.THIRD_PARTY_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.SYSTEM_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.CUSTOM_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.WEB_SOCKET_EVENT),e.xp6(1),e.Q6J("ngIf",m.isLPM)}}function v(_,b){1&_&&e._UZ(0,"p-progressSpinner",45)}function T(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(u){e.CHM(a);const A=e.oxw();return e.KtG(A.selectedRows=u)})("selectionChange",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.webSocketEventSelected())})("dblclick",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.dblClickWebSocketEvent())}),e.YNc(2,K,8,3,"ng-template",29),e.YNc(3,g,12,10,"ng-template",30),e.qZA(),e.YNc(4,v,1,0,"p-progressSpinner",31),e.qZA()}if(2&_){const a=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",a.metaKeySelection)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.xp6(3),e.Q6J("ngIf",a.loading.grid)}}let h=(()=>{class _{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;showCheckbox=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:M.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=I.iH._id;EAPICategory=O.R;ERequestMethod=w.Yp;webSocketEventsManFormC;constructor(a,m,u,A,x,le,de,pe,me,ge,ve,fe){this.generalS=a,this.notificationS=m,this.webSocketEventsS=u,this.authCS=A,this.constantsS=x,this.eventCenterS=le,this.cd=de,this.eventCenterCS=pe,this.functionS=me,this.navigationCS=ge,this.confirmationService=ve,this.router=fe}ngOnInit(){var a=this;this.loadGridData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(m=>{(m.action===P.F.SAVED||m.action===P.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadGridData().then())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var m=(0,S.Z)(function*(u){u.length&&(yield a.loadGridData())});return function(u){return m.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(m=>{m&&this.loadGridData().then()})),this.generalS.setNewTitle("API Maker - WebSocket Events")}loadGridData(){var a=this;return(0,S.Z)(function*(){if(a.isDependentOnGroup&&0===a.eventCenterS.group.selectedGroups.value.length)return void a.resetGridAndUrl();a.loading.grid=!0;const m=yield a.webSocketEventsS.getWSEventKGrid({}).toPromise();m.success?(a.selectedRows=[],a.rows=m.data,a.rowsMap=o.keyBy(a.rows,I.iH._id),a.rowsMapName=o.keyBy(a.rows,I.of.id)):a.resetGridAndUrl();const u=a.navigationCS.getQueryParam(n.p.am_ws_event)||(a.isFilterLogTable?a.eventCenterS.filterInLog.webSocketIds.value.join(","):a.eventCenterS.group.webSocketIds.value.join(","));if(u){const A=u.split(","),x=o.intersection(o.keys(a.rowsMap),A),le=[];for(const de of x)a.rowsMap[de]&&le.push(a.rowsMap[de]);a.selectedRows=le,a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next(le),a.eventCenterS.filterInLog.webSocketIds.next(x)}if(a.isDependentOnGroup&&a.eventCenterS.group.webSocketIds.value.length&&(a.selectedRows=a.generalS.getObjectsFromIdArray(a.eventCenterS.group.webSocketIds.value,a.rowsMap),a.eventCenterS.group.webSocketApis.next(a.selectedRows)),a.isLPM&&a.eventCenterS.group.selectedGroups.value[0]?.queryParams?.webSocketEventNames?.length){const A=a.eventCenterS.group.selectedGroups.value[0];for(const x of A?.queryParams?.webSocketEventNames)a.rowsMapName[x]&&(a.rowsMapName[x].saveResponseInLog=A.webSocketEventsLog?.[x]?.saveResponseInLog||!1);a.setResDataInEventCenter()}setTimeout(()=>{a.loading.grid=!1,a.cd.detectChanges()},100)})()}add(){this.data.formData=void 0,this.data.mode=M.D.ADD,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}view(){this.data.formData=this.selectedRows[0],this.data.mode=M.D.VIEW,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_VIEW_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=M.D.EDIT,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal()}removePermanentDialog(){var a=this;return(0,S.Z)(function*(){var m;a.confirmationService.confirm({message:a.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(m=(0,S.Z)(function*(){yield a.removePermanent()}),function(){return m.apply(this,arguments)})})})()}removePermanent(){var a=this;return(0,S.Z)(function*(){a.loading.grid=!0;const m=yield a.webSocketEventsS.permanentDelete(a.selectedRows[0]._id).toPromise();a.loading.grid=!1,m.success?(a.notificationS.showSuccess(a.constantsS.webSocketEvents.removePermanent),a.resetGridAndUrl(),a.loadGridData().then(),a.selectedRows=[]):a.notificationS.showErrorFromResponse(m,a.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}dblClickWebSocketEvent(){this.selectedRows.length&&this.edit()}navigateToTreeView(){this.router.navigate(["api-info","web-socket-events","layout-tree"]).then()}resetThisUrl(){var a=this;return(0,S.Z)(function*(){a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield a.navigationCS.setQueryParam(n.p.am_ws_event,null)})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.webSocketApis.next(this.selectedRows),this.eventCenterS.group.selectedWebSocket.next(this.selectedRows),this.eventCenterS.group.webSocketIds.next(o.map(this.selectedRows,"_id"))),this.isFilterLogTable&&this.eventCenterS.filterInLog.webSocketApis.next(this.selectedRows)}webSocketEventSelected(){var a=this;return(0,S.Z)(function*(){if(a.fillData().then(),a.selectedRows?.[0]){const m=(a.selectedRows[0]?.nameUI||"").split("/");a.generalS.setNewTitle(m[m.length-1],O.R.WEB_SOCKET_EVENT)}})()}fillData(){var a=this;return(0,S.Z)(function*(){if(!a.selectedRows.length)return yield a.navigationCS.setQueryParam(n.p.am_ws_event,""),a.eventCenterS.group.webSocketIds.next([]),a.eventCenterS.group.webSocketApis.next([]),a.eventCenterS.filterInLog.webSocketIds.next([]),void a.eventCenterS.filterInLog.webSocketApis.next([]);if(a.isDependentOnGroup||a.isFilterLogTable)a.eventCenterS.group.webSocketIds.next(o.map(a.selectedRows,"_id")),a.eventCenterS.group.webSocketApis.next(a.selectedRows),a.isFilterLogTable&&(a.eventCenterS.filterInLog.webSocketIds.next(o.map(a.selectedRows,"_id")),a.eventCenterS.filterInLog.webSocketApis.next(a.selectedRows));else{const m=(yield a.webSocketEventsS.getById(a.selectedRows[0]._id).toPromise()).data;m._id?(yield a.navigationCS.setQueryParam(n.p.am_ws_event,m._id),a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([m])):a.resetThisUrl()}})()}checkedChangeGridItem(a){var m=this;setTimeout((0,S.Z)(function*(){m.selectedRows.push(a),m.selectedRows=o.uniq(m.selectedRows);for(const u in m.rowsMap){const A=m.rowsMap[u];-1===m.selectedRows.indexOf(A)&&(A.saveResponseInLog=!1)}m.setResDataInEventCenter(),m.cd.detectChanges()}),100)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(m){return new(m||_)(e.Y36(Z.b),e.Y36(W.W),e.Y36(G.a),e.Y36(i.D),e.Y36(Y.L),e.Y36(Q.u),e.Y36(e.sBO),e.Y36(J.M),e.Y36(V.d),e.Y36(H.S),e.Y36(U.YP),e.Y36(q.F0))};static \u0275cmp=e.Xpm({type:_,selectors:[["app-web-socket-events-grid"]],viewQuery:function(m,u){if(1&m&&e.Gf(L,5),2&m){let A;e.iGM(A=e.CRH())&&(u.webSocketEventsManFormC=A.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/web.svg","alt","WebSocket Events",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/pages/web-socket-event-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All WebSocket Events",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["webSocketEventsManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Tree View",1,"fas","fa-sitemap","text-yellow","fa-fw","fa-rotate-270"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All WebSocket Events",1,"float-right","cursor-pointer"],[1,"align-middle","mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped ws-events-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","200px"],["style","width: 60px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(m,u){1&m&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," WebSocket Events"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,ae,6,3,"span",6),e.YNc(9,oe,3,2,"span",7),e.YNc(10,se,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,ie,3,1,"div",6),e.YNc(13,T,5,7,"div",9),e.qZA()(),e._UZ(14,"app-web-socket-events-man-form",10,11)),2&m&&(e.xp6(8),e.Q6J("ngIf",!u.isDependentOnGroup&&!u.isLPM&&!u.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",u.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",u.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",u.eventCenterS.group.apisRegex.allWebSocketEvents||u.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),e.xp6(1),e.Q6J("ngIf",!(u.eventCenterS.group.apisRegex.allWebSocketEvents||u.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)),e.xp6(1),e.Q6J("data",u.data))},dependencies:[N.JJ,N.On,j.O5,D.iA,U.jx,D.Ei,D.UA,D.Mo,R.G,X.u,z.XZ,ee.D],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return _})()},8980:(_e,k,c)=>{c.d(k,{D:()=>r});var S=c(5861),e=c(95),P=c(3157),M=c(328),o=c(7850),E=c(6990),n=c(9361),I=c(6212),w=c(1162),Z=c(553),W=c(3531),G=c(9989),i=c(4946),Y=c(7240),Q=c(262),J=c(9961),V=c(7414),H=c(5852),U=c(2304),q=c(2559),N=c(3429),j=c(4977),D=c(2189),R=c(6814),X=c(2660),z=c(5860),ee=c(756),L=c(7680),F=c(4844),te=c(3259),ne=c(8057),ae=c(4061);const oe=["webSocketEventsFormSecondC"],se=["insertCodeModalC"];function ie(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",30),i._uU(2," Add WebSocket Event"),i.qZA())}function re(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",31),i._uU(2," View WebSocket Event"),i.qZA())}function ce(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",32),i._uU(2," Edit WebSocket Event"),i.qZA())}function B(d,C){1&d&&(i.TgZ(0,"div",33)(1,"div",34)(2,"span",35),i._uU(3,"Name"),i.qZA(),i._UZ(4,"input",36),i.qZA()())}function K(d,C){if(1&d){const l=i.EpF();i.TgZ(0,"div",37)(1,"app-monaco-editor",38),i.NdJ("editorGenerated",function(v){i.CHM(l);const T=i.oxw();return i.KtG(T.editorGenerated(v))}),i.qZA()()}if(2&d){const l=i.oxw();i.xp6(1),i.Q6J("isSchemaEditor",!0)("editorOptions",l.editorOptionsSchedulers)}}function f(d,C){1&d&&(i.TgZ(0,"span"),i._uU(1,"Save"),i.qZA())}function y(d,C){1&d&&(i.TgZ(0,"span"),i._uU(1,"Update"),i.qZA())}function s(d,C){if(1&d){const l=i.EpF();i.TgZ(0,"button",39),i.NdJ("click",function(){i.CHM(l);const v=i.oxw();return i.KtG(v.save())}),i._UZ(1,"i",40),i.YNc(2,f,2,0,"span",4),i.YNc(3,y,2,0,"span",4),i.qZA()}if(2&d){const l=i.oxw();i.xp6(2),i.Q6J("ngIf",l.data.mode===l.EFormMode.ADD),i.xp6(1),i.Q6J("ngIf",l.data.mode===l.EFormMode.EDIT)}}function t(d,C){1&d&&i._UZ(0,"p-progressSpinner",41)}const p=function(d){return{"text-danger font-weight-bold":d}};let r=(()=>{class d{fb;generalCS;webSocketEventsS;ns;constantsS;authCS;monacoS;tpInstalledApisS;instanceS;tpStoreApiVersionS;navigationCS;cd;data;EFormMode=M.D;form;subscriptions=[];loading={form:!1};EAPICategory=o.R;reqActiveIndex=0;tabIndexReq={Basic:0,Code:1,Intervals:2};BE_HOST_PORT=Z.N.BE_HOST_PORT;DOCS_HOST_PORT=Z.N.DOCS_HOST_PORT;shouldLoadMonacoEditor=!1;editorWSNotifications;editorOptionsSchedulers={readOnly:!1,language:"typescript",contextmenu:!0};wsFormSecondC;insertCodeModalC;constructor(l,g,v,T,h,_,b,a,m,u,A,x){this.fb=l,this.generalCS=g,this.webSocketEventsS=v,this.ns=T,this.constantsS=h,this.authCS=_,this.monacoS=b,this.tpInstalledApisS=a,this.instanceS=m,this.tpStoreApiVersionS=u,this.navigationCS=A,this.cd=x}ngOnInit(){var l=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var g=(0,S.Z)(function*(v){if(v)if(l.form.enable(),v.action===P.F.OPEN_FORM_IN_EDIT_MODE){if(!l.data.formData)return;const T=yield l.webSocketEventsS.getById(l.data.formData._id).toPromise();l.form.reset(),yield l.editModelLoadData(T.data),l.form.patchValue(T.data)}else if(v.action===P.F.OPEN_FORM_IN_VIEW_MODE){if(!l.data.formData)return;const T=yield l.webSocketEventsS.getById(l.data.formData._id).toPromise();l.form.reset(),l.form.patchValue(T.data),l.form.disable()}else if(v.action===P.F.OPEN_FORM_IN_ADD_MODE){l.form.reset();const T=yield l.instanceS.getDefaultContent(l.BE_HOST_PORT,o.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE).toPromise();l.generalCS.setValueInEditor(l,"editorWSNotifications",T.data)}});return function(v){return g.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[e.kI.required]],runOnNativeProcess:[!1,[]]})}showInsertCodeModel(){this.generalCS.messageReceivedFor=n.H.All,this.insertCodeModalC.showModal(W.b.WebSocketFormC)}showModal(){var l=this;return(0,S.Z)(function*(){l.shouldLoadMonacoEditor=!0,$("#idWebSocketEventsForm").modal("show"),setTimeout((0,S.Z)(function*(){yield l.wsFormSecondC.loadApiCategories()}),100)})()}hideModal(){$("#idWebSocketEventsForm").modal("hide")}editModelLoadData(l){var g=this;return(0,S.Z)(function*(){if(yield g.wsFormSecondC.categorySelected(!0),g.wsFormSecondC.tab.apiCategory=g.wsFormSecondC.apiCategoriesMap[l.apiCategory],yield g.navigationCS.setQueryParam(I.p.at_category,l.apiCategory),l.apiCategory===o.R.SYSTEM_APIS)yield g.navigationCS.setQueryParam(I.p.at_api,l.systemApiName);else if(l.apiCategory===o.R.CUSTOM_APIS)yield g.navigationCS.setQueryParam(I.p.at_api,l.customApiName);else if(l.apiCategory===o.R.INSTANCES)yield g.navigationCS.setQueryParam(I.p.at_instance,l.instanceName),yield g.navigationCS.setQueryParam(I.p.at_database,l.databaseName),yield g.navigationCS.setQueryParam(I.p.at_collection,l.collectionName),yield g.navigationCS.setQueryParam(I.p.at_api,l.instanceApiName);else if(l.apiCategory===o.R.THIRD_PARTY_APIS){const v=(yield g.tpInstalledApisS.query({find:{bundleName:l.tpInstalledApiBundleName,apiVersion:l.tpInstalledApiVersion,name:l.tpInstalledApiName,user:l.user,active:!0},limit:1}).toPromise())?.data?.[0];if(v){const T=(yield g.tpStoreApiVersionS.query({find:{apiBundleName:v.bundleName,storeApiVersion:v.apiVersion,user:v.user,active:!0},limit:1}).toPromise()).data?.[0];yield g.navigationCS.setQueryParam(I.p.at_bundleName,v.bundleName),yield g.navigationCS.setQueryParam(I.p.at_apiVersion,T.storeApiVersion),yield g.navigationCS.setQueryParam(I.p.at_api,v.name)}}g.generalCS.setValueInEditor(g,"editorWSNotifications",l.canUserConnectViaWSCode||"")})()}save(){var l=this;return(0,S.Z)(function*(){try{l.loading.form=!0;const g=l.form.getRawValue();let v;g.user=l.authCS.getUserId(),g.apiCategory=l.wsFormSecondC.tab.apiCategory.id,v=l.data.formData&&l.data.formData._id?(yield l.webSocketEventsS.getById(l.data.formData._id).toPromise()).data:{};const T=E.find(v.versions||[],{isActive:!0});T&&(T.apiCodeStr=l.editorWSNotifications.getValue());const h=Object.assign({},v,g);h.user=l.authCS.getUserId(),h.canUserConnectViaWSCode=l.editorWSNotifications.getValue();for(const b of h?.versions||[])b.version=b.version.toString();if(h.apiCategory===o.R.WEB_SOCKET_EVENT&&!h.name)return l.ns.showError("Please provide websocket events name.");let _;h.apiCategory===o.R.CUSTOM_APIS&&(h.customApiName=l.wsFormSecondC.tab.api.customApiName),h.apiCategory===o.R.SYSTEM_APIS&&(h.systemApiName=l.wsFormSecondC.tab.api.systemApiId),h.apiCategory===o.R.THIRD_PARTY_APIS&&(h.tpInstalledApiBundleName=l.wsFormSecondC.tab.api.bundleName,h.tpInstalledApiVersion=l.wsFormSecondC.tab.api.apiVersion,h.tpInstalledApiName=l.wsFormSecondC.tab.api.name),h.apiCategory===o.R.INSTANCES&&(h.instanceName=l.wsFormSecondC.tab.instance.name,h.databaseName=l.wsFormSecondC.tab.database.db,h.collectionName=l.wsFormSecondC.tab.collection.name,h.instanceApiName=l.wsFormSecondC.tab.api.id),h.apiCategory!==o.R.WEB_SOCKET_EVENT&&delete h.name,l.data.mode===M.D.ADD?_=yield l.webSocketEventsS.post(h).toPromise():l.data.mode===M.D.EDIT&&(_=yield l.webSocketEventsS.put(l.data.formData._id,h,{select:w.iH._id}).toPromise()),_&&(l.ns.showSuccess(l.data.mode===M.D.ADD?l.constantsS.webSocketEvents.addSuccess:l.constantsS.webSocketEvents.editSuccess),l.data.eventChannel.emit({action:l.data.mode===M.D.ADD?P.F.SAVED:P.F.UPDATED})),l.loading.form=!1}catch(g){l.loading.form=!1,l.ns.showErrorFromResponse(g.error||g,"Unable to save websocket event.")}l.cd.detectChanges()})()}editorGenerated(l){var g=this;return(0,S.Z)(function*(){g.editorWSNotifications=l,yield g.monacoS.loadSchemaEditorSettings(g.BE_HOST_PORT,g.authCS.getUserId(),null),g.monacoS.addSaveCodeKeyBinding(l,v=>{g.form.valid&&g.save()}),g.monacoS.addInsertCodeKeyBinding(l,v=>{g.generalCS.messageReceivedFor=n.H.All,g.data.mode!==M.D.VIEW&&g.insertCodeModalC.showModal(W.b.WebSocketFormC)}),g.subscriptions.push(g.generalCS.messageReceived.subscribe(v=>{v.type&&v.type===G.g.TEXT_COPIED&&v.componentName===W.b.WebSocketFormC&&(g.monacoS.insertAtCursor(l,v.selectedText),g.insertCodeModalC.hideModal())}))})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}ISchedulerProps=w.qH;static \u0275fac=function(g){return new(g||d)(i.Y36(e.qu),i.Y36(Y.b),i.Y36(Q.a),i.Y36(J.W),i.Y36(V.L),i.Y36(H.D),i.Y36(U.b),i.Y36(q.d),i.Y36(N.E),i.Y36(j.f),i.Y36(D.S),i.Y36(i.sBO))};static \u0275cmp=i.Xpm({type:d,selectors:[["app-web-socket-events-man-form"]],viewQuery:function(g,v){if(1&g&&(i.Gf(oe,5),i.Gf(se,5)),2&g){let T;i.iGM(T=i.CRH())&&(v.wsFormSecondC=T.first),i.iGM(T=i.CRH())&&(v.insertCodeModalC=T.first)}},inputs:{data:"data"},decls:34,vars:16,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idWebSocketEventsForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],[1,"w-100",3,"activeIndex","activeIndexChange"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],["webSocketEventsFormSecondC",""],["class","form-group row m-0",4,"ngIf"],[1,"form-group","row"],[1,"col-12"],[1,"align-middle","mb-0","ml-3"],["formControlName","runOnNativeProcess","pTooltip","Code will run on actual process and not in sandbox, so be careful with code. You can not use sandbox packages in this mode. You can use all Node.js packages + some packages on which API Maker is dependent on. You can use features of global variable 'g'.","label","Run Code On Native Process",3,"ngClass","binary"],["header","Code"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"form-group","row","m-0"],[1,"col-4"],[1,"small"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","level1/level2/name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(g,v){if(1&g&&(i.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),i.YNc(4,ie,3,0,"span",4),i.YNc(5,re,3,0,"span",4),i.YNc(6,ce,3,0,"span",4),i.TgZ(7,"div",5)(8,"button",6)(9,"span",7),i._UZ(10,"i",8),i.qZA()(),i.TgZ(11,"span",9),i.NdJ("click",function(){return v.showInsertCodeModel()}),i._UZ(12,"i",10),i.qZA()()(),i.TgZ(13,"div",11)(14,"p-tabView",12),i.NdJ("activeIndexChange",function(h){return v.reqActiveIndex=h}),i.TgZ(15,"p-tabPanel",13)(16,"form",14),i._UZ(17,"app-web-socket-events-form-second",null,15),i.YNc(19,B,5,0,"div",16),i.TgZ(20,"div",17)(21,"div",18)(22,"label",19),i._UZ(23,"p-checkbox",20),i.qZA()()()()(),i.TgZ(24,"p-tabPanel",21),i.YNc(25,K,2,2,"div",22),i.qZA()()(),i.TgZ(26,"div",23)(27,"button",24),i._UZ(28,"i",25),i._uU(29," Close"),i.qZA(),i.YNc(30,s,4,2,"button",26),i.qZA(),i.YNc(31,t,1,0,"p-progressSpinner",27),i.qZA()()(),i._UZ(32,"app-insert-code-modal",28,29)),2&g){const T=i.MAs(18);i.xp6(4),i.Q6J("ngIf",v.data.mode===v.EFormMode.ADD),i.xp6(1),i.Q6J("ngIf",v.data.mode===v.EFormMode.VIEW),i.xp6(1),i.Q6J("ngIf",v.data.mode===v.EFormMode.EDIT),i.xp6(8),i.Q6J("activeIndex",v.reqActiveIndex),i.xp6(2),i.Q6J("formGroup",v.form),i.xp6(3),i.Q6J("ngIf",T.tab.apiCategory.id===v.EAPICategory.WEB_SOCKET_EVENT),i.xp6(4),i.Q6J("ngClass",i.VKq(14,p,!0===v.form.get(v.ISchedulerProps.runOnNativeProcess).value))("binary",!0),i.xp6(2),i.Q6J("ngIf",v.shouldLoadMonacoEditor),i.xp6(5),i.Q6J("ngIf",v.data.mode!==v.EFormMode.VIEW),i.xp6(1),i.Q6J("ngIf",v.loading.form),i.xp6(1),i.Q6J("frameId","idInsertCodeWebSocketFrame")("modalId","idInsertCodeWebSocketModal")("docsHostPort",v.DOCS_HOST_PORT)}},dependencies:[e._Y,e.Fj,e.JJ,e.JL,e.sg,e.u,R.mk,R.O5,X.y,z.P,ee.O,L.G,F.xf,F.x4,te.u,ne.XZ,ae.T],encapsulation:2})}return d})()},1025:(_e,k,c)=>{c.r(k),c.d(k,{WebSocketEventsM:()=>s});var S=c(7664),e=c(8761),P=c(3726),o=(c(4061),c(4946)),E=c(2726);let O=(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-layout-grid"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0),o._UZ(1,"app-web-socket-events-grid",1),o.qZA()),2&d&&(o.xp6(1),o.Q6J("showCheckbox",!1))},dependencies:[E.x],encapsulation:2})}return t})();var n=c(5861),I=c(3157),w=c(328),Z=c(5085),W=c(6212),G=c(1162),i=c(6925),Y=c(7240),Q=c(9961),J=c(262),V=c(5852),H=c(7414),U=c(2915),q=c(5405),N=c(7629),j=c(2189),D=c(5219),R=c(6814),X=c(7526),z=c(7680),ee=c(3259),L=c(8980);const F=["webSocketEventsManFormC"];function te(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"span",19),o.NdJ("click",function(){o.CHM(r);const C=o.oxw();return o.KtG(C.edit())}),o._UZ(1,"i",20),o.qZA()}}function ne(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"span",21),o.NdJ("click",function(){o.CHM(r);const C=o.oxw();return o.KtG(C.removePermanentDialog())}),o._UZ(1,"i",22),o.qZA()}}function ae(t,p){if(1&t&&(o.TgZ(0,"div")(1,"div",23),o._uU(2),o.qZA()()),2&t){const r=o.oxw();o.xp6(2),o.Oqu(r.constantsS.group.allWebSocketEventsPermitted)}}function oe(t,p){if(1&t&&(o.TgZ(0,"div"),o._uU(1),o.qZA()),2&t){const r=o.oxw().$implicit;o.xp6(1),o.Oqu(r.label)}}const se=function(t,p,r,d){return{get:t,put:p,post:r,delete:d}};function ie(t,p){if(1&t&&(o.TgZ(0,"div")(1,"span",25),o._uU(2),o.qZA(),o.TgZ(3,"span"),o._uU(4),o.qZA()()),2&t){const r=o.oxw().$implicit,d=o.oxw();o.xp6(1),o.Q6J("ngClass",o.l5B(3,se,r.data.requestMethod===d.ERequestMethod.GET,r.data.requestMethod===d.ERequestMethod.PUT,r.data.requestMethod===d.ERequestMethod.POST,r.data.requestMethod===d.ERequestMethod.DELETE)),o.xp6(1),o.Oqu(r.data.requestMethod),o.xp6(2),o.Oqu(r.data.name||r.label)}}function re(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"div",24),o.NdJ("click",function(){const l=o.CHM(r).$implicit,g=o.oxw();return l.children&&(l.isExpanded=!0),o.KtG(g.selectedRows=[l._id])}),o.YNc(1,oe,2,1,"div",12),o.YNc(2,ie,5,8,"div",12),o.qZA()}if(2&t){const r=p.$implicit,d=o.oxw();o.xp6(1),o.Q6J("ngIf",(null==r.children?null:r.children.length)||(null==r||null==r.data?null:r.data.apiCategory)!==d.EAPICategory.CUSTOM_APIS),o.xp6(1),o.Q6J("ngIf",!(null!=r.children&&r.children.length)&&(null==r||null==r.data?null:r.data.apiCategory)===d.EAPICategory.CUSTOM_APIS)}}function ce(t,p){1&t&&o._UZ(0,"p-progressSpinner",26)}let B=(()=>{class t{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new o.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=G.iH._id;EAPICategory=Z.R;ERequestMethod=i.Yp;treeNodes=[];allTreeItemsMap={};leafSelected=!1;webSocketEventsManFormC;constructor(r,d,C,l,g,v,T,h,_,b,a,m){this.generalS=r,this.notificationS=d,this.webSocketEventsS=C,this.authCS=l,this.constantsS=g,this.eventCenterS=v,this.cd=T,this.eventCenterCS=h,this.functionS=_,this.navigationCS=b,this.confirmationService=a,this.router=m}ngOnInit(){this.loadTreeData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(r=>{(r.action===I.F.SAVED||r.action===I.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadTreeData().then())})),this.generalS.setNewTitle("API Maker - WebSocket Events")}add(){this.data.formData=void 0,this.data.mode=w.D.ADD,this.data.eventChannel.emit({action:I.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.selectedRows.length&&(this.data.formData=this.selectedRows[0].data,this.data.mode=w.D.EDIT,this.data.eventChannel.emit({action:I.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal().then())}removePermanentDialog(){var r=this;return(0,n.Z)(function*(){var d;r.confirmationService.confirm({message:r.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,n.Z)(function*(){yield r.removePermanent()}),function(){return d.apply(this,arguments)})})})()}removePermanent(){var r=this;return(0,n.Z)(function*(){r.loading.grid=!0;const d=r.selectedRows[0].data,C=yield r.webSocketEventsS.permanentDelete(d._id).toPromise();r.loading.grid=!1,C.success?(r.notificationS.showSuccess(r.constantsS.webSocketEvents.removePermanent),r.resetGridAndUrl(),r.loadTreeData().then(),r.selectedRows=[]):r.notificationS.showErrorFromResponse(C,r.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}navigateToGrid(){var r=this;return(0,n.Z)(function*(){r.router.navigate(["api-info","web-socket-events","layout-grid"]).then()})()}loadTreeData(){var r=this;return(0,n.Z)(function*(){const d=(yield r.functionS.getWSEventKTree().toPromise()).data;for(const l of d)r.generalS.convertKTreeItemToPrimeNGTreeItem(l);const C={};r.generalS.getMapOfAllItems(C,d),r.generalS.setIsExpandedStateFromOldMap(r.allTreeItemsMap,C),r.treeNodes=d,r.allTreeItemsMap=C,r.loading.grid=!1,r.cd.detectChanges()})()}resetThisUrl(){var r=this;return(0,n.Z)(function*(){r.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield r.navigationCS.setQueryParam(W.p.am_ws_event,null)})()}selectedKeysChange(){var r=this;return(0,n.Z)(function*(){if(r.selectedRows.length){const d=r.selectedRows[0];d.children?.length?r.leafSelected=!1:(r.leafSelected=!0,d&&d?.label?r.generalS.setNewTitle(d.label,Z.R.WEB_SOCKET_EVENT):r.generalS.setNewTitle("API Maker - WebSocket Events"),yield r.resetThisUrl())}else r.leafSelected=!1})()}dblClickTreeEvent(){this.leafSelected&&this.selectedRows.length&&this.edit()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(d){return new(d||t)(o.Y36(Y.b),o.Y36(Q.W),o.Y36(J.a),o.Y36(V.D),o.Y36(H.L),o.Y36(U.u),o.Y36(o.sBO),o.Y36(q.M),o.Y36(N.d),o.Y36(j.S),o.Y36(D.YP),o.Y36(S.F0))};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-tree"]],viewQuery:function(d,C){if(1&d&&o.Gf(F,5),2&d){let l;o.iGM(l=o.CRH())&&(C.webSocketEventsManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"]},decls:22,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/web.svg","alt","WebSocket Events",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/pages/web-socket-event-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Grid View",1,"fas","fa-table","text-yellow","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],[1,"h-100"],["scrollHeight","flex","selectionMode","multiple",1,"w-full",3,"value","selection","selectionChange","dblclick"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["webSocketEventsManFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[1,"p-2","text-center","text-success"],[1,"w-100","prevent-text-selection","cursor-pointer",3,"click"],[1,"small","font-weight-bold","d-inline-block","mr-2",3,"ngClass"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0)(1,"div",1)(2,"span"),o._UZ(3,"img",2),o._uU(4," WebSocket Events"),o.qZA(),o.TgZ(5,"span")(6,"a",3),o._UZ(7,"img",4),o.qZA(),o.TgZ(8,"span",5),o.NdJ("click",function(){return C.add()}),o._UZ(9,"i",6),o.qZA(),o.TgZ(10,"span",7),o.NdJ("click",function(){return C.navigateToGrid()}),o._UZ(11,"i",8),o.qZA(),o.YNc(12,te,2,0,"span",9),o.YNc(13,ne,2,0,"span",10),o.qZA()(),o.TgZ(14,"div",11),o.YNc(15,ae,3,1,"div",12),o.TgZ(16,"div",13)(17,"p-tree",14),o.NdJ("selectionChange",function(g){return C.selectedRows=g})("dblclick",function(){return C.dblClickTreeEvent()})("selectionChange",function(){return C.selectedKeysChange()}),o.YNc(18,re,3,2,"ng-template",15),o.qZA(),o.YNc(19,ce,1,0,"p-progressSpinner",16),o.qZA()()(),o._UZ(20,"app-web-socket-events-man-form",17,18)),2&d&&(o.xp6(12),o.Q6J("ngIf",C.leafSelected),o.xp6(1),o.Q6J("ngIf",C.leafSelected),o.xp6(2),o.Q6J("ngIf",C.eventCenterS.group.apisRegex.allWebSocketEvents||C.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),o.xp6(2),o.Q6J("value",C.treeNodes)("selection",C.selectedRows),o.xp6(2),o.Q6J("ngIf",C.loading.grid),o.xp6(1),o.Q6J("data",C.data))},dependencies:[R.mk,R.O5,D.jx,X.mp,z.G,ee.u,L.D],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return t})();const f=[{path:"",redirectTo:"layout-tree",pathMatch:"full"},{path:"layout-tree",component:(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-layout-tree"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0),o._UZ(1,"app-web-socket-events-tree"),o.qZA())},dependencies:[B],encapsulation:2})}return t})(),canActivate:[P.P]},{path:"layout-grid",component:O,canActivate:[P.P]}];let s=(()=>{class t{static \u0275fac=function(d){return new(d||t)};static \u0275mod=o.oAB({type:t});static \u0275inj=o.cJS({imports:[S.Bz.forChild(f),e.u]})}return t})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1025],{4061:(_e,k,c)=>{c.d(k,{T:()=>K});var S=c(5861),e=c(328),P=c(7850),M=c(6990),E=c(6212),O=c(1162),n=c(4946),I=c(95),w=c(7240),Z=c(262),W=c(9961),G=c(7414),i=c(5852),Y=c(3429),Q=c(2189),J=c(4977),V=c(2559),H=c(7629),U=c(1429),q=c(6814),N=c(5219),j=c(7680),D=c(3965);function R(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"Database"),n.qZA(),n.TgZ(3,"p-dropdown",9),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.database=p.value,n.KtG(r.loadCollections(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allDatabases)("ngModel",s.tab.database)("filter",!0)}}function X(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"Collections"),n.qZA(),n.TgZ(3,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.collection=p.value,n.KtG(r.loadInstanceAPIs(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allCollections)("ngModel",s.tab.collection)("filter",!0)}}function z(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",1)(1,"div",2)(2,"span",3),n._uU(3,"Instances"),n.qZA(),n.TgZ(4,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return r.tab.instance=p.value,n.KtG(r.loadDatabases(!0))}),n.qZA()(),n.YNc(5,R,4,3,"div",8),n.YNc(6,X,4,3,"div",8),n.qZA()}if(2&f){const s=n.oxw();n.xp6(4),n.Q6J("options",s.tab.allInstances)("ngModel",s.tab.instance)("filter",!0),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.INSTANCES),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.INSTANCES)}}function ee(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"API Versions"),n.qZA(),n.TgZ(3,"p-dropdown",10),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.tpStoreApiVersion=p.value,n.KtG(r.loadThirdPartyAPIs(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allStoreApiVersions)("ngModel",s.tab.tpStoreApiVersion)("filter",!0)}}function L(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",1)(1,"div",2)(2,"span",3),n._uU(3,"API Bundle"),n.qZA(),n.TgZ(4,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return r.tab.tpApiBundle=p.value,n.KtG(r.loadStoreApiVersions(!0))}),n.qZA()(),n.YNc(5,ee,4,3,"div",8),n.qZA()}if(2&f){const s=n.oxw();n.xp6(4),n.Q6J("options",s.tab.allApiBundles)("ngModel",s.tab.tpApiBundle)("filter",!0),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.THIRD_PARTY_APIS)}}function F(f,y){if(1&f&&(n.TgZ(0,"span",18),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function te(f,y){if(1&f&&(n.TgZ(0,"span",19),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function ne(f,y){if(1&f&&(n.TgZ(0,"div")(1,"span"),n._uU(2),n.qZA(),n.YNc(3,F,2,1,"span",16),n.YNc(4,te,2,1,"span",17),n.qZA()),2&f){const s=n.oxw().$implicit;n.xp6(2),n.Oqu(s.name),n.xp6(1),n.Q6J("ngIf","SCHEMA"===s.category),n.xp6(1),n.Q6J("ngIf","GEN"===s.category)}}function ae(f,y){1&f&&n.YNc(0,ne,5,3,"div",15),2&f&&n.Q6J("ngIf",y.$implicit)}function oe(f,y){if(1&f&&(n.TgZ(0,"span",18),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function se(f,y){if(1&f&&(n.TgZ(0,"span",19),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function ie(f,y){if(1&f&&(n.TgZ(0,"div")(1,"span"),n._uU(2),n.qZA(),n.YNc(3,oe,2,1,"span",16),n.YNc(4,se,2,1,"span",17),n.qZA()),2&f){const s=n.oxw().$implicit;n.xp6(2),n.Oqu(s.name),n.xp6(1),n.Q6J("ngIf","SCHEMA"===s.category),n.xp6(1),n.Q6J("ngIf","GEN"===s.category)}}function re(f,y){1&f&&n.YNc(0,ie,5,3,"div",15),2&f&&n.Q6J("ngIf",y.$implicit)}function ce(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",11)(1,"div",1)(2,"div",12)(3,"span",3),n._uU(4,"APIs"),n.qZA(),n.TgZ(5,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return n.KtG(r.tab.api=p.value)}),n.YNc(6,ae,1,1,"ng-template",13),n.YNc(7,re,1,1,"ng-template",14),n.qZA()()()()}if(2&f){const s=n.oxw();n.xp6(5),n.Q6J("options",s.tab.apiList)("ngModel",s.tab.api)("filter",!0)}}function B(f,y){1&f&&n._UZ(0,"p-progressSpinner",20)}let K=(()=>{class f{fb;generalS;webSocketEventsS;ns;constantsS;authCS;instanceS;navigationCS;tpStoreApiVersionS;tpInstalledApisS;functionS;dataProviderS;cd;EFormMode=e.D;form;subscriptions=[];tab={};apiCategories;loading={dropdown:!0};EAPICategory=P.R;tpAPIVersionMap={};apiCategoriesMap={};dbIdMap={};colIdMap={};tpLibraryMap={};tpPIMap={};constructor(s,t,p,r,d,C,l,g,v,T,h,_,b){this.fb=s,this.generalS=t,this.webSocketEventsS=p,this.ns=r,this.constantsS=d,this.authCS=C,this.instanceS=l,this.navigationCS=g,this.tpStoreApiVersionS=v,this.tpInstalledApisS=T,this.functionS=h,this.dataProviderS=_,this.cd=b}ngOnInit(){this.loadApiCategories().then()}loadApiCategories(){var s=this;return(0,S.Z)(function*(){const t=s.dataProviderS.getApiCategoriesForWebSocketAndGroup();s.apiCategories=t.filter(r=>r.id!==P.R.SCHEDULERS&&r.id!==P.R.EVENTS),s.apiCategoriesMap=M.keyBy(s.apiCategories,O.GR.id);const p=s.navigationCS.getQueryParam(E.p.at_category);p&&s.tab&&(s.tab.apiCategory=M.find(s.apiCategories,{id:p})),s.tab.apiCategory||(s.tab.apiCategory=s.apiCategories[0]),yield s.apiCategoryChangedEvent(!1),yield s.categorySelected(!1),s.cd.detectChanges()})()}apiCategoryChangedEvent(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0,t.resetDependentObjects("INSTANCE"),yield t.categorySelected(s),t.tab.apiCategory.id===P.R.INSTANCES?yield t.loadInstances(s):t.tab.apiCategory.id===P.R.THIRD_PARTY_APIS?yield t.loadLibraries(s):t.tab.apiCategory.id===P.R.CUSTOM_APIS?yield t.loadCustomAPIs(s):t.tab.apiCategory.id===P.R.SYSTEM_APIS&&(yield t.loadSystemAPIs(s)),t.loading.dropdown=!1})()}loadInstances(s){var t=this;return(0,S.Z)(function*(){t.resetDependentObjects("INSTANCE"),yield t.categorySelected(s),t.loading.dropdown=!0;try{const r={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(r).toPromise()).data||[]}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allInstances=[]}const p=t.navigationCS.getQueryParam(E.p.at_instance);p&&(t.tab.instance=M.find(t.tab.allInstances,{name:p})),!t.tab.instance&&t.tab.allInstances.length&&(t.tab.instance=t.tab.allInstances[0]),yield t.loadDatabases(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadDatabases(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("DATABASE"),yield t.setInstanceInURL(s),!t.tab.instance)return t.tab.allDatabases=[],t.tab.allCollections=[],void(t.tab.apiList=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance]).toPromise()).data||[])[0]||[],t.dbIdMap=M.keyBy(t.tab.allDatabases,O.N7.db)}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allDatabases=[]}const p=t.navigationCS.getQueryParam(E.p.at_database);p&&(t.tab.database=M.find(t.tab.allDatabases,{db:p})),!t.tab.database&&t.tab.allDatabases.length&&(t.tab.database=t.tab.allDatabases[0]),yield t.loadCollections(s),t.loading.dropdown=!1})()}loadCollections(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("COLLECTION"),yield t.setDatabaseInURL(s),!t.tab.instance||!t.tab.database)return t.tab.allCollections=[],void(t.tab.apiList=[]);try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database]).toPromise()).data||[])[0]||[],t.colIdMap=M.keyBy(t.tab.allCollections,O.GR.name)}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allCollections=[]}const p=t.navigationCS.getQueryParam(E.p.at_collection);t.tab.collection=p?M.find(t.tab.allCollections,{name:p}):t.tab.allCollections[0],yield t.loadInstanceAPIs(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadInstanceAPIs(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,yield t.setCollectionInURL(s),!t.tab.instance||!t.tab.database||!t.tab.collection)return t.tab.apiList=[],void(t.loading.dropdown=!1);try{const r=t.tab.collection;r.removeStreamApisInResponse=!0,t.tab.apiList=(yield t.instanceS.instanceAPIList([r])).data||[]}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.apiList=[]}const p=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(p)})()}loadLibraries(s){var t=this;return(0,S.Z)(function*(){t.resetDependentObjects("LIBRARY"),t.loading.dropdown=!0,t.tab.allApiBundles=yield t.tpStoreApiVersionS.getAllAPIBundles(),t.tpLibraryMap=M.keyBy(t.tab.allApiBundles,"value");const p=t.navigationCS.getQueryParam(E.p.at_bundleName);p&&(t.tab.tpApiBundle=M.find(t.tab.allApiBundles,{value:p})),!t.tab.tpApiBundle&&t.tab.allApiBundles.length&&(t.tab.tpApiBundle=t.tab.allApiBundles[0]),yield t.loadStoreApiVersions(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadStoreApiVersions(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("API_VERSION"),yield t.setLibraryInURL(s),!t.tab.tpApiBundle)return t.tab.allStoreApiVersions=[],void(t.tab.apiList=[]);t.tab.allStoreApiVersions=yield t.tpStoreApiVersionS.getAllStoreApiVersions([t.tab.tpApiBundle.value]);const p=t.navigationCS.getQueryParam(E.p.at_bundleName),r=t.navigationCS.getQueryParam(E.p.at_apiVersion);r&&(t.tab.tpStoreApiVersion=M.find(t.tab.allStoreApiVersions,{apiBundleName:p,storeApiVersion:r})),!t.tab.tpStoreApiVersion&&t.tab.allStoreApiVersions.length&&(t.tab.tpStoreApiVersion=t.tab.allStoreApiVersions[0]),yield t.loadThirdPartyAPIs(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadThirdPartyAPIs(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,yield t.setTPApiVersionInURL(s),!t.tab.tpApiBundle||!t.tab.tpStoreApiVersion)return void(t.tab.apiList=[]);t.tab.apiList=(yield t.tpInstalledApisS.getThirdPartyAPIListArray([t.tab.tpStoreApiVersion]).toPromise()).data,t.tpPIMap=M.keyBy(t.tab.apiList,O.iH._id);const p=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(p)})()}loadCustomAPIs(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0;const p=yield t.functionS.getFunctionsAsAPI().toPromise();p.success&&p.data&&p.data.length&&(t.tab.apiList=p.data||[]);const r=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(r)})()}loadSystemAPIs(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0;const p=yield t.instanceS.systemAPIList().toPromise();p?.data?.length&&(t.tab.apiList=p.data||[]);const r=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(r)})()}apiCommon(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0,s?(t.tab.api=M.find(t.tab.apiList,{id:s}),t.tab.api||(t.tab.api=M.find(t.tab.apiList,{name:s}))):t.tab.api=t.tab.apiList[0],yield t.setApiInURL(),t.loading.dropdown=!1})()}categorySelected(s){var t=this;return(0,S.Z)(function*(){t.tab.apiCategory&&(yield t.navigationCS.setQueryParam(E.p.at_category,t.tab.apiCategory.id),s&&(yield t.generalS.resetUrlParams([E.p.at_instance,E.p.at_database,E.p.at_collection,E.p.at_bundleName,E.p.at_apiVersion,E.p.at_api])))})()}resetDependentObjects(s){"INSTANCE"===s?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===s?(this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===s?(this.tab.allCollections=this.tab.apiList=[],this.tab.collection=this.tab.api=void 0):"LIBRARY"===s?(this.tab.allApiBundles=this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpApiBundle=this.tab.api=this.tab.tpStoreApiVersion=void 0):"API_VERSION"===s&&(this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpStoreApiVersion=this.tab.api=void 0)}setInstanceInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.instance&&t.tab.instance._id&&(yield t.navigationCS.setQueryParam(E.p.at_instance,t.tab.instance._id),s&&(yield t.generalS.resetUrlParams([E.p.at_database,E.p.at_collection,E.p.at_api])))})()}setDatabaseInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.database&&t.tab.database._id&&(yield t.navigationCS.setQueryParam(E.p.at_database,t.tab.database._id),s&&(yield t.generalS.resetUrlParams([E.p.at_collection,E.p.at_api])))})()}setCollectionInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.collection&&t.tab.collection._id&&(yield t.navigationCS.setQueryParam(E.p.at_collection,t.tab.collection._id),s&&(yield t.generalS.resetUrlParams([E.p.at_api])))})()}setLibraryInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.tpApiBundle&&t.tab.tpApiBundle.value&&(yield t.navigationCS.setQueryParam(E.p.at_bundleName,t.tab.tpApiBundle.value),s&&(yield t.generalS.resetUrlParams([E.p.at_apiVersion,E.p.at_api])))})()}setTPApiVersionInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.tpStoreApiVersion&&t.tab.tpStoreApiVersion._id&&(yield t.navigationCS.setQueryParam(E.p.at_apiVersion,t.tab.tpStoreApiVersion._id),s&&(yield t.generalS.resetUrlParams([E.p.at_api])))})()}setApiInURL(){var s=this;return(0,S.Z)(function*(){s.tab?.api?.id&&(yield s.navigationCS.setQueryParam(E.p.at_api,s.tab.api.id))})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(t){return new(t||f)(n.Y36(I.qu),n.Y36(w.b),n.Y36(Z.a),n.Y36(W.W),n.Y36(G.L),n.Y36(i.D),n.Y36(Y.E),n.Y36(Q.S),n.Y36(J.f),n.Y36(V.d),n.Y36(H.d),n.Y36(U.B),n.Y36(n.sBO))};static \u0275cmp=n.Xpm({type:f,selectors:[["app-web-socket-events-form-second"]],decls:13,vars:7,consts:[[1,"container","mt-3"],[1,"row"],[1,"col-4"],[1,"small"],["optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],["class","row",4,"ngIf"],["class","container mt-3 mb-3",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["class","col-4",4,"ngIf"],["optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],["optionLabel","displayText","filterBy","displayText","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],[1,"container","mt-3","mb-3"],[1,"col-8"],["pTemplate","item"],["pTemplate","selectedItem"],[4,"ngIf"],["class","small text-success italic",4,"ngIf"],["class","small text-info italic",4,"ngIf"],[1,"small","text-success","italic"],[1,"small","text-info","italic"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(t,p){1&t&&(n.TgZ(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"span",3),n._uU(5,"API Category"),n.qZA(),n.TgZ(6,"p-dropdown",4),n.NdJ("onChange",function(d){return p.tab.apiCategory=d.value,p.apiCategoryChangedEvent(!0)}),n.qZA()()()(),n.TgZ(7,"div",0),n.YNc(8,z,7,5,"div",5),n.qZA(),n.TgZ(9,"div",0),n.YNc(10,L,6,4,"div",5),n.qZA(),n.YNc(11,ce,8,3,"div",6),n.YNc(12,B,1,0,"p-progressSpinner",7),n.qZA()),2&t&&(n.xp6(6),n.Q6J("options",p.apiCategories)("ngModel",p.tab.apiCategory)("filter",!0),n.xp6(2),n.Q6J("ngIf",p.tab.apiCategory.id===p.EAPICategory.INSTANCES),n.xp6(2),n.Q6J("ngIf",p.tab.apiCategory.id===p.EAPICategory.THIRD_PARTY_APIS),n.xp6(1),n.Q6J("ngIf",p.tab.apiCategory.id!==p.EAPICategory.WEB_SOCKET_EVENT),n.xp6(1),n.Q6J("ngIf",p.loading.dropdown))},dependencies:[I.JJ,I.On,q.O5,N.jx,j.G,D.Lt],encapsulation:2})}return f})()},2726:(_e,k,c)=>{c.d(k,{x:()=>h});var S=c(5861),e=c(4946),P=c(3157),M=c(328),o=c(6990),O=c(5085),n=c(6212),I=c(1162),w=c(6925),Z=c(7240),W=c(9961),G=c(262),i=c(5852),Y=c(7414),Q=c(2915),J=c(5405),V=c(7629),H=c(2189),U=c(5219),q=c(7664),N=c(95),j=c(6814),D=c(5431),R=c(7680),X=c(3259),z=c(8057),ee=c(8980);const L=["webSocketEventsManFormC"];function F(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.navigateToTreeView())}),e._UZ(1,"i",18),e.qZA()}}function te(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.edit())}),e._UZ(1,"i",20),e.qZA()}}function ne(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function ae(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,te,2,0,"span",15),e.YNc(5,ne,2,0,"span",16),e.qZA()}if(2&_){const a=e.oxw();e.xp6(3),e.Q6J("ngIf",a.rows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length)}}function oe(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(u){e.CHM(a);const A=e.oxw();return e.KtG(A.eventCenterS.group.apisRegex.allWebSocketEvents=u)}),e.qZA()()()}if(2&_){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.group.apisRegex.allWebSocketEvents)("binary",!0)}}function se(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(u){e.CHM(a);const A=e.oxw();return e.KtG(A.eventCenterS.filterInLog.apisRegex.allWebSocketEvents=u)}),e.qZA()()()}if(2&_){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)("binary",!0)}}function ie(_,b){if(1&_&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&_){const a=e.oxw();e.xp6(2),e.Oqu(a.constantsS.group.allWebSocketEventsPermitted)}}function re(_,b){1&_&&(e.TgZ(0,"th",36),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function ce(_,b){1&_&&e._UZ(0,"th",37)}function B(_,b){1&_&&e._UZ(0,"th",38)}function K(_,b){if(1&_&&(e.TgZ(0,"tr"),e.YNc(1,re,2,0,"th",32),e.YNc(2,ce,1,0,"th",33),e.TgZ(3,"th",34),e._uU(4,"API Category"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Name"),e.qZA(),e.YNc(7,B,1,0,"th",35),e.qZA()),2&_){const a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(1),e.Q6J("ngIf",!a.isDependentOnGroup&&!a.isLPM&&!a.isFilterLogTable),e.xp6(5),e.Q6J("ngIf",a.isLPM)}}function f(_,b){if(1&_&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",41),e.qZA()),2&_){const a=e.oxw().$implicit;e.xp6(1),e.Q6J("value",a)("pSelectableRow",a)}}function y(_,b){if(1&_&&(e.TgZ(0,"td",42)(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().rowIndex;e.xp6(2),e.Oqu(a+1)}}function s(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"span"),e._uU(4," \u2192 "),e.qZA(),e.TgZ(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span"),e._uU(8," \u2192 "),e.qZA(),e.TgZ(9,"span"),e._uU(10),e.qZA(),e.TgZ(11,"span"),e._uU(12," \u2192 "),e.qZA(),e.TgZ(13,"span"),e._uU(14),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.instanceNameUI),e.xp6(4),e.Oqu(a.databaseName),e.xp6(4),e.Oqu(a.collectionName),e.xp6(4),e.Oqu(a.apiNameUI)}}function t(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"span"),e._uU(4," \u2192 "),e.qZA(),e.TgZ(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span"),e._uU(8," \u2192 "),e.qZA(),e.TgZ(9,"span"),e._uU(10),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiBundleNameUI),e.xp6(4),e.Oqu(a.storeApiVersionUI),e.xp6(4),e.Oqu(a.apiNameUI)}}function p(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function r(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function d(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function C(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"div")(1,"label",43)(2,"p-checkbox",44),e.NdJ("ngModelChange",function(){e.CHM(a);const u=e.oxw(2).$implicit,A=e.oxw(2);return e.KtG(A.checkedChangeGridItem(u))})("ngModelChange",function(u){e.CHM(a);const A=e.oxw(2).$implicit;return e.KtG(A.saveResponseInLog=u)}),e.qZA()()()}if(2&_){const a=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",a.saveResponseInLog)("binary",!0)}}function l(_,b){if(1&_&&(e.TgZ(0,"td"),e.YNc(1,C,3,2,"div",6),e.qZA()),2&_){const a=e.oxw().$implicit,m=e.oxw(2);e.xp6(1),e.Q6J("ngIf",m.selectedRows.indexOf(a)>=0)}}function g(_,b){if(1&_&&(e.TgZ(0,"tr",39),e.YNc(1,f,2,2,"td",6),e.YNc(2,y,3,1,"td",40),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e.YNc(6,s,15,4,"div",6),e.YNc(7,t,11,3,"div",6),e.YNc(8,p,3,1,"div",6),e.YNc(9,r,3,1,"div",6),e.YNc(10,d,3,1,"div",6),e.qZA(),e.YNc(11,l,2,1,"td",6),e.qZA()),2&_){const a=b.$implicit,m=e.oxw(2);e.Q6J("pSelectableRow",a),e.xp6(1),e.Q6J("ngIf",m.showCheckbox),e.xp6(1),e.Q6J("ngIf",!m.isDependentOnGroup&&!m.isLPM&&!m.isFilterLogTable),e.xp6(2),e.Oqu(a.categoryUI),e.xp6(2),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.INSTANCES),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.THIRD_PARTY_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.SYSTEM_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.CUSTOM_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.WEB_SOCKET_EVENT),e.xp6(1),e.Q6J("ngIf",m.isLPM)}}function v(_,b){1&_&&e._UZ(0,"p-progressSpinner",45)}function T(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(u){e.CHM(a);const A=e.oxw();return e.KtG(A.selectedRows=u)})("selectionChange",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.webSocketEventSelected())})("dblclick",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.dblClickWebSocketEvent())}),e.YNc(2,K,8,3,"ng-template",29),e.YNc(3,g,12,10,"ng-template",30),e.qZA(),e.YNc(4,v,1,0,"p-progressSpinner",31),e.qZA()}if(2&_){const a=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",a.metaKeySelection)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.xp6(3),e.Q6J("ngIf",a.loading.grid)}}let h=(()=>{class _{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;showCheckbox=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:M.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=I.iH._id;EAPICategory=O.R;ERequestMethod=w.Yp;webSocketEventsManFormC;constructor(a,m,u,A,x,le,de,pe,me,ge,ve,fe){this.generalS=a,this.notificationS=m,this.webSocketEventsS=u,this.authCS=A,this.constantsS=x,this.eventCenterS=le,this.cd=de,this.eventCenterCS=pe,this.functionS=me,this.navigationCS=ge,this.confirmationService=ve,this.router=fe}ngOnInit(){var a=this;this.loadGridData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(m=>{(m.action===P.F.SAVED||m.action===P.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadGridData().then())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var m=(0,S.Z)(function*(u){u.length&&(yield a.loadGridData())});return function(u){return m.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(m=>{m&&this.loadGridData().then()})),this.generalS.setNewTitle("API Maker - WebSocket Events")}loadGridData(){var a=this;return(0,S.Z)(function*(){if(a.isDependentOnGroup&&0===a.eventCenterS.group.selectedGroups.value.length)return void a.resetGridAndUrl();a.loading.grid=!0;const m=yield a.webSocketEventsS.getWSEventKGrid({}).toPromise();m.success?(a.selectedRows=[],a.rows=m.data,a.rowsMap=o.keyBy(a.rows,I.iH._id),a.rowsMapName=o.keyBy(a.rows,I.of.id)):a.resetGridAndUrl();const u=a.navigationCS.getQueryParam(n.p.am_ws_event)||(a.isFilterLogTable?a.eventCenterS.filterInLog.webSocketIds.value.join(","):a.eventCenterS.group.webSocketIds.value.join(","));if(u){const A=u.split(","),x=o.intersection(o.keys(a.rowsMap),A),le=[];for(const de of x)a.rowsMap[de]&&le.push(a.rowsMap[de]);a.selectedRows=le,a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next(le),a.eventCenterS.filterInLog.webSocketIds.next(x)}if(a.isDependentOnGroup&&a.eventCenterS.group.webSocketIds.value.length&&(a.selectedRows=a.generalS.getObjectsFromIdArray(a.eventCenterS.group.webSocketIds.value,a.rowsMap),a.eventCenterS.group.webSocketApis.next(a.selectedRows)),a.isLPM&&a.eventCenterS.group.selectedGroups.value[0]?.queryParams?.webSocketEventNames?.length){const A=a.eventCenterS.group.selectedGroups.value[0];for(const x of A?.queryParams?.webSocketEventNames)a.rowsMapName[x]&&(a.rowsMapName[x].saveResponseInLog=A.webSocketEventsLog?.[x]?.saveResponseInLog||!1);a.setResDataInEventCenter()}setTimeout(()=>{a.loading.grid=!1,a.cd.detectChanges()},100)})()}add(){this.data.formData=void 0,this.data.mode=M.D.ADD,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}view(){this.data.formData=this.selectedRows[0],this.data.mode=M.D.VIEW,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_VIEW_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=M.D.EDIT,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal()}removePermanentDialog(){var a=this;return(0,S.Z)(function*(){var m;a.confirmationService.confirm({message:a.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(m=(0,S.Z)(function*(){yield a.removePermanent()}),function(){return m.apply(this,arguments)})})})()}removePermanent(){var a=this;return(0,S.Z)(function*(){a.loading.grid=!0;const m=yield a.webSocketEventsS.permanentDelete(a.selectedRows[0]._id).toPromise();a.loading.grid=!1,m.success?(a.notificationS.showSuccess(a.constantsS.webSocketEvents.removePermanent),a.resetGridAndUrl(),a.loadGridData().then(),a.selectedRows=[]):a.notificationS.showErrorFromResponse(m,a.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}dblClickWebSocketEvent(){this.selectedRows.length&&this.edit()}navigateToTreeView(){this.router.navigate(["api-info","web-socket-events","layout-tree"]).then()}resetThisUrl(){var a=this;return(0,S.Z)(function*(){a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield a.navigationCS.setQueryParam(n.p.am_ws_event,null)})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.webSocketApis.next(this.selectedRows),this.eventCenterS.group.selectedWebSocket.next(this.selectedRows),this.eventCenterS.group.webSocketIds.next(o.map(this.selectedRows,"_id"))),this.isFilterLogTable&&this.eventCenterS.filterInLog.webSocketApis.next(this.selectedRows)}webSocketEventSelected(){var a=this;return(0,S.Z)(function*(){if(a.fillData().then(),a.selectedRows?.[0]){const m=(a.selectedRows[0]?.nameUI||"").split("/");a.generalS.setNewTitle(m[m.length-1],O.R.WEB_SOCKET_EVENT)}})()}fillData(){var a=this;return(0,S.Z)(function*(){if(!a.selectedRows.length)return yield a.navigationCS.setQueryParam(n.p.am_ws_event,""),a.eventCenterS.group.webSocketIds.next([]),a.eventCenterS.group.webSocketApis.next([]),a.eventCenterS.filterInLog.webSocketIds.next([]),void a.eventCenterS.filterInLog.webSocketApis.next([]);if(a.isDependentOnGroup||a.isFilterLogTable)a.eventCenterS.group.webSocketIds.next(o.map(a.selectedRows,"_id")),a.eventCenterS.group.webSocketApis.next(a.selectedRows),a.isFilterLogTable&&(a.eventCenterS.filterInLog.webSocketIds.next(o.map(a.selectedRows,"_id")),a.eventCenterS.filterInLog.webSocketApis.next(a.selectedRows));else{const m=(yield a.webSocketEventsS.getById(a.selectedRows[0]._id).toPromise()).data;m._id?(yield a.navigationCS.setQueryParam(n.p.am_ws_event,m._id),a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([m])):a.resetThisUrl()}})()}checkedChangeGridItem(a){var m=this;setTimeout((0,S.Z)(function*(){m.selectedRows.push(a),m.selectedRows=o.uniq(m.selectedRows);for(const u in m.rowsMap){const A=m.rowsMap[u];-1===m.selectedRows.indexOf(A)&&(A.saveResponseInLog=!1)}m.setResDataInEventCenter(),m.cd.detectChanges()}),100)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(m){return new(m||_)(e.Y36(Z.b),e.Y36(W.W),e.Y36(G.a),e.Y36(i.D),e.Y36(Y.L),e.Y36(Q.u),e.Y36(e.sBO),e.Y36(J.M),e.Y36(V.d),e.Y36(H.S),e.Y36(U.YP),e.Y36(q.F0))};static \u0275cmp=e.Xpm({type:_,selectors:[["app-web-socket-events-grid"]],viewQuery:function(m,u){if(1&m&&e.Gf(L,5),2&m){let A;e.iGM(A=e.CRH())&&(u.webSocketEventsManFormC=A.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/web.svg","alt","WebSocket Events",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/pages/web-socket-event-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All WebSocket Events",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["webSocketEventsManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Tree View",1,"fas","fa-sitemap","text-yellow","fa-fw","fa-rotate-270"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All WebSocket Events",1,"float-right","cursor-pointer"],[1,"align-middle","mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped ws-events-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","200px"],["style","width: 60px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(m,u){1&m&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," WebSocket Events"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,ae,6,3,"span",6),e.YNc(9,oe,3,2,"span",7),e.YNc(10,se,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,ie,3,1,"div",6),e.YNc(13,T,5,7,"div",9),e.qZA()(),e._UZ(14,"app-web-socket-events-man-form",10,11)),2&m&&(e.xp6(8),e.Q6J("ngIf",!u.isDependentOnGroup&&!u.isLPM&&!u.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",u.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",u.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",u.eventCenterS.group.apisRegex.allWebSocketEvents||u.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),e.xp6(1),e.Q6J("ngIf",!(u.eventCenterS.group.apisRegex.allWebSocketEvents||u.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)),e.xp6(1),e.Q6J("data",u.data))},dependencies:[N.JJ,N.On,j.O5,D.iA,U.jx,D.Ei,D.UA,D.Mo,R.G,X.u,z.XZ,ee.D],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return _})()},8980:(_e,k,c)=>{c.d(k,{D:()=>r});var S=c(5861),e=c(95),P=c(3157),M=c(328),o=c(7850),E=c(6990),n=c(9361),I=c(6212),w=c(1162),Z=c(553),W=c(3531),G=c(9989),i=c(4946),Y=c(7240),Q=c(262),J=c(9961),V=c(7414),H=c(5852),U=c(2304),q=c(2559),N=c(3429),j=c(4977),D=c(2189),R=c(6814),X=c(2660),z=c(5860),ee=c(756),L=c(7680),F=c(4844),te=c(3259),ne=c(8057),ae=c(4061);const oe=["webSocketEventsFormSecondC"],se=["insertCodeModalC"];function ie(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",30),i._uU(2," Add WebSocket Event"),i.qZA())}function re(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",31),i._uU(2," View WebSocket Event"),i.qZA())}function ce(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",32),i._uU(2," Edit WebSocket Event"),i.qZA())}function B(d,C){1&d&&(i.TgZ(0,"div",33)(1,"div",34)(2,"span",35),i._uU(3,"Name"),i.qZA(),i._UZ(4,"input",36),i.qZA()())}function K(d,C){if(1&d){const l=i.EpF();i.TgZ(0,"div",37)(1,"app-monaco-editor",38),i.NdJ("editorGenerated",function(v){i.CHM(l);const T=i.oxw();return i.KtG(T.editorGenerated(v))}),i.qZA()()}if(2&d){const l=i.oxw();i.xp6(1),i.Q6J("isSchemaEditor",!0)("editorOptions",l.editorOptionsSchedulers)}}function f(d,C){1&d&&(i.TgZ(0,"span"),i._uU(1,"Save"),i.qZA())}function y(d,C){1&d&&(i.TgZ(0,"span"),i._uU(1,"Update"),i.qZA())}function s(d,C){if(1&d){const l=i.EpF();i.TgZ(0,"button",39),i.NdJ("click",function(){i.CHM(l);const v=i.oxw();return i.KtG(v.save())}),i._UZ(1,"i",40),i.YNc(2,f,2,0,"span",4),i.YNc(3,y,2,0,"span",4),i.qZA()}if(2&d){const l=i.oxw();i.xp6(2),i.Q6J("ngIf",l.data.mode===l.EFormMode.ADD),i.xp6(1),i.Q6J("ngIf",l.data.mode===l.EFormMode.EDIT)}}function t(d,C){1&d&&i._UZ(0,"p-progressSpinner",41)}const p=function(d){return{"text-danger font-weight-bold":d}};let r=(()=>{class d{fb;generalCS;webSocketEventsS;ns;constantsS;authCS;monacoS;tpInstalledApisS;instanceS;tpStoreApiVersionS;navigationCS;cd;data;EFormMode=M.D;form;subscriptions=[];loading={form:!1};EAPICategory=o.R;reqActiveIndex=0;tabIndexReq={Basic:0,Code:1,Intervals:2};BE_HOST_PORT=Z.N.BE_HOST_PORT;DOCS_HOST_PORT=Z.N.DOCS_HOST_PORT;shouldLoadMonacoEditor=!1;editorWSNotifications;editorOptionsSchedulers={readOnly:!1,language:"typescript",contextmenu:!0};wsFormSecondC;insertCodeModalC;constructor(l,g,v,T,h,_,b,a,m,u,A,x){this.fb=l,this.generalCS=g,this.webSocketEventsS=v,this.ns=T,this.constantsS=h,this.authCS=_,this.monacoS=b,this.tpInstalledApisS=a,this.instanceS=m,this.tpStoreApiVersionS=u,this.navigationCS=A,this.cd=x}ngOnInit(){var l=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var g=(0,S.Z)(function*(v){if(v)if(l.form.enable(),v.action===P.F.OPEN_FORM_IN_EDIT_MODE){if(!l.data.formData)return;const T=yield l.webSocketEventsS.getById(l.data.formData._id).toPromise();l.form.reset(),yield l.editModelLoadData(T.data),l.form.patchValue(T.data)}else if(v.action===P.F.OPEN_FORM_IN_VIEW_MODE){if(!l.data.formData)return;const T=yield l.webSocketEventsS.getById(l.data.formData._id).toPromise();l.form.reset(),l.form.patchValue(T.data),l.form.disable()}else if(v.action===P.F.OPEN_FORM_IN_ADD_MODE){l.form.reset();const T=yield l.instanceS.getDefaultContent(l.BE_HOST_PORT,o.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE).toPromise();l.generalCS.setValueInEditor(l,"editorWSNotifications",T.data)}});return function(v){return g.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[e.kI.required]],runOnNativeProcess:[!1,[]]})}showInsertCodeModel(){this.generalCS.messageReceivedFor=n.H.All,this.insertCodeModalC.showModal(W.b.WebSocketFormC)}showModal(){var l=this;return(0,S.Z)(function*(){l.shouldLoadMonacoEditor=!0,$("#idWebSocketEventsForm").modal("show"),setTimeout((0,S.Z)(function*(){yield l.wsFormSecondC.loadApiCategories()}),100)})()}hideModal(){$("#idWebSocketEventsForm").modal("hide")}editModelLoadData(l){var g=this;return(0,S.Z)(function*(){if(yield g.wsFormSecondC.categorySelected(!0),g.wsFormSecondC.tab.apiCategory=g.wsFormSecondC.apiCategoriesMap[l.apiCategory],yield g.navigationCS.setQueryParam(I.p.at_category,l.apiCategory),l.apiCategory===o.R.SYSTEM_APIS)yield g.navigationCS.setQueryParam(I.p.at_api,l.systemApiName);else if(l.apiCategory===o.R.CUSTOM_APIS)yield g.navigationCS.setQueryParam(I.p.at_api,l.customApiName);else if(l.apiCategory===o.R.INSTANCES)yield g.navigationCS.setQueryParam(I.p.at_instance,l.instanceName),yield g.navigationCS.setQueryParam(I.p.at_database,l.databaseName),yield g.navigationCS.setQueryParam(I.p.at_collection,l.collectionName),yield g.navigationCS.setQueryParam(I.p.at_api,l.instanceApiName);else if(l.apiCategory===o.R.THIRD_PARTY_APIS){const v=(yield g.tpInstalledApisS.query({find:{bundleName:l.tpInstalledApiBundleName,apiVersion:l.tpInstalledApiVersion,name:l.tpInstalledApiName,user:l.user,active:!0},limit:1}).toPromise())?.data?.[0];if(v){const T=(yield g.tpStoreApiVersionS.query({find:{apiBundleName:v.bundleName,storeApiVersion:v.apiVersion,user:v.user,active:!0},limit:1}).toPromise()).data?.[0];yield g.navigationCS.setQueryParam(I.p.at_bundleName,v.bundleName),yield g.navigationCS.setQueryParam(I.p.at_apiVersion,T.storeApiVersion),yield g.navigationCS.setQueryParam(I.p.at_api,v.name)}}g.generalCS.setValueInEditor(g,"editorWSNotifications",l.canUserConnectViaWSCode||"")})()}save(){var l=this;return(0,S.Z)(function*(){try{l.loading.form=!0;const g=l.form.getRawValue();let v;g.user=l.authCS.getUserId(),g.apiCategory=l.wsFormSecondC.tab.apiCategory.id,v=l.data.formData&&l.data.formData._id?(yield l.webSocketEventsS.getById(l.data.formData._id).toPromise()).data:{};const T=E.find(v.versions||[],{isActive:!0});T&&(T.apiCodeStr=l.editorWSNotifications.getValue());const h=Object.assign({},v,g);h.user=l.authCS.getUserId(),h.canUserConnectViaWSCode=l.editorWSNotifications.getValue();for(const b of h?.versions||[])b.version=b.version.toString();if(h.apiCategory===o.R.WEB_SOCKET_EVENT&&!h.name)return l.ns.showError("Please provide websocket events name.");let _;h.apiCategory===o.R.CUSTOM_APIS&&(h.customApiName=l.wsFormSecondC.tab.api.customApiName),h.apiCategory===o.R.SYSTEM_APIS&&(h.systemApiName=l.wsFormSecondC.tab.api.systemApiId),h.apiCategory===o.R.THIRD_PARTY_APIS&&(h.tpInstalledApiBundleName=l.wsFormSecondC.tab.api.bundleName,h.tpInstalledApiVersion=l.wsFormSecondC.tab.api.apiVersion,h.tpInstalledApiName=l.wsFormSecondC.tab.api.name),h.apiCategory===o.R.INSTANCES&&(h.instanceName=l.wsFormSecondC.tab.instance.name,h.databaseName=l.wsFormSecondC.tab.database.db,h.collectionName=l.wsFormSecondC.tab.collection.name,h.instanceApiName=l.wsFormSecondC.tab.api.id),h.apiCategory!==o.R.WEB_SOCKET_EVENT&&delete h.name,l.data.mode===M.D.ADD?_=yield l.webSocketEventsS.post(h).toPromise():l.data.mode===M.D.EDIT&&(_=yield l.webSocketEventsS.put(l.data.formData._id,h,{select:w.iH._id}).toPromise()),_&&(l.ns.showSuccess(l.data.mode===M.D.ADD?l.constantsS.webSocketEvents.addSuccess:l.constantsS.webSocketEvents.editSuccess),l.data.eventChannel.emit({action:l.data.mode===M.D.ADD?P.F.SAVED:P.F.UPDATED})),l.loading.form=!1}catch(g){l.loading.form=!1,l.ns.showErrorFromResponse(g.error||g,"Unable to save websocket event.")}l.cd.detectChanges()})()}editorGenerated(l){var g=this;return(0,S.Z)(function*(){g.editorWSNotifications=l,yield g.monacoS.loadSchemaEditorSettings(g.BE_HOST_PORT,g.authCS.getUserId(),null),g.monacoS.addSaveCodeKeyBinding(l,v=>{g.form.valid&&g.save()}),g.monacoS.addInsertCodeKeyBinding(l,v=>{g.generalCS.messageReceivedFor=n.H.All,g.data.mode!==M.D.VIEW&&g.insertCodeModalC.showModal(W.b.WebSocketFormC)}),g.subscriptions.push(g.generalCS.messageReceived.subscribe(v=>{v.type&&v.type===G.g.TEXT_COPIED&&v.componentName===W.b.WebSocketFormC&&(g.monacoS.insertAtCursor(l,v.selectedText),g.insertCodeModalC.hideModal())}))})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}ISchedulerProps=w.qH;static \u0275fac=function(g){return new(g||d)(i.Y36(e.qu),i.Y36(Y.b),i.Y36(Q.a),i.Y36(J.W),i.Y36(V.L),i.Y36(H.D),i.Y36(U.b),i.Y36(q.d),i.Y36(N.E),i.Y36(j.f),i.Y36(D.S),i.Y36(i.sBO))};static \u0275cmp=i.Xpm({type:d,selectors:[["app-web-socket-events-man-form"]],viewQuery:function(g,v){if(1&g&&(i.Gf(oe,5),i.Gf(se,5)),2&g){let T;i.iGM(T=i.CRH())&&(v.wsFormSecondC=T.first),i.iGM(T=i.CRH())&&(v.insertCodeModalC=T.first)}},inputs:{data:"data"},decls:34,vars:16,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idWebSocketEventsForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],[1,"w-100",3,"activeIndex","activeIndexChange"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],["webSocketEventsFormSecondC",""],["class","form-group row m-0",4,"ngIf"],[1,"form-group","row"],[1,"col-12"],[1,"align-middle","mb-0","ml-3"],["formControlName","runOnNativeProcess","pTooltip","Code will run on actual process and not in sandbox, so be careful with code. You can not use sandbox packages in this mode. You can use all Node.js packages + some packages on which API Maker is dependent on. You can use features of global variable 'g'.","label","Run Code On Native Process",3,"ngClass","binary"],["header","Code"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"form-group","row","m-0"],[1,"col-4"],[1,"small"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","level1/level2/name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(g,v){if(1&g&&(i.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),i.YNc(4,ie,3,0,"span",4),i.YNc(5,re,3,0,"span",4),i.YNc(6,ce,3,0,"span",4),i.TgZ(7,"div",5)(8,"button",6)(9,"span",7),i._UZ(10,"i",8),i.qZA()(),i.TgZ(11,"span",9),i.NdJ("click",function(){return v.showInsertCodeModel()}),i._UZ(12,"i",10),i.qZA()()(),i.TgZ(13,"div",11)(14,"p-tabView",12),i.NdJ("activeIndexChange",function(h){return v.reqActiveIndex=h}),i.TgZ(15,"p-tabPanel",13)(16,"form",14),i._UZ(17,"app-web-socket-events-form-second",null,15),i.YNc(19,B,5,0,"div",16),i.TgZ(20,"div",17)(21,"div",18)(22,"label",19),i._UZ(23,"p-checkbox",20),i.qZA()()()()(),i.TgZ(24,"p-tabPanel",21),i.YNc(25,K,2,2,"div",22),i.qZA()()(),i.TgZ(26,"div",23)(27,"button",24),i._UZ(28,"i",25),i._uU(29," Close"),i.qZA(),i.YNc(30,s,4,2,"button",26),i.qZA(),i.YNc(31,t,1,0,"p-progressSpinner",27),i.qZA()()(),i._UZ(32,"app-insert-code-modal",28,29)),2&g){const T=i.MAs(18);i.xp6(4),i.Q6J("ngIf",v.data.mode===v.EFormMode.ADD),i.xp6(1),i.Q6J("ngIf",v.data.mode===v.EFormMode.VIEW),i.xp6(1),i.Q6J("ngIf",v.data.mode===v.EFormMode.EDIT),i.xp6(8),i.Q6J("activeIndex",v.reqActiveIndex),i.xp6(2),i.Q6J("formGroup",v.form),i.xp6(3),i.Q6J("ngIf",T.tab.apiCategory.id===v.EAPICategory.WEB_SOCKET_EVENT),i.xp6(4),i.Q6J("ngClass",i.VKq(14,p,!0===v.form.get(v.ISchedulerProps.runOnNativeProcess).value))("binary",!0),i.xp6(2),i.Q6J("ngIf",v.shouldLoadMonacoEditor),i.xp6(5),i.Q6J("ngIf",v.data.mode!==v.EFormMode.VIEW),i.xp6(1),i.Q6J("ngIf",v.loading.form),i.xp6(1),i.Q6J("frameId","idInsertCodeWebSocketFrame")("modalId","idInsertCodeWebSocketModal")("docsHostPort",v.DOCS_HOST_PORT)}},dependencies:[e._Y,e.Fj,e.JJ,e.JL,e.sg,e.u,R.mk,R.O5,X.y,z.P,ee.O,L.G,F.xf,F.x4,te.u,ne.XZ,ae.T],encapsulation:2})}return d})()},1025:(_e,k,c)=>{c.r(k),c.d(k,{WebSocketEventsM:()=>s});var S=c(7664),e=c(7359),P=c(3726),o=(c(4061),c(4946)),E=c(2726);let O=(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-layout-grid"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0),o._UZ(1,"app-web-socket-events-grid",1),o.qZA()),2&d&&(o.xp6(1),o.Q6J("showCheckbox",!1))},dependencies:[E.x],encapsulation:2})}return t})();var n=c(5861),I=c(3157),w=c(328),Z=c(5085),W=c(6212),G=c(1162),i=c(6925),Y=c(7240),Q=c(9961),J=c(262),V=c(5852),H=c(7414),U=c(2915),q=c(5405),N=c(7629),j=c(2189),D=c(5219),R=c(6814),X=c(1396),z=c(7680),ee=c(3259),L=c(8980);const F=["webSocketEventsManFormC"];function te(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"span",19),o.NdJ("click",function(){o.CHM(r);const C=o.oxw();return o.KtG(C.edit())}),o._UZ(1,"i",20),o.qZA()}}function ne(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"span",21),o.NdJ("click",function(){o.CHM(r);const C=o.oxw();return o.KtG(C.removePermanentDialog())}),o._UZ(1,"i",22),o.qZA()}}function ae(t,p){if(1&t&&(o.TgZ(0,"div")(1,"div",23),o._uU(2),o.qZA()()),2&t){const r=o.oxw();o.xp6(2),o.Oqu(r.constantsS.group.allWebSocketEventsPermitted)}}function oe(t,p){if(1&t&&(o.TgZ(0,"div"),o._uU(1),o.qZA()),2&t){const r=o.oxw().$implicit;o.xp6(1),o.Oqu(r.label)}}const se=function(t,p,r,d){return{get:t,put:p,post:r,delete:d}};function ie(t,p){if(1&t&&(o.TgZ(0,"div")(1,"span",25),o._uU(2),o.qZA(),o.TgZ(3,"span"),o._uU(4),o.qZA()()),2&t){const r=o.oxw().$implicit,d=o.oxw();o.xp6(1),o.Q6J("ngClass",o.l5B(3,se,r.data.requestMethod===d.ERequestMethod.GET,r.data.requestMethod===d.ERequestMethod.PUT,r.data.requestMethod===d.ERequestMethod.POST,r.data.requestMethod===d.ERequestMethod.DELETE)),o.xp6(1),o.Oqu(r.data.requestMethod),o.xp6(2),o.Oqu(r.data.name||r.label)}}function re(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"div",24),o.NdJ("click",function(){const l=o.CHM(r).$implicit,g=o.oxw();return l.children&&(l.isExpanded=!0),o.KtG(g.selectedRows=[l._id])}),o.YNc(1,oe,2,1,"div",12),o.YNc(2,ie,5,8,"div",12),o.qZA()}if(2&t){const r=p.$implicit,d=o.oxw();o.xp6(1),o.Q6J("ngIf",(null==r.children?null:r.children.length)||(null==r||null==r.data?null:r.data.apiCategory)!==d.EAPICategory.CUSTOM_APIS),o.xp6(1),o.Q6J("ngIf",!(null!=r.children&&r.children.length)&&(null==r||null==r.data?null:r.data.apiCategory)===d.EAPICategory.CUSTOM_APIS)}}function ce(t,p){1&t&&o._UZ(0,"p-progressSpinner",26)}let B=(()=>{class t{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new o.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=G.iH._id;EAPICategory=Z.R;ERequestMethod=i.Yp;treeNodes=[];allTreeItemsMap={};leafSelected=!1;webSocketEventsManFormC;constructor(r,d,C,l,g,v,T,h,_,b,a,m){this.generalS=r,this.notificationS=d,this.webSocketEventsS=C,this.authCS=l,this.constantsS=g,this.eventCenterS=v,this.cd=T,this.eventCenterCS=h,this.functionS=_,this.navigationCS=b,this.confirmationService=a,this.router=m}ngOnInit(){this.loadTreeData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(r=>{(r.action===I.F.SAVED||r.action===I.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadTreeData().then())})),this.generalS.setNewTitle("API Maker - WebSocket Events")}add(){this.data.formData=void 0,this.data.mode=w.D.ADD,this.data.eventChannel.emit({action:I.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.selectedRows.length&&(this.data.formData=this.selectedRows[0].data,this.data.mode=w.D.EDIT,this.data.eventChannel.emit({action:I.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal().then())}removePermanentDialog(){var r=this;return(0,n.Z)(function*(){var d;r.confirmationService.confirm({message:r.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,n.Z)(function*(){yield r.removePermanent()}),function(){return d.apply(this,arguments)})})})()}removePermanent(){var r=this;return(0,n.Z)(function*(){r.loading.grid=!0;const d=r.selectedRows[0].data,C=yield r.webSocketEventsS.permanentDelete(d._id).toPromise();r.loading.grid=!1,C.success?(r.notificationS.showSuccess(r.constantsS.webSocketEvents.removePermanent),r.resetGridAndUrl(),r.loadTreeData().then(),r.selectedRows=[]):r.notificationS.showErrorFromResponse(C,r.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}navigateToGrid(){var r=this;return(0,n.Z)(function*(){r.router.navigate(["api-info","web-socket-events","layout-grid"]).then()})()}loadTreeData(){var r=this;return(0,n.Z)(function*(){const d=(yield r.functionS.getWSEventKTree().toPromise()).data;for(const l of d)r.generalS.convertKTreeItemToPrimeNGTreeItem(l);const C={};r.generalS.getMapOfAllItems(C,d),r.generalS.setIsExpandedStateFromOldMap(r.allTreeItemsMap,C),r.treeNodes=d,r.allTreeItemsMap=C,r.loading.grid=!1,r.cd.detectChanges()})()}resetThisUrl(){var r=this;return(0,n.Z)(function*(){r.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield r.navigationCS.setQueryParam(W.p.am_ws_event,null)})()}selectedKeysChange(){var r=this;return(0,n.Z)(function*(){if(r.selectedRows.length){const d=r.selectedRows[0];d.children?.length?r.leafSelected=!1:(r.leafSelected=!0,d&&d?.label?r.generalS.setNewTitle(d.label,Z.R.WEB_SOCKET_EVENT):r.generalS.setNewTitle("API Maker - WebSocket Events"),yield r.resetThisUrl())}else r.leafSelected=!1})()}dblClickTreeEvent(){this.leafSelected&&this.selectedRows.length&&this.edit()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(d){return new(d||t)(o.Y36(Y.b),o.Y36(Q.W),o.Y36(J.a),o.Y36(V.D),o.Y36(H.L),o.Y36(U.u),o.Y36(o.sBO),o.Y36(q.M),o.Y36(N.d),o.Y36(j.S),o.Y36(D.YP),o.Y36(S.F0))};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-tree"]],viewQuery:function(d,C){if(1&d&&o.Gf(F,5),2&d){let l;o.iGM(l=o.CRH())&&(C.webSocketEventsManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"]},decls:22,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/web.svg","alt","WebSocket Events",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/pages/web-socket-event-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Grid View",1,"fas","fa-table","text-yellow","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],[1,"h-100"],["scrollHeight","flex","selectionMode","multiple",1,"w-full",3,"value","selection","selectionChange","dblclick"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["webSocketEventsManFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[1,"p-2","text-center","text-success"],[1,"w-100","prevent-text-selection","cursor-pointer",3,"click"],[1,"small","font-weight-bold","d-inline-block","mr-2",3,"ngClass"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0)(1,"div",1)(2,"span"),o._UZ(3,"img",2),o._uU(4," WebSocket Events"),o.qZA(),o.TgZ(5,"span")(6,"a",3),o._UZ(7,"img",4),o.qZA(),o.TgZ(8,"span",5),o.NdJ("click",function(){return C.add()}),o._UZ(9,"i",6),o.qZA(),o.TgZ(10,"span",7),o.NdJ("click",function(){return C.navigateToGrid()}),o._UZ(11,"i",8),o.qZA(),o.YNc(12,te,2,0,"span",9),o.YNc(13,ne,2,0,"span",10),o.qZA()(),o.TgZ(14,"div",11),o.YNc(15,ae,3,1,"div",12),o.TgZ(16,"div",13)(17,"p-tree",14),o.NdJ("selectionChange",function(g){return C.selectedRows=g})("dblclick",function(){return C.dblClickTreeEvent()})("selectionChange",function(){return C.selectedKeysChange()}),o.YNc(18,re,3,2,"ng-template",15),o.qZA(),o.YNc(19,ce,1,0,"p-progressSpinner",16),o.qZA()()(),o._UZ(20,"app-web-socket-events-man-form",17,18)),2&d&&(o.xp6(12),o.Q6J("ngIf",C.leafSelected),o.xp6(1),o.Q6J("ngIf",C.leafSelected),o.xp6(2),o.Q6J("ngIf",C.eventCenterS.group.apisRegex.allWebSocketEvents||C.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),o.xp6(2),o.Q6J("value",C.treeNodes)("selection",C.selectedRows),o.xp6(2),o.Q6J("ngIf",C.loading.grid),o.xp6(1),o.Q6J("data",C.data))},dependencies:[R.mk,R.O5,D.jx,X.mp,z.G,ee.u,L.D],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return t})();const f=[{path:"",redirectTo:"layout-tree",pathMatch:"full"},{path:"layout-tree",component:(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-layout-tree"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0),o._UZ(1,"app-web-socket-events-tree"),o.qZA())},dependencies:[B],encapsulation:2})}return t})(),canActivate:[P.P]},{path:"layout-grid",component:O,canActivate:[P.P]}];let s=(()=>{class t{static \u0275fac=function(d){return new(d||t)};static \u0275mod=o.oAB({type:t});static \u0275inj=o.cJS({imports:[S.Bz.forChild(f),e.u]})}return t})()}}]);
|