@sava-info-systems/api-maker-with-extensions 1.6.0 → 1.7.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/README.md +1 -1
- package/dist/1025.js +1 -1
- package/dist/148.js +1 -1
- package/dist/1558.js +1 -1
- package/dist/1678.js +1 -1
- package/dist/2295.js +1 -1
- package/dist/2443.js +1 -1
- package/dist/2473.js +1 -1
- package/dist/2714.js +1 -1
- package/dist/3139.js +1 -1
- package/dist/4181.js +1 -1
- package/dist/4186.js +1 -1
- package/dist/4211.js +1 -1
- package/dist/485.js +1 -1
- package/dist/4895.js +1 -1
- package/dist/5334.js +1 -1
- package/dist/5421.js +1 -1
- package/dist/5679.js +1 -1
- package/dist/5765.js +1 -0
- package/dist/6236.js +1 -1
- package/dist/6393.js +1 -1
- package/dist/6401.js +1 -1
- package/dist/6855.js +1 -0
- package/dist/7436.js +1 -1
- package/dist/7470.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/885.js +1 -1
- package/dist/9243.js +1 -1
- package/dist/assets/images/icons/api-group.svg +10 -9
- package/dist/assets/images/icons/api-user.svg +9 -6
- package/dist/assets/images/icons/comparator.svg +13 -4
- package/dist/assets/images/icons/custom.svg +5 -8
- package/dist/assets/images/icons/database.svg +28 -11
- package/dist/assets/images/icons/db-m.svg +9 -27
- package/dist/assets/images/icons/dev.svg +10 -6
- package/dist/assets/images/icons/diagram.svg +27 -6
- package/dist/assets/images/icons/event.svg +16 -0
- package/dist/assets/images/icons/film-movies-icon.svg +3 -13
- package/dist/assets/images/icons/finder.svg +9 -6
- package/dist/assets/images/icons/i18n.svg +10 -8
- package/dist/assets/images/icons/increment.svg +4 -3
- package/dist/assets/images/icons/license.svg +6 -0
- package/dist/assets/images/icons/log-profile.svg +20 -6
- package/dist/assets/images/icons/log.svg +14 -6
- package/dist/assets/images/icons/masters.svg +14 -0
- package/dist/assets/images/icons/nodes.svg +4 -2
- package/dist/assets/images/icons/notes.svg +11 -18
- package/dist/assets/images/icons/process_initializers.svg +19 -12
- package/dist/assets/images/icons/redis.svg +17 -6
- package/dist/assets/images/icons/sandbox.svg +10 -3
- package/dist/assets/images/icons/schedulers.svg +7 -11
- package/dist/assets/images/icons/secret.svg +12 -6
- package/dist/assets/images/icons/systems.svg +7 -8
- package/dist/assets/images/icons/testing.svg +11 -3
- package/dist/assets/images/icons/third-party.svg +16 -6
- package/dist/assets/images/icons/typescript.svg +7 -6
- package/dist/assets/images/icons/ui-maker.svg +11 -0
- package/dist/assets/images/icons/utility.svg +18 -6
- package/dist/assets/images/icons/vulnerability.svg +19 -11
- package/dist/assets/images/icons/web.svg +3 -9
- package/dist/assets/schema-types/InterfaceProps.ts +8 -0
- package/dist/assets/schema-types/types.ts +1358 -140
- 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 +2 -2
- package/dist/common.js +1 -1
- package/dist/main.js +1 -1
- package/dist/primeicons.eot +0 -0
- package/dist/primeicons.svg +62 -9
- package/dist/primeicons.ttf +0 -0
- package/dist/primeicons.woff +0 -0
- package/dist/primeicons.woff2 +0 -0
- package/dist/styles.css +1 -1
- package/license.txt +2 -1
- package/main.js +1 -1
- package/package.json +5 -4
- package/sandbox/assets/schema-types/types.js +179 -9
- package/sandbox/package.json +1 -0
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/types.ts +1358 -140
- package/src/public/dist-db-masters/3rdpartylicenses.txt +1 -1
- package/src/public/dist-db-masters/browser/assets/data/mime_types.json +819 -0
- package/src/public/dist-db-masters/browser/assets/iframe_test.html +34 -1
- package/src/public/dist-db-masters/browser/assets/themes/arya-blue/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/arya-green/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/arya-orange/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/arya-purple/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-amber/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-blue/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-cyan/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-green/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-indigo/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-lime/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-noir/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-pink/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-purple/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-dark-teal/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-amber/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-blue/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-cyan/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-green/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-indigo/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-lime/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-noir/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-pink/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-purple/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/aura-light-teal/theme.css +174 -2
- package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-dark-blue/theme.css +166 -5
- package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-dark-purple/theme.css +166 -5
- package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-light-blue/theme.css +166 -5
- package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-light-purple/theme.css +166 -5
- package/src/public/dist-db-masters/browser/assets/themes/fluent-light/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/lara-dark-blue/theme.css +173 -1
- package/src/public/dist-db-masters/browser/assets/themes/lara-dark-indigo/theme.css +173 -1
- package/src/public/dist-db-masters/browser/assets/themes/lara-dark-purple/theme.css +173 -1
- package/src/public/dist-db-masters/browser/assets/themes/lara-dark-teal/theme.css +173 -1
- package/src/public/dist-db-masters/browser/assets/themes/lara-light-blue/theme.css +222 -1
- package/src/public/dist-db-masters/browser/assets/themes/lara-light-indigo/theme.css +222 -1
- package/src/public/dist-db-masters/browser/assets/themes/lara-light-purple/theme.css +222 -1
- package/src/public/dist-db-masters/browser/assets/themes/lara-light-teal/theme.css +222 -1
- package/src/public/dist-db-masters/browser/assets/themes/luna-amber/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/luna-blue/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/luna-green/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/luna-pink/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/md-dark-deeppurple/theme.css +187 -4
- package/src/public/dist-db-masters/browser/assets/themes/md-dark-indigo/theme.css +187 -4
- package/src/public/dist-db-masters/browser/assets/themes/md-light-deeppurple/theme.css +187 -4
- package/src/public/dist-db-masters/browser/assets/themes/md-light-indigo/theme.css +187 -4
- package/src/public/dist-db-masters/browser/assets/themes/mdc-dark-deeppurple/theme.css +187 -4
- package/src/public/dist-db-masters/browser/assets/themes/mdc-dark-indigo/theme.css +187 -4
- package/src/public/dist-db-masters/browser/assets/themes/mdc-light-deeppurple/theme.css +187 -4
- package/src/public/dist-db-masters/browser/assets/themes/mdc-light-indigo/theme.css +187 -4
- package/src/public/dist-db-masters/browser/assets/themes/mira/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/nano/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/nova/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/nova-accent/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/nova-alt/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/rhea/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/saga-blue/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/saga-green/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/saga-orange/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/saga-purple/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/soho-dark/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/soho-light/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/tailwind-light/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/vela-blue/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/vela-green/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/vela-orange/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/vela-purple/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/viva-dark/theme.css +117 -5
- package/src/public/dist-db-masters/browser/assets/themes/viva-light/theme.css +117 -5
- package/src/public/dist-db-masters/browser/index.html +2 -0
- package/src/public/dist-db-masters/browser/main.js +58 -62
- package/src/public/dist-db-masters/browser/polyfills.js +2 -2
- package/dist/1840.js +0 -1
- package/dist/9208.js +0 -1
- package/dist/assets/images/icons/event.png +0 -0
- package/dist/assets/images/icons/license.png +0 -0
- package/dist/assets/images/icons/masters.png +0 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
```shell
|
|
18
18
|
# Add your key in below command
|
|
19
|
-
curl -fsSL https://apimaker.dev/v1/install.sh > install.sh && bash install.sh --
|
|
19
|
+
curl -fsSL https://apimaker.dev/v1/install.sh > install.sh && bash install.sh --version=latest --extLicenseKey=YOUR_KEY
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
|
package/dist/1025.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1025],{4061:(le,k,r)=>{r.d(k,{T:()=>B});var S=r(5861),e=r(328),A=r(7850),C=r(6990),u=r(6212),D=r(1162),t=r(4946),y=r(95),O=r(7240),W=r(262),K=r(9961),Y=r(7414),Q=r(5852),J=r(3429),V=r(2189),H=r(4977),q=r(2559),j=r(7629),R=r(1429),X=r(6814),U=r(5219),z=r(7680),x=r(3965);function N(g,I){if(1&g){const o=t.EpF();t.TgZ(0,"div",2)(1,"span",3),t._uU(2,"Database"),t.qZA(),t.TgZ(3,"p-dropdown",9),t.NdJ("onChange",function(l){t.CHM(o);const i=t.oxw(2);return i.tab.database=l.value,t.KtG(i.loadCollections(!0))}),t.qZA()()}if(2&g){const o=t.oxw(2);t.xp6(3),t.Q6J("options",o.tab.allDatabases)("ngModel",o.tab.database)("filter",!0)}}function ee(g,I){if(1&g){const o=t.EpF();t.TgZ(0,"div",2)(1,"span",3),t._uU(2,"Collections"),t.qZA(),t.TgZ(3,"p-dropdown",4),t.NdJ("onChange",function(l){t.CHM(o);const i=t.oxw(2);return i.tab.collection=l.value,t.KtG(i.loadInstanceAPIs(!0))}),t.qZA()()}if(2&g){const o=t.oxw(2);t.xp6(3),t.Q6J("options",o.tab.allCollections)("ngModel",o.tab.collection)("filter",!0)}}function te(g,I){if(1&g){const o=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"span",3),t._uU(3,"Instances"),t.qZA(),t.TgZ(4,"p-dropdown",4),t.NdJ("onChange",function(l){t.CHM(o);const i=t.oxw();return i.tab.instance=l.value,t.KtG(i.loadDatabases(!0))}),t.qZA()(),t.YNc(5,N,4,3,"div",8),t.YNc(6,ee,4,3,"div",8),t.qZA()}if(2&g){const o=t.oxw();t.xp6(4),t.Q6J("options",o.tab.allInstances)("ngModel",o.tab.instance)("filter",!0),t.xp6(1),t.Q6J("ngIf",o.tab.apiCategory.id===o.EAPICategory.INSTANCES),t.xp6(1),t.Q6J("ngIf",o.tab.apiCategory.id===o.EAPICategory.INSTANCES)}}function ne(g,I){if(1&g){const o=t.EpF();t.TgZ(0,"div",2)(1,"span",3),t._uU(2,"API Versions"),t.qZA(),t.TgZ(3,"p-dropdown",10),t.NdJ("onChange",function(l){t.CHM(o);const i=t.oxw(2);return i.tab.tpStoreApiVersion=l.value,t.KtG(i.loadThirdPartyAPIs(!0))}),t.qZA()()}if(2&g){const o=t.oxw(2);t.xp6(3),t.Q6J("options",o.tab.allStoreApiVersions)("ngModel",o.tab.tpStoreApiVersion)("filter",!0)}}function L(g,I){if(1&g){const o=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"span",3),t._uU(3,"API Bundle"),t.qZA(),t.TgZ(4,"p-dropdown",4),t.NdJ("onChange",function(l){t.CHM(o);const i=t.oxw();return i.tab.tpApiBundle=l.value,t.KtG(i.loadStoreApiVersions(!0))}),t.qZA()(),t.YNc(5,ne,4,3,"div",8),t.qZA()}if(2&g){const o=t.oxw();t.xp6(4),t.Q6J("options",o.tab.allApiBundles)("ngModel",o.tab.tpApiBundle)("filter",!0),t.xp6(1),t.Q6J("ngIf",o.tab.apiCategory.id===o.EAPICategory.THIRD_PARTY_APIS)}}function ae(g,I){if(1&g&&(t.TgZ(0,"span",18),t._uU(1),t.qZA()),2&g){const o=t.oxw(2).$implicit;t.xp6(1),t.hij(" - ",o.category.toLowerCase(),"")}}function h(g,I){if(1&g&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&g){const o=t.oxw(2).$implicit;t.xp6(1),t.hij(" - ",o.category.toLowerCase(),"")}}function w(g,I){if(1&g&&(t.TgZ(0,"div")(1,"span"),t._uU(2),t.qZA(),t.YNc(3,ae,2,1,"span",16),t.YNc(4,h,2,1,"span",17),t.qZA()),2&g){const o=t.oxw().$implicit;t.xp6(2),t.Oqu(o.name),t.xp6(1),t.Q6J("ngIf","SCHEMA"===o.category),t.xp6(1),t.Q6J("ngIf","GEN"===o.category)}}function c(g,I){1&g&&t.YNc(0,w,5,3,"div",15),2&g&&t.Q6J("ngIf",I.$implicit)}function p(g,I){if(1&g&&(t.TgZ(0,"span",18),t._uU(1),t.qZA()),2&g){const o=t.oxw(2).$implicit;t.xp6(1),t.hij(" - ",o.category.toLowerCase(),"")}}function f(g,I){if(1&g&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&g){const o=t.oxw(2).$implicit;t.xp6(1),t.hij(" - ",o.category.toLowerCase(),"")}}function M(g,I){if(1&g&&(t.TgZ(0,"div")(1,"span"),t._uU(2),t.qZA(),t.YNc(3,p,2,1,"span",16),t.YNc(4,f,2,1,"span",17),t.qZA()),2&g){const o=t.oxw().$implicit;t.xp6(2),t.Oqu(o.name),t.xp6(1),t.Q6J("ngIf","SCHEMA"===o.category),t.xp6(1),t.Q6J("ngIf","GEN"===o.category)}}function se(g,I){1&g&&t.YNc(0,M,5,3,"div",15),2&g&&t.Q6J("ngIf",I.$implicit)}function oe(g,I){if(1&g){const o=t.EpF();t.TgZ(0,"div",11)(1,"div",1)(2,"div",12)(3,"span",3),t._uU(4,"APIs"),t.qZA(),t.TgZ(5,"p-dropdown",4),t.NdJ("onChange",function(l){t.CHM(o);const i=t.oxw();return t.KtG(i.tab.api=l.value)}),t.YNc(6,c,1,1,"ng-template",13),t.YNc(7,se,1,1,"ng-template",14),t.qZA()()()()}if(2&g){const o=t.oxw();t.xp6(5),t.Q6J("options",o.tab.apiList)("ngModel",o.tab.api)("filter",!0)}}function F(g,I){1&g&&t._UZ(0,"p-progressSpinner",20)}let B=(()=>{class g{fb;generalS;webSocketEventsS;ns;constantsS;authCS;instanceS;navigationCS;tpStoreApiVersionS;tpInstalledApisS;functionS;dataProviderS;cd;EFormMode=e.D;form;subscriptions=[];tab={};apiCategories;loading={dropdown:!0};EAPICategory=A.R;tpAPIVersionMap={};apiCategoriesMap={};dbIdMap={};colIdMap={};tpLibraryMap={};tpPIMap={};constructor(o,n,l,i,v,E,P,Z,ie,d,b,a,_){this.fb=o,this.generalS=n,this.webSocketEventsS=l,this.ns=i,this.constantsS=v,this.authCS=E,this.instanceS=P,this.navigationCS=Z,this.tpStoreApiVersionS=ie,this.tpInstalledApisS=d,this.functionS=b,this.dataProviderS=a,this.cd=_}ngOnInit(){this.loadApiCategories().then()}loadApiCategories(){var o=this;return(0,S.Z)(function*(){const n=o.dataProviderS.getApiCategoriesForWebSocketAndGroup();o.apiCategories=n.filter(i=>i.id!==A.R.SCHEDULERS&&i.id!==A.R.EVENTS),o.apiCategoriesMap=C.keyBy(o.apiCategories,D.GR.id);const l=o.navigationCS.getQueryParam(u.p.at_category);l&&o.tab&&(o.tab.apiCategory=C.find(o.apiCategories,{id:l})),o.tab.apiCategory||(o.tab.apiCategory=o.apiCategories[0]),yield o.apiCategoryChangedEvent(!1),yield o.categorySelected(!1),o.cd.detectChanges()})()}apiCategoryChangedEvent(o){var n=this;return(0,S.Z)(function*(){n.loading.dropdown=!0,n.resetDependentObjects("INSTANCE"),yield n.categorySelected(o),n.tab.apiCategory.id===A.R.INSTANCES?yield n.loadInstances(o):n.tab.apiCategory.id===A.R.THIRD_PARTY_APIS?yield n.loadLibraries(o):n.tab.apiCategory.id===A.R.CUSTOM_APIS?yield n.loadCustomAPIs(o):n.tab.apiCategory.id===A.R.SYSTEM_APIS&&(yield n.loadSystemAPIs(o)),n.loading.dropdown=!1})()}loadInstances(o){var n=this;return(0,S.Z)(function*(){n.resetDependentObjects("INSTANCE"),yield n.categorySelected(o),n.loading.dropdown=!0;try{const i={find:{user:n.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1}};n.tab.allInstances=(yield n.instanceS.query(i).toPromise()).data||[]}catch(i){n.ns.showErrorMessageFromErrorObject(i),n.tab.allInstances=[]}const l=n.navigationCS.getQueryParam(u.p.at_instance);l&&(n.tab.instance=C.find(n.tab.allInstances,{name:l})),!n.tab.instance&&n.tab.allInstances.length&&(n.tab.instance=n.tab.allInstances[0]),yield n.loadDatabases(o),n.loading.dropdown=!1,n.cd.detectChanges()})()}loadDatabases(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,n.resetDependentObjects("DATABASE"),yield n.setInstanceInURL(o),!n.tab.instance)return n.tab.allDatabases=[],n.tab.allCollections=[],void(n.tab.apiList=[]);try{n.tab.allDatabases=((yield n.instanceS.getDatabases([n.tab.instance]).toPromise()).data||[])[0]||[],n.dbIdMap=C.keyBy(n.tab.allDatabases,D.N7.db)}catch(i){n.ns.showErrorMessageFromErrorObject(i),n.tab.allDatabases=[]}const l=n.navigationCS.getQueryParam(u.p.at_database);l&&(n.tab.database=C.find(n.tab.allDatabases,{db:l})),!n.tab.database&&n.tab.allDatabases.length&&(n.tab.database=n.tab.allDatabases[0]),yield n.loadCollections(o),n.loading.dropdown=!1})()}loadCollections(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,n.resetDependentObjects("COLLECTION"),yield n.setDatabaseInURL(o),!n.tab.instance||!n.tab.database)return n.tab.allCollections=[],void(n.tab.apiList=[]);try{n.tab.allCollections=((yield n.instanceS.getCollections([n.tab.database]).toPromise()).data||[])[0]||[],n.colIdMap=C.keyBy(n.tab.allCollections,D.GR.name)}catch(i){n.ns.showErrorMessageFromErrorObject(i),n.tab.allCollections=[]}const l=n.navigationCS.getQueryParam(u.p.at_collection);n.tab.collection=l?C.find(n.tab.allCollections,{name:l}):n.tab.allCollections[0],yield n.loadInstanceAPIs(o),n.loading.dropdown=!1,n.cd.detectChanges()})()}loadInstanceAPIs(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,yield n.setCollectionInURL(o),!n.tab.instance||!n.tab.database||!n.tab.collection)return n.tab.apiList=[],void(n.loading.dropdown=!1);try{const i=n.tab.collection;i.removeStreamApisInResponse=!0,n.tab.apiList=(yield n.instanceS.instanceAPIList([i])).data||[]}catch(i){n.ns.showErrorMessageFromErrorObject(i),n.tab.apiList=[]}const l=n.navigationCS.getQueryParam(u.p.at_api);yield n.apiCommon(l)})()}loadLibraries(o){var n=this;return(0,S.Z)(function*(){n.resetDependentObjects("LIBRARY"),n.loading.dropdown=!0,n.tab.allApiBundles=yield n.tpStoreApiVersionS.getAllAPIBundles(),n.tpLibraryMap=C.keyBy(n.tab.allApiBundles,"value");const l=n.navigationCS.getQueryParam(u.p.at_bundleName);l&&(n.tab.tpApiBundle=C.find(n.tab.allApiBundles,{value:l})),!n.tab.tpApiBundle&&n.tab.allApiBundles.length&&(n.tab.tpApiBundle=n.tab.allApiBundles[0]),yield n.loadStoreApiVersions(o),n.loading.dropdown=!1,n.cd.detectChanges()})()}loadStoreApiVersions(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,n.resetDependentObjects("API_VERSION"),yield n.setLibraryInURL(o),!n.tab.tpApiBundle)return n.tab.allStoreApiVersions=[],void(n.tab.apiList=[]);n.tab.allStoreApiVersions=yield n.tpStoreApiVersionS.getAllStoreApiVersions([n.tab.tpApiBundle.value]);const l=n.navigationCS.getQueryParam(u.p.at_bundleName),i=n.navigationCS.getQueryParam(u.p.at_apiVersion);i&&(n.tab.tpStoreApiVersion=C.find(n.tab.allStoreApiVersions,{apiBundleName:l,storeApiVersion:i})),!n.tab.tpStoreApiVersion&&n.tab.allStoreApiVersions.length&&(n.tab.tpStoreApiVersion=n.tab.allStoreApiVersions[0]),yield n.loadThirdPartyAPIs(o),n.loading.dropdown=!1,n.cd.detectChanges()})()}loadThirdPartyAPIs(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,yield n.setTPApiVersionInURL(o),!n.tab.tpApiBundle||!n.tab.tpStoreApiVersion)return void(n.tab.apiList=[]);n.tab.apiList=(yield n.tpInstalledApisS.getThirdPartyAPIListArray([n.tab.tpStoreApiVersion]).toPromise()).data,n.tpPIMap=C.keyBy(n.tab.apiList,D.iH._id);const l=n.navigationCS.getQueryParam(u.p.at_api);yield n.apiCommon(l)})()}loadCustomAPIs(o){var n=this;return(0,S.Z)(function*(){n.loading.dropdown=!0;const l=yield n.functionS.getFunctionsAsAPI().toPromise();l.success&&l.data&&l.data.length&&(n.tab.apiList=l.data||[]);const i=n.navigationCS.getQueryParam(u.p.at_api);yield n.apiCommon(i)})()}loadSystemAPIs(o){var n=this;return(0,S.Z)(function*(){n.loading.dropdown=!0;const l=yield n.instanceS.systemAPIList().toPromise();l?.data?.length&&(n.tab.apiList=l.data||[]);const i=n.navigationCS.getQueryParam(u.p.at_api);yield n.apiCommon(i)})()}apiCommon(o){var n=this;return(0,S.Z)(function*(){n.loading.dropdown=!0,o?(n.tab.api=C.find(n.tab.apiList,{id:o}),n.tab.api||(n.tab.api=C.find(n.tab.apiList,{name:o}))):n.tab.api=n.tab.apiList[0],yield n.setApiInURL(),n.loading.dropdown=!1})()}categorySelected(o){var n=this;return(0,S.Z)(function*(){n.tab.apiCategory&&(yield n.navigationCS.setQueryParam(u.p.at_category,n.tab.apiCategory.id),o&&(yield n.generalS.resetUrlParams([u.p.at_instance,u.p.at_database,u.p.at_collection,u.p.at_bundleName,u.p.at_apiVersion,u.p.at_api])))})()}resetDependentObjects(o){"INSTANCE"===o?(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"===o?(this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===o?(this.tab.allCollections=this.tab.apiList=[],this.tab.collection=this.tab.api=void 0):"LIBRARY"===o?(this.tab.allApiBundles=this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpApiBundle=this.tab.api=this.tab.tpStoreApiVersion=void 0):"API_VERSION"===o&&(this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpStoreApiVersion=this.tab.api=void 0)}setInstanceInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.instance&&n.tab.instance._id&&(yield n.navigationCS.setQueryParam(u.p.at_instance,n.tab.instance._id),o&&(yield n.generalS.resetUrlParams([u.p.at_database,u.p.at_collection,u.p.at_api])))})()}setDatabaseInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.database&&n.tab.database._id&&(yield n.navigationCS.setQueryParam(u.p.at_database,n.tab.database._id),o&&(yield n.generalS.resetUrlParams([u.p.at_collection,u.p.at_api])))})()}setCollectionInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.collection&&n.tab.collection._id&&(yield n.navigationCS.setQueryParam(u.p.at_collection,n.tab.collection._id),o&&(yield n.generalS.resetUrlParams([u.p.at_api])))})()}setLibraryInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.tpApiBundle&&n.tab.tpApiBundle.value&&(yield n.navigationCS.setQueryParam(u.p.at_bundleName,n.tab.tpApiBundle.value),o&&(yield n.generalS.resetUrlParams([u.p.at_apiVersion,u.p.at_api])))})()}setTPApiVersionInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.tpStoreApiVersion&&n.tab.tpStoreApiVersion._id&&(yield n.navigationCS.setQueryParam(u.p.at_apiVersion,n.tab.tpStoreApiVersion._id),o&&(yield n.generalS.resetUrlParams([u.p.at_api])))})()}setApiInURL(){var o=this;return(0,S.Z)(function*(){o.tab?.api?.id&&(yield o.navigationCS.setQueryParam(u.p.at_api,o.tab.api.id))})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(n){return new(n||g)(t.Y36(y.qu),t.Y36(O.b),t.Y36(W.a),t.Y36(K.W),t.Y36(Y.L),t.Y36(Q.D),t.Y36(J.E),t.Y36(V.S),t.Y36(H.f),t.Y36(q.d),t.Y36(j.d),t.Y36(R.B),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:g,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(n,l){1&n&&(t.TgZ(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"span",3),t._uU(5,"API Category"),t.qZA(),t.TgZ(6,"p-dropdown",4),t.NdJ("onChange",function(v){return l.tab.apiCategory=v.value,l.apiCategoryChangedEvent(!0)}),t.qZA()()()(),t.TgZ(7,"div",0),t.YNc(8,te,7,5,"div",5),t.qZA(),t.TgZ(9,"div",0),t.YNc(10,L,6,4,"div",5),t.qZA(),t.YNc(11,oe,8,3,"div",6),t.YNc(12,F,1,0,"p-progressSpinner",7),t.qZA()),2&n&&(t.xp6(6),t.Q6J("options",l.apiCategories)("ngModel",l.tab.apiCategory)("filter",!0),t.xp6(2),t.Q6J("ngIf",l.tab.apiCategory.id===l.EAPICategory.INSTANCES),t.xp6(2),t.Q6J("ngIf",l.tab.apiCategory.id===l.EAPICategory.THIRD_PARTY_APIS),t.xp6(1),t.Q6J("ngIf",l.tab.apiCategory.id!==l.EAPICategory.WEB_SOCKET_EVENT),t.xp6(1),t.Q6J("ngIf",l.loading.dropdown))},dependencies:[y.JJ,y.On,X.O5,U.jx,z.G,x.Lt],encapsulation:2})}return g})()},2726:(le,k,r)=>{r.d(k,{x:()=>ie});var S=r(5861),e=r(4946),A=r(3157),C=r(328),s=r(6990),D=r(5085),t=r(6212),y=r(1162),O=r(6925),W=r(7240),K=r(9961),Y=r(262),Q=r(5852),J=r(7414),V=r(2915),H=r(5405),q=r(7629),j=r(2189),R=r(5219),X=r(7664),U=r(95),z=r(6814),x=r(5431),N=r(7680),ee=r(3259),te=r(8057),ne=r(8980);const L=["webSocketEventsManFormC"];function ae(d,b){if(1&d){const a=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(a);const m=e.oxw(2);return e.KtG(m.navigateToTreeView())}),e._UZ(1,"i",18),e.qZA()}}function h(d,b){if(1&d){const a=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(a);const m=e.oxw(2);return e.KtG(m.edit())}),e._UZ(1,"i",20),e.qZA()}}function w(d,b){if(1&d){const a=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(a);const m=e.oxw(2);return e.KtG(m.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function c(d,b){if(1&d){const a=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(a);const m=e.oxw();return e.KtG(m.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,ae,2,0,"span",14),e.YNc(4,h,2,0,"span",15),e.YNc(5,w,2,0,"span",16),e.qZA()}if(2&d){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 p(d,b){if(1&d){const a=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(m){e.CHM(a);const T=e.oxw();return e.KtG(T.eventCenterS.group.apisRegex.allWebSocketEvents=m)}),e.qZA()()()}if(2&d){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.group.apisRegex.allWebSocketEvents)("binary",!0)}}function f(d,b){if(1&d){const a=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(m){e.CHM(a);const T=e.oxw();return e.KtG(T.eventCenterS.filterInLog.apisRegex.allWebSocketEvents=m)}),e.qZA()()()}if(2&d){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)("binary",!0)}}function M(d,b){if(1&d&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&d){const a=e.oxw();e.xp6(2),e.Oqu(a.constantsS.group.allWebSocketEventsPermitted)}}function se(d,b){1&d&&(e.TgZ(0,"th",36),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function oe(d,b){1&d&&e._UZ(0,"th",37)}function F(d,b){if(1&d&&(e.TgZ(0,"tr"),e.YNc(1,se,2,0,"th",32),e._UZ(2,"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,oe,1,0,"th",35),e.qZA()),2&d){const a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(6),e.Q6J("ngIf",a.isLPM)}}function B(d,b){if(1&d&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",40),e.qZA()),2&d){const a=e.oxw().$implicit;e.xp6(1),e.Q6J("value",a)("pSelectableRow",a)}}function g(d,b){if(1&d&&(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&d){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 I(d,b){if(1&d&&(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&d){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 o(d,b){if(1&d&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&d){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function n(d,b){if(1&d&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&d){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function l(d,b){if(1&d&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&d){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function i(d,b){if(1&d){const a=e.EpF();e.TgZ(0,"div")(1,"label",41)(2,"p-checkbox",42),e.NdJ("ngModelChange",function(){e.CHM(a);const m=e.oxw(2).$implicit,T=e.oxw(2);return e.KtG(T.checkedChangeGridItem(m))})("ngModelChange",function(m){e.CHM(a);const T=e.oxw(2).$implicit;return e.KtG(T.saveResponseInLog=m)}),e.qZA()()()}if(2&d){const a=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",a.saveResponseInLog)("binary",!0)}}function v(d,b){if(1&d&&(e.TgZ(0,"td"),e.YNc(1,i,3,2,"div",6),e.qZA()),2&d){const a=e.oxw().$implicit,_=e.oxw(2);e.xp6(1),e.Q6J("ngIf",_.selectedRows.indexOf(a)>=0)}}function E(d,b){if(1&d&&(e.TgZ(0,"tr",38),e.YNc(1,B,2,2,"td",6),e.TgZ(2,"td",39)(3,"span"),e._uU(4),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e.YNc(8,g,15,4,"div",6),e.YNc(9,I,11,3,"div",6),e.YNc(10,o,3,1,"div",6),e.YNc(11,n,3,1,"div",6),e.YNc(12,l,3,1,"div",6),e.qZA(),e.YNc(13,v,2,1,"td",6),e.qZA()),2&d){const a=b.$implicit,_=b.rowIndex,m=e.oxw(2);e.Q6J("pSelectableRow",a),e.xp6(1),e.Q6J("ngIf",m.showCheckbox),e.xp6(3),e.Oqu(_+1),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 P(d,b){1&d&&e._UZ(0,"p-progressSpinner",43)}function Z(d,b){if(1&d){const a=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(m){e.CHM(a);const T=e.oxw();return e.KtG(T.selectedRows=m)})("selectionChange",function(){e.CHM(a);const m=e.oxw();return e.KtG(m.webSocketEventSelected())})("dblclick",function(){e.CHM(a);const m=e.oxw();return e.KtG(m.dblClickWebSocketEvent())}),e.YNc(2,F,8,2,"ng-template",29),e.YNc(3,E,14,10,"ng-template",30),e.qZA(),e.YNc(4,P,1,0,"p-progressSpinner",31),e.qZA()}if(2&d){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 ie=(()=>{class d{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:C.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=y.iH._id;EAPICategory=D.R;ERequestMethod=O.Yp;webSocketEventsManFormC;constructor(a,_,m,T,G,re,ce,de,_e,pe,me,ge){this.generalS=a,this.notificationS=_,this.webSocketEventsS=m,this.authCS=T,this.constantsS=G,this.eventCenterS=re,this.cd=ce,this.eventCenterCS=de,this.functionS=_e,this.navigationCS=pe,this.confirmationService=me,this.router=ge}ngOnInit(){var a=this;this.loadGridData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(_=>{(_.action===A.F.SAVED||_.action===A.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadGridData().then())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var _=(0,S.Z)(function*(m){m.length&&(yield a.loadGridData())});return function(m){return _.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(_=>{_&&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 _=yield a.webSocketEventsS.getWSEventKGrid({}).toPromise();_.success?(a.selectedRows=[],a.rows=_.data,a.rowsMap=s.keyBy(a.rows,y.iH._id),a.rowsMapName=s.keyBy(a.rows,y.of.id)):a.resetGridAndUrl();const m=a.navigationCS.getQueryParam(t.p.am_ws_event)||(a.isFilterLogTable?a.eventCenterS.filterInLog.webSocketIds.value.join(","):a.eventCenterS.group.webSocketIds.value.join(","));if(m){const T=m.split(","),G=s.intersection(s.keys(a.rowsMap),T),re=[];for(const ce of G)a.rowsMap[ce]&&re.push(a.rowsMap[ce]);a.selectedRows=re,a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next(re),a.eventCenterS.filterInLog.webSocketIds.next(G)}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 T=a.eventCenterS.group.selectedGroups.value[0];for(const G of T?.queryParams?.webSocketEventNames)a.rowsMapName[G]&&(a.rowsMapName[G].saveResponseInLog=T.webSocketEventsLog?.[G]?.saveResponseInLog||!1);a.setResDataInEventCenter()}setTimeout(()=>{a.loading.grid=!1,a.cd.detectChanges()},100)})()}add(){this.data.formData=void 0,this.data.mode=C.D.ADD,this.data.eventChannel.emit({action:A.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}view(){this.data.formData=this.selectedRows[0],this.data.mode=C.D.VIEW,this.data.eventChannel.emit({action:A.F.OPEN_FORM_IN_VIEW_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=C.D.EDIT,this.data.eventChannel.emit({action:A.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal()}removePermanentDialog(){var a=this;return(0,S.Z)(function*(){var _;a.confirmationService.confirm({message:a.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(_=(0,S.Z)(function*(){yield a.removePermanent()}),function(){return _.apply(this,arguments)})})})()}removePermanent(){var a=this;return(0,S.Z)(function*(){a.loading.grid=!0;const _=yield a.webSocketEventsS.permanentDelete(a.selectedRows[0]._id).toPromise();a.loading.grid=!1,_.success?(a.notificationS.showSuccess(a.constantsS.webSocketEvents.removePermanent),a.resetGridAndUrl(),a.loadGridData().then(),a.selectedRows=[]):a.notificationS.showErrorFromResponse(_,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(t.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(s.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 _=(a.selectedRows[0]?.nameUI||"").split("/");a.generalS.setNewTitle(_[_.length-1],D.R.WEB_SOCKET_EVENT)}})()}fillData(){var a=this;return(0,S.Z)(function*(){if(!a.selectedRows.length)return yield a.navigationCS.setQueryParam(t.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(s.map(a.selectedRows,"_id")),a.eventCenterS.group.webSocketApis.next(a.selectedRows),a.isFilterLogTable&&(a.eventCenterS.filterInLog.webSocketIds.next(s.map(a.selectedRows,"_id")),a.eventCenterS.filterInLog.webSocketApis.next(a.selectedRows));else{const _=(yield a.webSocketEventsS.getById(a.selectedRows[0]._id).toPromise()).data;_._id?(yield a.navigationCS.setQueryParam(t.p.am_ws_event,_._id),a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([_])):a.resetThisUrl()}})()}checkedChangeGridItem(a){var _=this;setTimeout((0,S.Z)(function*(){_.selectedRows.push(a),_.selectedRows=s.uniq(_.selectedRows);for(const m in _.rowsMap){const T=_.rowsMap[m];-1===_.selectedRows.indexOf(T)&&(T.saveResponseInLog=!1)}_.setResDataInEventCenter(),_.cd.detectChanges()}),100)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(_){return new(_||d)(e.Y36(W.b),e.Y36(K.W),e.Y36(Y.a),e.Y36(Q.D),e.Y36(J.L),e.Y36(V.u),e.Y36(e.sBO),e.Y36(H.M),e.Y36(q.d),e.Y36(j.S),e.Y36(R.YP),e.Y36(X.F0))};static \u0275cmp=e.Xpm({type:d,selectors:[["app-web-socket-events-grid"]],viewQuery:function(_,m){if(1&_&&e.Gf(L,5),2&_){let T;e.iGM(T=e.CRH())&&(m.webSocketEventsManFormC=T.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"],[2,"width","80px"],[2,"width","200px"],["style","width: 60px;",4,"ngIf"],[2,"width","45px"],[2,"width","60px"],[3,"pSelectableRow"],[1,"text-center"],[3,"value","pSelectableRow"],[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){1&_&&(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,c,6,3,"span",6),e.YNc(9,p,3,2,"span",7),e.YNc(10,f,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,M,3,1,"div",6),e.YNc(13,Z,5,7,"div",9),e.qZA()(),e._UZ(14,"app-web-socket-events-man-form",10,11)),2&_&&(e.xp6(8),e.Q6J("ngIf",!m.isDependentOnGroup&&!m.isLPM&&!m.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",m.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",m.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",m.eventCenterS.group.apisRegex.allWebSocketEvents||m.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),e.xp6(1),e.Q6J("ngIf",!(m.eventCenterS.group.apisRegex.allWebSocketEvents||m.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)),e.xp6(1),e.Q6J("data",m.data))},dependencies:[U.JJ,U.On,z.O5,x.iA,R.jx,x.Ei,x.UA,x.Mo,N.G,ee.u,te.XZ,ne.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 d})()},8980:(le,k,r)=>{r.d(k,{D:()=>ae});var S=r(5861),e=r(95),A=r(3157),C=r(328),s=r(7850),u=r(6212),D=r(1162),t=r(4946),y=r(7240),O=r(262),W=r(9961),K=r(7414),Y=r(5852),Q=r(2559),J=r(4977),V=r(2189),H=r(6814),q=r(2660),j=r(7680),R=r(4061);const X=["webSocketEventsFormSecondC"];function U(h,w){1&h&&(t.TgZ(0,"span"),t._UZ(1,"i",17),t._uU(2," Add WebSocket Event"),t.qZA())}function z(h,w){1&h&&(t.TgZ(0,"span"),t._UZ(1,"i",18),t._uU(2," View WebSocket Event"),t.qZA())}function x(h,w){1&h&&(t.TgZ(0,"span"),t._UZ(1,"i",19),t._uU(2," Edit WebSocket Event"),t.qZA())}function N(h,w){1&h&&(t.TgZ(0,"div",20)(1,"div",21)(2,"span",22),t._uU(3,"Name"),t.qZA(),t._UZ(4,"input",23),t.qZA()())}function ee(h,w){1&h&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function te(h,w){1&h&&(t.TgZ(0,"span"),t._uU(1,"Update"),t.qZA())}function ne(h,w){if(1&h){const c=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){t.CHM(c);const f=t.oxw();return t.KtG(f.save())}),t._UZ(1,"i",25),t.YNc(2,ee,2,0,"span",4),t.YNc(3,te,2,0,"span",4),t.qZA()}if(2&h){const c=t.oxw();t.xp6(2),t.Q6J("ngIf",c.data.mode===c.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",c.data.mode===c.EFormMode.EDIT)}}function L(h,w){1&h&&t._UZ(0,"p-progressSpinner",26)}let ae=(()=>{class h{fb;generalS;webSocketEventsS;ns;constantsS;authCS;tpInstalledApisS;tpStoreApiVersionS;navigationCS;cd;data;EFormMode=C.D;form;subscriptions=[];loading={form:!1};EAPICategory=s.R;wsFormSecondC;constructor(c,p,f,M,se,oe,F,B,g,I){this.fb=c,this.generalS=p,this.webSocketEventsS=f,this.ns=M,this.constantsS=se,this.authCS=oe,this.tpInstalledApisS=F,this.tpStoreApiVersionS=B,this.navigationCS=g,this.cd=I}ngOnInit(){var c=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var p=(0,S.Z)(function*(f){if(f)if(c.form.enable(),f.action===A.F.OPEN_FORM_IN_EDIT_MODE){if(!c.data.formData)return;const M=yield c.webSocketEventsS.getById(c.data.formData._id).toPromise();c.form.reset(),yield c.editModelLoadData(M.data),c.form.patchValue(M.data)}else if(f.action===A.F.OPEN_FORM_IN_VIEW_MODE){if(!c.data.formData)return;const M=yield c.webSocketEventsS.getById(c.data.formData._id).toPromise();c.form.reset(),c.form.patchValue(M.data),c.form.disable()}else f.action===A.F.OPEN_FORM_IN_ADD_MODE&&c.form.reset()});return function(f){return p.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[e.kI.required]]})}showModal(){var c=this;return(0,S.Z)(function*(){$("#idWebSocketEventsForm").modal("show"),setTimeout((0,S.Z)(function*(){yield c.wsFormSecondC.loadApiCategories()}),100)})()}hideModal(){$("#idWebSocketEventsForm").modal("hide")}editModelLoadData(c){var p=this;return(0,S.Z)(function*(){if(yield p.wsFormSecondC.categorySelected(!0),p.wsFormSecondC.tab.apiCategory=p.wsFormSecondC.apiCategoriesMap[c.apiCategory],yield p.navigationCS.setQueryParam(u.p.at_category,c.apiCategory),c.apiCategory===s.R.SYSTEM_APIS)yield p.navigationCS.setQueryParam(u.p.at_api,c.systemApiName);else if(c.apiCategory===s.R.CUSTOM_APIS)yield p.navigationCS.setQueryParam(u.p.at_api,c.customApiName);else if(c.apiCategory===s.R.INSTANCES)yield p.navigationCS.setQueryParam(u.p.at_instance,c.instanceName),yield p.navigationCS.setQueryParam(u.p.at_database,c.databaseName),yield p.navigationCS.setQueryParam(u.p.at_collection,c.collectionName),yield p.navigationCS.setQueryParam(u.p.at_api,c.instanceApiName);else if(c.apiCategory===s.R.THIRD_PARTY_APIS){const f=(yield p.tpInstalledApisS.query({find:{bundleName:c.tpInstalledApiBundleName,apiVersion:c.tpInstalledApiVersion,name:c.tpInstalledApiName,user:c.user,active:!0},limit:1}).toPromise())?.data?.[0];if(f){const M=(yield p.tpStoreApiVersionS.query({find:{apiBundleName:f.bundleName,storeApiVersion:f.apiVersion,user:f.user,active:!0},limit:1}).toPromise()).data?.[0];yield p.navigationCS.setQueryParam(u.p.at_bundleName,f.bundleName),yield p.navigationCS.setQueryParam(u.p.at_apiVersion,M.storeApiVersion),yield p.navigationCS.setQueryParam(u.p.at_api,f.name)}}})()}save(){var c=this;return(0,S.Z)(function*(){const p=c.form.getRawValue();if(p.user=c.authCS.getUserId(),p.apiCategory=c.wsFormSecondC.tab.apiCategory.id,p.apiCategory===s.R.WEB_SOCKET_EVENT&&!p.name)return c.ns.showError("Please provide websocket events name.");p.apiCategory===s.R.CUSTOM_APIS&&(p.customApiName=c.wsFormSecondC.tab.api.customApiName),p.apiCategory===s.R.SYSTEM_APIS&&(p.systemApiName=c.wsFormSecondC.tab.api.systemApiId),p.apiCategory===s.R.THIRD_PARTY_APIS&&(p.tpInstalledApiBundleName=c.wsFormSecondC.tab.api.bundleName,p.tpInstalledApiVersion=c.wsFormSecondC.tab.api.apiVersion,p.tpInstalledApiName=c.wsFormSecondC.tab.api.name),p.apiCategory===s.R.INSTANCES&&(p.instanceName=c.wsFormSecondC.tab.instance.name,p.databaseName=c.wsFormSecondC.tab.database.db,p.collectionName=c.wsFormSecondC.tab.collection.name,p.instanceApiName=c.wsFormSecondC.tab.api.id);try{let f;c.loading.form=!0,p.apiCategory!==s.R.WEB_SOCKET_EVENT&&delete p.name,c.data.mode===C.D.ADD?f=yield c.webSocketEventsS.post(p).toPromise():c.data.mode===C.D.EDIT&&(f=yield c.webSocketEventsS.put(c.data.formData._id,p,{select:D.iH._id}).toPromise()),f&&(c.ns.showSuccess(c.data.mode===C.D.ADD?c.constantsS.webSocketEvents.addSuccess:c.constantsS.webSocketEvents.editSuccess),c.data.eventChannel.emit({action:c.data.mode===C.D.ADD?A.F.SAVED:A.F.UPDATED})),c.loading.form=!1}catch(f){c.loading.form=!1,c.ns.showErrorFromResponse(f.error||f,"Unable to save websocket event.")}c.cd.detectChanges()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(p){return new(p||h)(t.Y36(e.qu),t.Y36(y.b),t.Y36(O.a),t.Y36(W.W),t.Y36(K.L),t.Y36(Y.D),t.Y36(Q.d),t.Y36(J.f),t.Y36(V.S),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:h,selectors:[["app-web-socket-events-man-form"]],viewQuery:function(p,f){if(1&p&&t.Gf(X,5),2&p){let M;t.iGM(M=t.CRH())&&(f.wsFormSecondC=M.first)}},inputs:{data:"data"},decls:21,vars:7,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"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],["webSocketEventsFormSecondC",""],["class","form-group row m-0",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"],[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"],["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(p,f){if(1&p&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,U,3,0,"span",4),t.YNc(5,z,3,0,"span",4),t.YNc(6,x,3,0,"span",4),t.TgZ(7,"button",5)(8,"span",6),t._UZ(9,"i",7),t.qZA()()(),t.TgZ(10,"div",8)(11,"form",9),t._UZ(12,"app-web-socket-events-form-second",null,10),t.YNc(14,N,5,0,"div",11),t.qZA()(),t.TgZ(15,"div",12)(16,"button",13),t._UZ(17,"i",14),t._uU(18," Close"),t.qZA(),t.YNc(19,ne,4,2,"button",15),t.qZA(),t.YNc(20,L,1,0,"p-progressSpinner",16),t.qZA()()()),2&p){const M=t.MAs(13);t.xp6(4),t.Q6J("ngIf",f.data.mode===f.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",f.data.mode===f.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",f.data.mode===f.EFormMode.EDIT),t.xp6(5),t.Q6J("formGroup",f.form),t.xp6(3),t.Q6J("ngIf",M.tab.apiCategory.id===f.EAPICategory.WEB_SOCKET_EVENT),t.xp6(5),t.Q6J("ngIf",f.data.mode!==f.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",f.loading.form)}},dependencies:[e._Y,e.Fj,e.JJ,e.JL,e.sg,e.u,H.O5,q.y,j.G,R.T],encapsulation:2})}return h})()},1025:(le,k,r)=>{r.r(k),r.d(k,{WebSocketEventsM:()=>o});var S=r(7664),e=r(8176),A=r(3726),s=(r(4061),r(4946)),u=r(2726);let D=(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(v){return new(v||n)};static \u0275cmp=s.Xpm({type:n,selectors:[["app-web-socket-events-layout-grid"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(v,E){1&v&&(s.TgZ(0,"div",0),s._UZ(1,"app-web-socket-events-grid",1),s.qZA()),2&v&&(s.xp6(1),s.Q6J("showCheckbox",!1))},dependencies:[u.x],encapsulation:2})}return n})();var t=r(5861),y=r(3157),O=r(328),W=r(5085),K=r(6212),Y=r(1162),Q=r(6925),J=r(7240),V=r(9961),H=r(262),q=r(5852),j=r(7414),R=r(2915),X=r(5405),U=r(7629),z=r(2189),x=r(5219),N=r(6814),ee=r(7526),te=r(7680),ne=r(3259),L=r(8980);const ae=["webSocketEventsManFormC"];function h(n,l){if(1&n){const i=s.EpF();s.TgZ(0,"span",19),s.NdJ("click",function(){s.CHM(i);const E=s.oxw();return s.KtG(E.edit())}),s._UZ(1,"i",20),s.qZA()}}function w(n,l){if(1&n){const i=s.EpF();s.TgZ(0,"span",21),s.NdJ("click",function(){s.CHM(i);const E=s.oxw();return s.KtG(E.removePermanentDialog())}),s._UZ(1,"i",22),s.qZA()}}function c(n,l){if(1&n&&(s.TgZ(0,"div")(1,"div",23),s._uU(2),s.qZA()()),2&n){const i=s.oxw();s.xp6(2),s.Oqu(i.constantsS.group.allWebSocketEventsPermitted)}}function p(n,l){if(1&n&&(s.TgZ(0,"div"),s._uU(1),s.qZA()),2&n){const i=s.oxw().$implicit;s.xp6(1),s.Oqu(i.label)}}const f=function(n,l,i,v){return{get:n,put:l,post:i,delete:v}};function M(n,l){if(1&n&&(s.TgZ(0,"div")(1,"span",25),s._uU(2),s.qZA(),s.TgZ(3,"span"),s._uU(4),s.qZA()()),2&n){const i=s.oxw().$implicit,v=s.oxw();s.xp6(1),s.Q6J("ngClass",s.l5B(3,f,i.data.requestMethod===v.ERequestMethod.GET,i.data.requestMethod===v.ERequestMethod.PUT,i.data.requestMethod===v.ERequestMethod.POST,i.data.requestMethod===v.ERequestMethod.DELETE)),s.xp6(1),s.Oqu(i.data.requestMethod),s.xp6(2),s.Oqu(i.data.name||i.label)}}function se(n,l){if(1&n){const i=s.EpF();s.TgZ(0,"div",24),s.NdJ("click",function(){const P=s.CHM(i).$implicit,Z=s.oxw();return P.children&&(P.isExpanded=!0),s.KtG(Z.selectedRows=[P._id])}),s.YNc(1,p,2,1,"div",12),s.YNc(2,M,5,8,"div",12),s.qZA()}if(2&n){const i=l.$implicit,v=s.oxw();s.xp6(1),s.Q6J("ngIf",(null==i.children?null:i.children.length)||(null==i||null==i.data?null:i.data.apiCategory)!==v.EAPICategory.CUSTOM_APIS),s.xp6(1),s.Q6J("ngIf",!(null!=i.children&&i.children.length)&&(null==i||null==i.data?null:i.data.apiCategory)===v.EAPICategory.CUSTOM_APIS)}}function oe(n,l){1&n&&s._UZ(0,"p-progressSpinner",26)}let F=(()=>{class n{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;loading={grid:!1};subscriptions=[];data={mode:O.D.ADD,eventChannel:new s.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=Y.iH._id;EAPICategory=W.R;ERequestMethod=Q.Yp;treeNodes=[];allTreeItemsMap={};leafSelected=!1;webSocketEventsManFormC;constructor(i,v,E,P,Z,ie,d,b,a,_,m,T){this.generalS=i,this.notificationS=v,this.webSocketEventsS=E,this.authCS=P,this.constantsS=Z,this.eventCenterS=ie,this.cd=d,this.eventCenterCS=b,this.functionS=a,this.navigationCS=_,this.confirmationService=m,this.router=T}ngOnInit(){this.loadTreeData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(i=>{(i.action===y.F.SAVED||i.action===y.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadTreeData().then())})),this.generalS.setNewTitle("API Maker - WebSocket Events")}add(){this.data.formData=void 0,this.data.mode=O.D.ADD,this.data.eventChannel.emit({action:y.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.selectedRows.length&&(this.data.formData=this.selectedRows[0].data,this.data.mode=O.D.EDIT,this.data.eventChannel.emit({action:y.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal().then())}removePermanentDialog(){var i=this;return(0,t.Z)(function*(){var v;i.confirmationService.confirm({message:i.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(v=(0,t.Z)(function*(){yield i.removePermanent()}),function(){return v.apply(this,arguments)})})})()}removePermanent(){var i=this;return(0,t.Z)(function*(){i.loading.grid=!0;const v=i.selectedRows[0].data,E=yield i.webSocketEventsS.permanentDelete(v._id).toPromise();i.loading.grid=!1,E.success?(i.notificationS.showSuccess(i.constantsS.webSocketEvents.removePermanent),i.resetGridAndUrl(),i.loadTreeData().then(),i.selectedRows=[]):i.notificationS.showErrorFromResponse(E,i.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}navigateToGrid(){var i=this;return(0,t.Z)(function*(){i.router.navigate(["api-info","web-socket-events","layout-grid"]).then()})()}loadTreeData(){var i=this;return(0,t.Z)(function*(){const v=(yield i.functionS.getWSEventKTree().toPromise()).data;for(const P of v)i.generalS.convertKTreeItemToPrimeNGTreeItem(P);const E={};i.generalS.getMapOfAllItems(E,v),i.generalS.setIsExpandedStateFromOldMap(i.allTreeItemsMap,E),i.treeNodes=v,i.allTreeItemsMap=E,i.loading.grid=!1,i.cd.detectChanges()})()}resetThisUrl(){var i=this;return(0,t.Z)(function*(){i.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield i.navigationCS.setQueryParam(K.p.am_ws_event,null)})()}selectedKeysChange(){var i=this;return(0,t.Z)(function*(){if(i.selectedRows.length){const v=i.selectedRows[0];v.children?.length?i.leafSelected=!1:(i.leafSelected=!0,v&&v?.label?i.generalS.setNewTitle(v.label,W.R.WEB_SOCKET_EVENT):i.generalS.setNewTitle("API Maker - WebSocket Events"),yield i.resetThisUrl())}else i.leafSelected=!1})()}dblClickTreeEvent(){this.leafSelected&&this.selectedRows.length&&this.edit()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(v){return new(v||n)(s.Y36(J.b),s.Y36(V.W),s.Y36(H.a),s.Y36(q.D),s.Y36(j.L),s.Y36(R.u),s.Y36(s.sBO),s.Y36(X.M),s.Y36(U.d),s.Y36(z.S),s.Y36(x.YP),s.Y36(S.F0))};static \u0275cmp=s.Xpm({type:n,selectors:[["app-web-socket-events-tree"]],viewQuery:function(v,E){if(1&v&&s.Gf(ae,5),2&v){let P;s.iGM(P=s.CRH())&&(E.webSocketEventsManFormC=P.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(v,E){1&v&&(s.TgZ(0,"div",0)(1,"div",1)(2,"span"),s._UZ(3,"img",2),s._uU(4," WebSocket Events"),s.qZA(),s.TgZ(5,"span")(6,"a",3),s._UZ(7,"img",4),s.qZA(),s.TgZ(8,"span",5),s.NdJ("click",function(){return E.add()}),s._UZ(9,"i",6),s.qZA(),s.TgZ(10,"span",7),s.NdJ("click",function(){return E.navigateToGrid()}),s._UZ(11,"i",8),s.qZA(),s.YNc(12,h,2,0,"span",9),s.YNc(13,w,2,0,"span",10),s.qZA()(),s.TgZ(14,"div",11),s.YNc(15,c,3,1,"div",12),s.TgZ(16,"div",13)(17,"p-tree",14),s.NdJ("selectionChange",function(Z){return E.selectedRows=Z})("dblclick",function(){return E.dblClickTreeEvent()})("selectionChange",function(){return E.selectedKeysChange()}),s.YNc(18,se,3,2,"ng-template",15),s.qZA(),s.YNc(19,oe,1,0,"p-progressSpinner",16),s.qZA()()(),s._UZ(20,"app-web-socket-events-man-form",17,18)),2&v&&(s.xp6(12),s.Q6J("ngIf",E.leafSelected),s.xp6(1),s.Q6J("ngIf",E.leafSelected),s.xp6(2),s.Q6J("ngIf",E.eventCenterS.group.apisRegex.allWebSocketEvents||E.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),s.xp6(2),s.Q6J("value",E.treeNodes)("selection",E.selectedRows),s.xp6(2),s.Q6J("ngIf",E.loading.grid),s.xp6(1),s.Q6J("data",E.data))},dependencies:[N.mk,N.O5,x.jx,ee.mp,te.G,ne.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 n})();const g=[{path:"",redirectTo:"layout-tree",pathMatch:"full"},{path:"layout-tree",component:(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(v){return new(v||n)};static \u0275cmp=s.Xpm({type:n,selectors:[["app-web-socket-events-layout-tree"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(v,E){1&v&&(s.TgZ(0,"div",0),s._UZ(1,"app-web-socket-events-tree"),s.qZA())},dependencies:[F],encapsulation:2})}return n})(),canActivate:[A.P]},{path:"layout-grid",component:D,canActivate:[A.P]}];let o=(()=>{class n{static \u0275fac=function(v){return new(v||n)};static \u0275mod=s.oAB({type:n});static \u0275inj=s.cJS({imports:[S.Bz.forChild(g),e.u]})}return n})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1025],{4061:(de,k,r)=>{r.d(k,{T:()=>B});var S=r(5861),e=r(328),T=r(7850),C=r(6990),v=r(6212),D=r(1162),t=r(4946),y=r(95),O=r(7240),W=r(262),Y=r(9961),K=r(7414),Q=r(5852),J=r(3429),V=r(2189),H=r(4977),q=r(2559),j=r(7629),R=r(1429),X=r(6814),U=r(5219),z=r(7680),x=r(3965);function N(m,I){if(1&m){const o=t.EpF();t.TgZ(0,"div",2)(1,"span",3),t._uU(2,"Database"),t.qZA(),t.TgZ(3,"p-dropdown",9),t.NdJ("onChange",function(_){t.CHM(o);const i=t.oxw(2);return i.tab.database=_.value,t.KtG(i.loadCollections(!0))}),t.qZA()()}if(2&m){const o=t.oxw(2);t.xp6(3),t.Q6J("options",o.tab.allDatabases)("ngModel",o.tab.database)("filter",!0)}}function ee(m,I){if(1&m){const o=t.EpF();t.TgZ(0,"div",2)(1,"span",3),t._uU(2,"Collections"),t.qZA(),t.TgZ(3,"p-dropdown",4),t.NdJ("onChange",function(_){t.CHM(o);const i=t.oxw(2);return i.tab.collection=_.value,t.KtG(i.loadInstanceAPIs(!0))}),t.qZA()()}if(2&m){const o=t.oxw(2);t.xp6(3),t.Q6J("options",o.tab.allCollections)("ngModel",o.tab.collection)("filter",!0)}}function te(m,I){if(1&m){const o=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"span",3),t._uU(3,"Instances"),t.qZA(),t.TgZ(4,"p-dropdown",4),t.NdJ("onChange",function(_){t.CHM(o);const i=t.oxw();return i.tab.instance=_.value,t.KtG(i.loadDatabases(!0))}),t.qZA()(),t.YNc(5,N,4,3,"div",8),t.YNc(6,ee,4,3,"div",8),t.qZA()}if(2&m){const o=t.oxw();t.xp6(4),t.Q6J("options",o.tab.allInstances)("ngModel",o.tab.instance)("filter",!0),t.xp6(1),t.Q6J("ngIf",o.tab.apiCategory.id===o.EAPICategory.INSTANCES),t.xp6(1),t.Q6J("ngIf",o.tab.apiCategory.id===o.EAPICategory.INSTANCES)}}function ne(m,I){if(1&m){const o=t.EpF();t.TgZ(0,"div",2)(1,"span",3),t._uU(2,"API Versions"),t.qZA(),t.TgZ(3,"p-dropdown",10),t.NdJ("onChange",function(_){t.CHM(o);const i=t.oxw(2);return i.tab.tpStoreApiVersion=_.value,t.KtG(i.loadThirdPartyAPIs(!0))}),t.qZA()()}if(2&m){const o=t.oxw(2);t.xp6(3),t.Q6J("options",o.tab.allStoreApiVersions)("ngModel",o.tab.tpStoreApiVersion)("filter",!0)}}function L(m,I){if(1&m){const o=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"span",3),t._uU(3,"API Bundle"),t.qZA(),t.TgZ(4,"p-dropdown",4),t.NdJ("onChange",function(_){t.CHM(o);const i=t.oxw();return i.tab.tpApiBundle=_.value,t.KtG(i.loadStoreApiVersions(!0))}),t.qZA()(),t.YNc(5,ne,4,3,"div",8),t.qZA()}if(2&m){const o=t.oxw();t.xp6(4),t.Q6J("options",o.tab.allApiBundles)("ngModel",o.tab.tpApiBundle)("filter",!0),t.xp6(1),t.Q6J("ngIf",o.tab.apiCategory.id===o.EAPICategory.THIRD_PARTY_APIS)}}function ae(m,I){if(1&m&&(t.TgZ(0,"span",18),t._uU(1),t.qZA()),2&m){const o=t.oxw(2).$implicit;t.xp6(1),t.hij(" - ",o.category.toLowerCase(),"")}}function h(m,I){if(1&m&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&m){const o=t.oxw(2).$implicit;t.xp6(1),t.hij(" - ",o.category.toLowerCase(),"")}}function w(m,I){if(1&m&&(t.TgZ(0,"div")(1,"span"),t._uU(2),t.qZA(),t.YNc(3,ae,2,1,"span",16),t.YNc(4,h,2,1,"span",17),t.qZA()),2&m){const o=t.oxw().$implicit;t.xp6(2),t.Oqu(o.name),t.xp6(1),t.Q6J("ngIf","SCHEMA"===o.category),t.xp6(1),t.Q6J("ngIf","GEN"===o.category)}}function c(m,I){1&m&&t.YNc(0,w,5,3,"div",15),2&m&&t.Q6J("ngIf",I.$implicit)}function p(m,I){if(1&m&&(t.TgZ(0,"span",18),t._uU(1),t.qZA()),2&m){const o=t.oxw(2).$implicit;t.xp6(1),t.hij(" - ",o.category.toLowerCase(),"")}}function f(m,I){if(1&m&&(t.TgZ(0,"span",19),t._uU(1),t.qZA()),2&m){const o=t.oxw(2).$implicit;t.xp6(1),t.hij(" - ",o.category.toLowerCase(),"")}}function M(m,I){if(1&m&&(t.TgZ(0,"div")(1,"span"),t._uU(2),t.qZA(),t.YNc(3,p,2,1,"span",16),t.YNc(4,f,2,1,"span",17),t.qZA()),2&m){const o=t.oxw().$implicit;t.xp6(2),t.Oqu(o.name),t.xp6(1),t.Q6J("ngIf","SCHEMA"===o.category),t.xp6(1),t.Q6J("ngIf","GEN"===o.category)}}function se(m,I){1&m&&t.YNc(0,M,5,3,"div",15),2&m&&t.Q6J("ngIf",I.$implicit)}function oe(m,I){if(1&m){const o=t.EpF();t.TgZ(0,"div",11)(1,"div",1)(2,"div",12)(3,"span",3),t._uU(4,"APIs"),t.qZA(),t.TgZ(5,"p-dropdown",4),t.NdJ("onChange",function(_){t.CHM(o);const i=t.oxw();return t.KtG(i.tab.api=_.value)}),t.YNc(6,c,1,1,"ng-template",13),t.YNc(7,se,1,1,"ng-template",14),t.qZA()()()()}if(2&m){const o=t.oxw();t.xp6(5),t.Q6J("options",o.tab.apiList)("ngModel",o.tab.api)("filter",!0)}}function F(m,I){1&m&&t._UZ(0,"p-progressSpinner",20)}let B=(()=>{class m{fb;generalS;webSocketEventsS;ns;constantsS;authCS;instanceS;navigationCS;tpStoreApiVersionS;tpInstalledApisS;functionS;dataProviderS;cd;EFormMode=e.D;form;subscriptions=[];tab={};apiCategories;loading={dropdown:!0};EAPICategory=T.R;tpAPIVersionMap={};apiCategoriesMap={};dbIdMap={};colIdMap={};tpLibraryMap={};tpPIMap={};constructor(o,n,_,i,g,E,P,Z,ie,re,ce,l,b){this.fb=o,this.generalS=n,this.webSocketEventsS=_,this.ns=i,this.constantsS=g,this.authCS=E,this.instanceS=P,this.navigationCS=Z,this.tpStoreApiVersionS=ie,this.tpInstalledApisS=re,this.functionS=ce,this.dataProviderS=l,this.cd=b}ngOnInit(){this.loadApiCategories().then()}loadApiCategories(){var o=this;return(0,S.Z)(function*(){const n=o.dataProviderS.getApiCategoriesForWebSocketAndGroup();o.apiCategories=n.filter(i=>i.id!==T.R.SCHEDULERS&&i.id!==T.R.EVENTS),o.apiCategoriesMap=C.keyBy(o.apiCategories,D.GR.id);const _=o.navigationCS.getQueryParam(v.p.at_category);_&&o.tab&&(o.tab.apiCategory=C.find(o.apiCategories,{id:_})),o.tab.apiCategory||(o.tab.apiCategory=o.apiCategories[0]),yield o.apiCategoryChangedEvent(!1),yield o.categorySelected(!1),o.cd.detectChanges()})()}apiCategoryChangedEvent(o){var n=this;return(0,S.Z)(function*(){n.loading.dropdown=!0,n.resetDependentObjects("INSTANCE"),yield n.categorySelected(o),n.tab.apiCategory.id===T.R.INSTANCES?yield n.loadInstances(o):n.tab.apiCategory.id===T.R.THIRD_PARTY_APIS?yield n.loadLibraries(o):n.tab.apiCategory.id===T.R.CUSTOM_APIS?yield n.loadCustomAPIs(o):n.tab.apiCategory.id===T.R.SYSTEM_APIS&&(yield n.loadSystemAPIs(o)),n.loading.dropdown=!1})()}loadInstances(o){var n=this;return(0,S.Z)(function*(){n.resetDependentObjects("INSTANCE"),yield n.categorySelected(o),n.loading.dropdown=!0;try{const i={find:{user:n.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};n.tab.allInstances=(yield n.instanceS.query(i).toPromise()).data||[]}catch(i){n.ns.showErrorMessageFromErrorObject(i),n.tab.allInstances=[]}const _=n.navigationCS.getQueryParam(v.p.at_instance);_&&(n.tab.instance=C.find(n.tab.allInstances,{name:_})),!n.tab.instance&&n.tab.allInstances.length&&(n.tab.instance=n.tab.allInstances[0]),yield n.loadDatabases(o),n.loading.dropdown=!1,n.cd.detectChanges()})()}loadDatabases(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,n.resetDependentObjects("DATABASE"),yield n.setInstanceInURL(o),!n.tab.instance)return n.tab.allDatabases=[],n.tab.allCollections=[],void(n.tab.apiList=[]);try{n.tab.allDatabases=((yield n.instanceS.getDatabases([n.tab.instance]).toPromise()).data||[])[0]||[],n.dbIdMap=C.keyBy(n.tab.allDatabases,D.N7.db)}catch(i){n.ns.showErrorMessageFromErrorObject(i),n.tab.allDatabases=[]}const _=n.navigationCS.getQueryParam(v.p.at_database);_&&(n.tab.database=C.find(n.tab.allDatabases,{db:_})),!n.tab.database&&n.tab.allDatabases.length&&(n.tab.database=n.tab.allDatabases[0]),yield n.loadCollections(o),n.loading.dropdown=!1})()}loadCollections(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,n.resetDependentObjects("COLLECTION"),yield n.setDatabaseInURL(o),!n.tab.instance||!n.tab.database)return n.tab.allCollections=[],void(n.tab.apiList=[]);try{n.tab.allCollections=((yield n.instanceS.getCollections([n.tab.database]).toPromise()).data||[])[0]||[],n.colIdMap=C.keyBy(n.tab.allCollections,D.GR.name)}catch(i){n.ns.showErrorMessageFromErrorObject(i),n.tab.allCollections=[]}const _=n.navigationCS.getQueryParam(v.p.at_collection);n.tab.collection=_?C.find(n.tab.allCollections,{name:_}):n.tab.allCollections[0],yield n.loadInstanceAPIs(o),n.loading.dropdown=!1,n.cd.detectChanges()})()}loadInstanceAPIs(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,yield n.setCollectionInURL(o),!n.tab.instance||!n.tab.database||!n.tab.collection)return n.tab.apiList=[],void(n.loading.dropdown=!1);try{const i=n.tab.collection;i.removeStreamApisInResponse=!0,n.tab.apiList=(yield n.instanceS.instanceAPIList([i])).data||[]}catch(i){n.ns.showErrorMessageFromErrorObject(i),n.tab.apiList=[]}const _=n.navigationCS.getQueryParam(v.p.at_api);yield n.apiCommon(_)})()}loadLibraries(o){var n=this;return(0,S.Z)(function*(){n.resetDependentObjects("LIBRARY"),n.loading.dropdown=!0,n.tab.allApiBundles=yield n.tpStoreApiVersionS.getAllAPIBundles(),n.tpLibraryMap=C.keyBy(n.tab.allApiBundles,"value");const _=n.navigationCS.getQueryParam(v.p.at_bundleName);_&&(n.tab.tpApiBundle=C.find(n.tab.allApiBundles,{value:_})),!n.tab.tpApiBundle&&n.tab.allApiBundles.length&&(n.tab.tpApiBundle=n.tab.allApiBundles[0]),yield n.loadStoreApiVersions(o),n.loading.dropdown=!1,n.cd.detectChanges()})()}loadStoreApiVersions(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,n.resetDependentObjects("API_VERSION"),yield n.setLibraryInURL(o),!n.tab.tpApiBundle)return n.tab.allStoreApiVersions=[],void(n.tab.apiList=[]);n.tab.allStoreApiVersions=yield n.tpStoreApiVersionS.getAllStoreApiVersions([n.tab.tpApiBundle.value]);const _=n.navigationCS.getQueryParam(v.p.at_bundleName),i=n.navigationCS.getQueryParam(v.p.at_apiVersion);i&&(n.tab.tpStoreApiVersion=C.find(n.tab.allStoreApiVersions,{apiBundleName:_,storeApiVersion:i})),!n.tab.tpStoreApiVersion&&n.tab.allStoreApiVersions.length&&(n.tab.tpStoreApiVersion=n.tab.allStoreApiVersions[0]),yield n.loadThirdPartyAPIs(o),n.loading.dropdown=!1,n.cd.detectChanges()})()}loadThirdPartyAPIs(o){var n=this;return(0,S.Z)(function*(){if(n.loading.dropdown=!0,yield n.setTPApiVersionInURL(o),!n.tab.tpApiBundle||!n.tab.tpStoreApiVersion)return void(n.tab.apiList=[]);n.tab.apiList=(yield n.tpInstalledApisS.getThirdPartyAPIListArray([n.tab.tpStoreApiVersion]).toPromise()).data,n.tpPIMap=C.keyBy(n.tab.apiList,D.iH._id);const _=n.navigationCS.getQueryParam(v.p.at_api);yield n.apiCommon(_)})()}loadCustomAPIs(o){var n=this;return(0,S.Z)(function*(){n.loading.dropdown=!0;const _=yield n.functionS.getFunctionsAsAPI().toPromise();_.success&&_.data&&_.data.length&&(n.tab.apiList=_.data||[]);const i=n.navigationCS.getQueryParam(v.p.at_api);yield n.apiCommon(i)})()}loadSystemAPIs(o){var n=this;return(0,S.Z)(function*(){n.loading.dropdown=!0;const _=yield n.instanceS.systemAPIList().toPromise();_?.data?.length&&(n.tab.apiList=_.data||[]);const i=n.navigationCS.getQueryParam(v.p.at_api);yield n.apiCommon(i)})()}apiCommon(o){var n=this;return(0,S.Z)(function*(){n.loading.dropdown=!0,o?(n.tab.api=C.find(n.tab.apiList,{id:o}),n.tab.api||(n.tab.api=C.find(n.tab.apiList,{name:o}))):n.tab.api=n.tab.apiList[0],yield n.setApiInURL(),n.loading.dropdown=!1})()}categorySelected(o){var n=this;return(0,S.Z)(function*(){n.tab.apiCategory&&(yield n.navigationCS.setQueryParam(v.p.at_category,n.tab.apiCategory.id),o&&(yield n.generalS.resetUrlParams([v.p.at_instance,v.p.at_database,v.p.at_collection,v.p.at_bundleName,v.p.at_apiVersion,v.p.at_api])))})()}resetDependentObjects(o){"INSTANCE"===o?(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"===o?(this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===o?(this.tab.allCollections=this.tab.apiList=[],this.tab.collection=this.tab.api=void 0):"LIBRARY"===o?(this.tab.allApiBundles=this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpApiBundle=this.tab.api=this.tab.tpStoreApiVersion=void 0):"API_VERSION"===o&&(this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpStoreApiVersion=this.tab.api=void 0)}setInstanceInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.instance&&n.tab.instance._id&&(yield n.navigationCS.setQueryParam(v.p.at_instance,n.tab.instance._id),o&&(yield n.generalS.resetUrlParams([v.p.at_database,v.p.at_collection,v.p.at_api])))})()}setDatabaseInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.database&&n.tab.database._id&&(yield n.navigationCS.setQueryParam(v.p.at_database,n.tab.database._id),o&&(yield n.generalS.resetUrlParams([v.p.at_collection,v.p.at_api])))})()}setCollectionInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.collection&&n.tab.collection._id&&(yield n.navigationCS.setQueryParam(v.p.at_collection,n.tab.collection._id),o&&(yield n.generalS.resetUrlParams([v.p.at_api])))})()}setLibraryInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.tpApiBundle&&n.tab.tpApiBundle.value&&(yield n.navigationCS.setQueryParam(v.p.at_bundleName,n.tab.tpApiBundle.value),o&&(yield n.generalS.resetUrlParams([v.p.at_apiVersion,v.p.at_api])))})()}setTPApiVersionInURL(o){var n=this;return(0,S.Z)(function*(){n.tab.tpStoreApiVersion&&n.tab.tpStoreApiVersion._id&&(yield n.navigationCS.setQueryParam(v.p.at_apiVersion,n.tab.tpStoreApiVersion._id),o&&(yield n.generalS.resetUrlParams([v.p.at_api])))})()}setApiInURL(){var o=this;return(0,S.Z)(function*(){o.tab?.api?.id&&(yield o.navigationCS.setQueryParam(v.p.at_api,o.tab.api.id))})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(n){return new(n||m)(t.Y36(y.qu),t.Y36(O.b),t.Y36(W.a),t.Y36(Y.W),t.Y36(K.L),t.Y36(Q.D),t.Y36(J.E),t.Y36(V.S),t.Y36(H.f),t.Y36(q.d),t.Y36(j.d),t.Y36(R.B),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:m,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(n,_){1&n&&(t.TgZ(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"span",3),t._uU(5,"API Category"),t.qZA(),t.TgZ(6,"p-dropdown",4),t.NdJ("onChange",function(g){return _.tab.apiCategory=g.value,_.apiCategoryChangedEvent(!0)}),t.qZA()()()(),t.TgZ(7,"div",0),t.YNc(8,te,7,5,"div",5),t.qZA(),t.TgZ(9,"div",0),t.YNc(10,L,6,4,"div",5),t.qZA(),t.YNc(11,oe,8,3,"div",6),t.YNc(12,F,1,0,"p-progressSpinner",7),t.qZA()),2&n&&(t.xp6(6),t.Q6J("options",_.apiCategories)("ngModel",_.tab.apiCategory)("filter",!0),t.xp6(2),t.Q6J("ngIf",_.tab.apiCategory.id===_.EAPICategory.INSTANCES),t.xp6(2),t.Q6J("ngIf",_.tab.apiCategory.id===_.EAPICategory.THIRD_PARTY_APIS),t.xp6(1),t.Q6J("ngIf",_.tab.apiCategory.id!==_.EAPICategory.WEB_SOCKET_EVENT),t.xp6(1),t.Q6J("ngIf",_.loading.dropdown))},dependencies:[y.JJ,y.On,X.O5,U.jx,z.G,x.Lt],encapsulation:2})}return m})()},2726:(de,k,r)=>{r.d(k,{x:()=>ce});var S=r(5861),e=r(4946),T=r(3157),C=r(328),s=r(6990),D=r(5085),t=r(6212),y=r(1162),O=r(6925),W=r(7240),Y=r(9961),K=r(262),Q=r(5852),J=r(7414),V=r(2915),H=r(5405),q=r(7629),j=r(2189),R=r(5219),X=r(7664),U=r(95),z=r(6814),x=r(5431),N=r(7680),ee=r(3259),te=r(8057),ne=r(8980);const L=["webSocketEventsManFormC"];function ae(l,b){if(1&l){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 h(l,b){if(1&l){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 w(l,b){if(1&l){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 c(l,b){if(1&l){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,ae,2,0,"span",14),e.YNc(4,h,2,0,"span",15),e.YNc(5,w,2,0,"span",16),e.qZA()}if(2&l){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 p(l,b){if(1&l){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&l){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.group.apisRegex.allWebSocketEvents)("binary",!0)}}function f(l,b){if(1&l){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&l){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)("binary",!0)}}function M(l,b){if(1&l&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&l){const a=e.oxw();e.xp6(2),e.Oqu(a.constantsS.group.allWebSocketEventsPermitted)}}function se(l,b){1&l&&(e.TgZ(0,"th",36),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function oe(l,b){1&l&&e._UZ(0,"th",37)}function F(l,b){1&l&&e._UZ(0,"th",38)}function B(l,b){if(1&l&&(e.TgZ(0,"tr"),e.YNc(1,se,2,0,"th",32),e.YNc(2,oe,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,F,1,0,"th",35),e.qZA()),2&l){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 m(l,b){if(1&l&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",41),e.qZA()),2&l){const a=e.oxw().$implicit;e.xp6(1),e.Q6J("value",a)("pSelectableRow",a)}}function I(l,b){if(1&l&&(e.TgZ(0,"td",42)(1,"span"),e._uU(2),e.qZA()()),2&l){const a=e.oxw().rowIndex;e.xp6(2),e.Oqu(a+1)}}function o(l,b){if(1&l&&(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&l){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 n(l,b){if(1&l&&(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&l){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 _(l,b){if(1&l&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&l){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function i(l,b){if(1&l&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&l){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function g(l,b){if(1&l&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&l){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function E(l,b){if(1&l){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&l){const a=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",a.saveResponseInLog)("binary",!0)}}function P(l,b){if(1&l&&(e.TgZ(0,"td"),e.YNc(1,E,3,2,"div",6),e.qZA()),2&l){const a=e.oxw().$implicit,d=e.oxw(2);e.xp6(1),e.Q6J("ngIf",d.selectedRows.indexOf(a)>=0)}}function Z(l,b){if(1&l&&(e.TgZ(0,"tr",39),e.YNc(1,m,2,2,"td",6),e.YNc(2,I,3,1,"td",40),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e.YNc(6,o,15,4,"div",6),e.YNc(7,n,11,3,"div",6),e.YNc(8,_,3,1,"div",6),e.YNc(9,i,3,1,"div",6),e.YNc(10,g,3,1,"div",6),e.qZA(),e.YNc(11,P,2,1,"td",6),e.qZA()),2&l){const a=b.$implicit,d=e.oxw(2);e.Q6J("pSelectableRow",a),e.xp6(1),e.Q6J("ngIf",d.showCheckbox),e.xp6(1),e.Q6J("ngIf",!d.isDependentOnGroup&&!d.isLPM&&!d.isFilterLogTable),e.xp6(2),e.Oqu(a.categoryUI),e.xp6(2),e.Q6J("ngIf",a.apiCategory===d.EAPICategory.INSTANCES),e.xp6(1),e.Q6J("ngIf",a.apiCategory===d.EAPICategory.THIRD_PARTY_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===d.EAPICategory.SYSTEM_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===d.EAPICategory.CUSTOM_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===d.EAPICategory.WEB_SOCKET_EVENT),e.xp6(1),e.Q6J("ngIf",d.isLPM)}}function ie(l,b){1&l&&e._UZ(0,"p-progressSpinner",45)}function re(l,b){if(1&l){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,B,8,3,"ng-template",29),e.YNc(3,Z,12,10,"ng-template",30),e.qZA(),e.YNc(4,ie,1,0,"p-progressSpinner",31),e.qZA()}if(2&l){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 ce=(()=>{class l{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:C.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=y.iH._id;EAPICategory=D.R;ERequestMethod=O.Yp;webSocketEventsManFormC;constructor(a,d,u,A,G,le,_e,pe,me,ge,ve,ue){this.generalS=a,this.notificationS=d,this.webSocketEventsS=u,this.authCS=A,this.constantsS=G,this.eventCenterS=le,this.cd=_e,this.eventCenterCS=pe,this.functionS=me,this.navigationCS=ge,this.confirmationService=ve,this.router=ue}ngOnInit(){var a=this;this.loadGridData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(d=>{(d.action===T.F.SAVED||d.action===T.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadGridData().then())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var d=(0,S.Z)(function*(u){u.length&&(yield a.loadGridData())});return function(u){return d.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(d=>{d&&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 d=yield a.webSocketEventsS.getWSEventKGrid({}).toPromise();d.success?(a.selectedRows=[],a.rows=d.data,a.rowsMap=s.keyBy(a.rows,y.iH._id),a.rowsMapName=s.keyBy(a.rows,y.of.id)):a.resetGridAndUrl();const u=a.navigationCS.getQueryParam(t.p.am_ws_event)||(a.isFilterLogTable?a.eventCenterS.filterInLog.webSocketIds.value.join(","):a.eventCenterS.group.webSocketIds.value.join(","));if(u){const A=u.split(","),G=s.intersection(s.keys(a.rowsMap),A),le=[];for(const _e of G)a.rowsMap[_e]&&le.push(a.rowsMap[_e]);a.selectedRows=le,a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next(le),a.eventCenterS.filterInLog.webSocketIds.next(G)}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 G of A?.queryParams?.webSocketEventNames)a.rowsMapName[G]&&(a.rowsMapName[G].saveResponseInLog=A.webSocketEventsLog?.[G]?.saveResponseInLog||!1);a.setResDataInEventCenter()}setTimeout(()=>{a.loading.grid=!1,a.cd.detectChanges()},100)})()}add(){this.data.formData=void 0,this.data.mode=C.D.ADD,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}view(){this.data.formData=this.selectedRows[0],this.data.mode=C.D.VIEW,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_VIEW_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=C.D.EDIT,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal()}removePermanentDialog(){var a=this;return(0,S.Z)(function*(){var d;a.confirmationService.confirm({message:a.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,S.Z)(function*(){yield a.removePermanent()}),function(){return d.apply(this,arguments)})})})()}removePermanent(){var a=this;return(0,S.Z)(function*(){a.loading.grid=!0;const d=yield a.webSocketEventsS.permanentDelete(a.selectedRows[0]._id).toPromise();a.loading.grid=!1,d.success?(a.notificationS.showSuccess(a.constantsS.webSocketEvents.removePermanent),a.resetGridAndUrl(),a.loadGridData().then(),a.selectedRows=[]):a.notificationS.showErrorFromResponse(d,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(t.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(s.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 d=(a.selectedRows[0]?.nameUI||"").split("/");a.generalS.setNewTitle(d[d.length-1],D.R.WEB_SOCKET_EVENT)}})()}fillData(){var a=this;return(0,S.Z)(function*(){if(!a.selectedRows.length)return yield a.navigationCS.setQueryParam(t.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(s.map(a.selectedRows,"_id")),a.eventCenterS.group.webSocketApis.next(a.selectedRows),a.isFilterLogTable&&(a.eventCenterS.filterInLog.webSocketIds.next(s.map(a.selectedRows,"_id")),a.eventCenterS.filterInLog.webSocketApis.next(a.selectedRows));else{const d=(yield a.webSocketEventsS.getById(a.selectedRows[0]._id).toPromise()).data;d._id?(yield a.navigationCS.setQueryParam(t.p.am_ws_event,d._id),a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([d])):a.resetThisUrl()}})()}checkedChangeGridItem(a){var d=this;setTimeout((0,S.Z)(function*(){d.selectedRows.push(a),d.selectedRows=s.uniq(d.selectedRows);for(const u in d.rowsMap){const A=d.rowsMap[u];-1===d.selectedRows.indexOf(A)&&(A.saveResponseInLog=!1)}d.setResDataInEventCenter(),d.cd.detectChanges()}),100)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(d){return new(d||l)(e.Y36(W.b),e.Y36(Y.W),e.Y36(K.a),e.Y36(Q.D),e.Y36(J.L),e.Y36(V.u),e.Y36(e.sBO),e.Y36(H.M),e.Y36(q.d),e.Y36(j.S),e.Y36(R.YP),e.Y36(X.F0))};static \u0275cmp=e.Xpm({type:l,selectors:[["app-web-socket-events-grid"]],viewQuery:function(d,u){if(1&d&&e.Gf(L,5),2&d){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(d,u){1&d&&(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,c,6,3,"span",6),e.YNc(9,p,3,2,"span",7),e.YNc(10,f,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,M,3,1,"div",6),e.YNc(13,re,5,7,"div",9),e.qZA()(),e._UZ(14,"app-web-socket-events-man-form",10,11)),2&d&&(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:[U.JJ,U.On,z.O5,x.iA,R.jx,x.Ei,x.UA,x.Mo,N.G,ee.u,te.XZ,ne.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 l})()},8980:(de,k,r)=>{r.d(k,{D:()=>ae});var S=r(5861),e=r(95),T=r(3157),C=r(328),s=r(7850),v=r(6212),D=r(1162),t=r(4946),y=r(7240),O=r(262),W=r(9961),Y=r(7414),K=r(5852),Q=r(2559),J=r(4977),V=r(2189),H=r(6814),q=r(2660),j=r(7680),R=r(4061);const X=["webSocketEventsFormSecondC"];function U(h,w){1&h&&(t.TgZ(0,"span"),t._UZ(1,"i",17),t._uU(2," Add WebSocket Event"),t.qZA())}function z(h,w){1&h&&(t.TgZ(0,"span"),t._UZ(1,"i",18),t._uU(2," View WebSocket Event"),t.qZA())}function x(h,w){1&h&&(t.TgZ(0,"span"),t._UZ(1,"i",19),t._uU(2," Edit WebSocket Event"),t.qZA())}function N(h,w){1&h&&(t.TgZ(0,"div",20)(1,"div",21)(2,"span",22),t._uU(3,"Name"),t.qZA(),t._UZ(4,"input",23),t.qZA()())}function ee(h,w){1&h&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function te(h,w){1&h&&(t.TgZ(0,"span"),t._uU(1,"Update"),t.qZA())}function ne(h,w){if(1&h){const c=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){t.CHM(c);const f=t.oxw();return t.KtG(f.save())}),t._UZ(1,"i",25),t.YNc(2,ee,2,0,"span",4),t.YNc(3,te,2,0,"span",4),t.qZA()}if(2&h){const c=t.oxw();t.xp6(2),t.Q6J("ngIf",c.data.mode===c.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",c.data.mode===c.EFormMode.EDIT)}}function L(h,w){1&h&&t._UZ(0,"p-progressSpinner",26)}let ae=(()=>{class h{fb;generalS;webSocketEventsS;ns;constantsS;authCS;tpInstalledApisS;tpStoreApiVersionS;navigationCS;cd;data;EFormMode=C.D;form;subscriptions=[];loading={form:!1};EAPICategory=s.R;wsFormSecondC;constructor(c,p,f,M,se,oe,F,B,m,I){this.fb=c,this.generalS=p,this.webSocketEventsS=f,this.ns=M,this.constantsS=se,this.authCS=oe,this.tpInstalledApisS=F,this.tpStoreApiVersionS=B,this.navigationCS=m,this.cd=I}ngOnInit(){var c=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var p=(0,S.Z)(function*(f){if(f)if(c.form.enable(),f.action===T.F.OPEN_FORM_IN_EDIT_MODE){if(!c.data.formData)return;const M=yield c.webSocketEventsS.getById(c.data.formData._id).toPromise();c.form.reset(),yield c.editModelLoadData(M.data),c.form.patchValue(M.data)}else if(f.action===T.F.OPEN_FORM_IN_VIEW_MODE){if(!c.data.formData)return;const M=yield c.webSocketEventsS.getById(c.data.formData._id).toPromise();c.form.reset(),c.form.patchValue(M.data),c.form.disable()}else f.action===T.F.OPEN_FORM_IN_ADD_MODE&&c.form.reset()});return function(f){return p.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[e.kI.required]]})}showModal(){var c=this;return(0,S.Z)(function*(){$("#idWebSocketEventsForm").modal("show"),setTimeout((0,S.Z)(function*(){yield c.wsFormSecondC.loadApiCategories()}),100)})()}hideModal(){$("#idWebSocketEventsForm").modal("hide")}editModelLoadData(c){var p=this;return(0,S.Z)(function*(){if(yield p.wsFormSecondC.categorySelected(!0),p.wsFormSecondC.tab.apiCategory=p.wsFormSecondC.apiCategoriesMap[c.apiCategory],yield p.navigationCS.setQueryParam(v.p.at_category,c.apiCategory),c.apiCategory===s.R.SYSTEM_APIS)yield p.navigationCS.setQueryParam(v.p.at_api,c.systemApiName);else if(c.apiCategory===s.R.CUSTOM_APIS)yield p.navigationCS.setQueryParam(v.p.at_api,c.customApiName);else if(c.apiCategory===s.R.INSTANCES)yield p.navigationCS.setQueryParam(v.p.at_instance,c.instanceName),yield p.navigationCS.setQueryParam(v.p.at_database,c.databaseName),yield p.navigationCS.setQueryParam(v.p.at_collection,c.collectionName),yield p.navigationCS.setQueryParam(v.p.at_api,c.instanceApiName);else if(c.apiCategory===s.R.THIRD_PARTY_APIS){const f=(yield p.tpInstalledApisS.query({find:{bundleName:c.tpInstalledApiBundleName,apiVersion:c.tpInstalledApiVersion,name:c.tpInstalledApiName,user:c.user,active:!0},limit:1}).toPromise())?.data?.[0];if(f){const M=(yield p.tpStoreApiVersionS.query({find:{apiBundleName:f.bundleName,storeApiVersion:f.apiVersion,user:f.user,active:!0},limit:1}).toPromise()).data?.[0];yield p.navigationCS.setQueryParam(v.p.at_bundleName,f.bundleName),yield p.navigationCS.setQueryParam(v.p.at_apiVersion,M.storeApiVersion),yield p.navigationCS.setQueryParam(v.p.at_api,f.name)}}})()}save(){var c=this;return(0,S.Z)(function*(){const p=c.form.getRawValue();if(p.user=c.authCS.getUserId(),p.apiCategory=c.wsFormSecondC.tab.apiCategory.id,p.apiCategory===s.R.WEB_SOCKET_EVENT&&!p.name)return c.ns.showError("Please provide websocket events name.");p.apiCategory===s.R.CUSTOM_APIS&&(p.customApiName=c.wsFormSecondC.tab.api.customApiName),p.apiCategory===s.R.SYSTEM_APIS&&(p.systemApiName=c.wsFormSecondC.tab.api.systemApiId),p.apiCategory===s.R.THIRD_PARTY_APIS&&(p.tpInstalledApiBundleName=c.wsFormSecondC.tab.api.bundleName,p.tpInstalledApiVersion=c.wsFormSecondC.tab.api.apiVersion,p.tpInstalledApiName=c.wsFormSecondC.tab.api.name),p.apiCategory===s.R.INSTANCES&&(p.instanceName=c.wsFormSecondC.tab.instance.name,p.databaseName=c.wsFormSecondC.tab.database.db,p.collectionName=c.wsFormSecondC.tab.collection.name,p.instanceApiName=c.wsFormSecondC.tab.api.id);try{let f;c.loading.form=!0,p.apiCategory!==s.R.WEB_SOCKET_EVENT&&delete p.name,c.data.mode===C.D.ADD?f=yield c.webSocketEventsS.post(p).toPromise():c.data.mode===C.D.EDIT&&(f=yield c.webSocketEventsS.put(c.data.formData._id,p,{select:D.iH._id}).toPromise()),f&&(c.ns.showSuccess(c.data.mode===C.D.ADD?c.constantsS.webSocketEvents.addSuccess:c.constantsS.webSocketEvents.editSuccess),c.data.eventChannel.emit({action:c.data.mode===C.D.ADD?T.F.SAVED:T.F.UPDATED})),c.loading.form=!1}catch(f){c.loading.form=!1,c.ns.showErrorFromResponse(f.error||f,"Unable to save websocket event.")}c.cd.detectChanges()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(p){return new(p||h)(t.Y36(e.qu),t.Y36(y.b),t.Y36(O.a),t.Y36(W.W),t.Y36(Y.L),t.Y36(K.D),t.Y36(Q.d),t.Y36(J.f),t.Y36(V.S),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:h,selectors:[["app-web-socket-events-man-form"]],viewQuery:function(p,f){if(1&p&&t.Gf(X,5),2&p){let M;t.iGM(M=t.CRH())&&(f.wsFormSecondC=M.first)}},inputs:{data:"data"},decls:21,vars:7,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"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],["webSocketEventsFormSecondC",""],["class","form-group row m-0",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"],[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"],["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(p,f){if(1&p&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,U,3,0,"span",4),t.YNc(5,z,3,0,"span",4),t.YNc(6,x,3,0,"span",4),t.TgZ(7,"button",5)(8,"span",6),t._UZ(9,"i",7),t.qZA()()(),t.TgZ(10,"div",8)(11,"form",9),t._UZ(12,"app-web-socket-events-form-second",null,10),t.YNc(14,N,5,0,"div",11),t.qZA()(),t.TgZ(15,"div",12)(16,"button",13),t._UZ(17,"i",14),t._uU(18," Close"),t.qZA(),t.YNc(19,ne,4,2,"button",15),t.qZA(),t.YNc(20,L,1,0,"p-progressSpinner",16),t.qZA()()()),2&p){const M=t.MAs(13);t.xp6(4),t.Q6J("ngIf",f.data.mode===f.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",f.data.mode===f.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",f.data.mode===f.EFormMode.EDIT),t.xp6(5),t.Q6J("formGroup",f.form),t.xp6(3),t.Q6J("ngIf",M.tab.apiCategory.id===f.EAPICategory.WEB_SOCKET_EVENT),t.xp6(5),t.Q6J("ngIf",f.data.mode!==f.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",f.loading.form)}},dependencies:[e._Y,e.Fj,e.JJ,e.JL,e.sg,e.u,H.O5,q.y,j.G,R.T],encapsulation:2})}return h})()},1025:(de,k,r)=>{r.r(k),r.d(k,{WebSocketEventsM:()=>o});var S=r(7664),e=r(8176),T=r(3726),s=(r(4061),r(4946)),v=r(2726);let D=(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(g){return new(g||n)};static \u0275cmp=s.Xpm({type:n,selectors:[["app-web-socket-events-layout-grid"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(g,E){1&g&&(s.TgZ(0,"div",0),s._UZ(1,"app-web-socket-events-grid",1),s.qZA()),2&g&&(s.xp6(1),s.Q6J("showCheckbox",!1))},dependencies:[v.x],encapsulation:2})}return n})();var t=r(5861),y=r(3157),O=r(328),W=r(5085),Y=r(6212),K=r(1162),Q=r(6925),J=r(7240),V=r(9961),H=r(262),q=r(5852),j=r(7414),R=r(2915),X=r(5405),U=r(7629),z=r(2189),x=r(5219),N=r(6814),ee=r(7526),te=r(7680),ne=r(3259),L=r(8980);const ae=["webSocketEventsManFormC"];function h(n,_){if(1&n){const i=s.EpF();s.TgZ(0,"span",19),s.NdJ("click",function(){s.CHM(i);const E=s.oxw();return s.KtG(E.edit())}),s._UZ(1,"i",20),s.qZA()}}function w(n,_){if(1&n){const i=s.EpF();s.TgZ(0,"span",21),s.NdJ("click",function(){s.CHM(i);const E=s.oxw();return s.KtG(E.removePermanentDialog())}),s._UZ(1,"i",22),s.qZA()}}function c(n,_){if(1&n&&(s.TgZ(0,"div")(1,"div",23),s._uU(2),s.qZA()()),2&n){const i=s.oxw();s.xp6(2),s.Oqu(i.constantsS.group.allWebSocketEventsPermitted)}}function p(n,_){if(1&n&&(s.TgZ(0,"div"),s._uU(1),s.qZA()),2&n){const i=s.oxw().$implicit;s.xp6(1),s.Oqu(i.label)}}const f=function(n,_,i,g){return{get:n,put:_,post:i,delete:g}};function M(n,_){if(1&n&&(s.TgZ(0,"div")(1,"span",25),s._uU(2),s.qZA(),s.TgZ(3,"span"),s._uU(4),s.qZA()()),2&n){const i=s.oxw().$implicit,g=s.oxw();s.xp6(1),s.Q6J("ngClass",s.l5B(3,f,i.data.requestMethod===g.ERequestMethod.GET,i.data.requestMethod===g.ERequestMethod.PUT,i.data.requestMethod===g.ERequestMethod.POST,i.data.requestMethod===g.ERequestMethod.DELETE)),s.xp6(1),s.Oqu(i.data.requestMethod),s.xp6(2),s.Oqu(i.data.name||i.label)}}function se(n,_){if(1&n){const i=s.EpF();s.TgZ(0,"div",24),s.NdJ("click",function(){const P=s.CHM(i).$implicit,Z=s.oxw();return P.children&&(P.isExpanded=!0),s.KtG(Z.selectedRows=[P._id])}),s.YNc(1,p,2,1,"div",12),s.YNc(2,M,5,8,"div",12),s.qZA()}if(2&n){const i=_.$implicit,g=s.oxw();s.xp6(1),s.Q6J("ngIf",(null==i.children?null:i.children.length)||(null==i||null==i.data?null:i.data.apiCategory)!==g.EAPICategory.CUSTOM_APIS),s.xp6(1),s.Q6J("ngIf",!(null!=i.children&&i.children.length)&&(null==i||null==i.data?null:i.data.apiCategory)===g.EAPICategory.CUSTOM_APIS)}}function oe(n,_){1&n&&s._UZ(0,"p-progressSpinner",26)}let F=(()=>{class n{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;loading={grid:!1};subscriptions=[];data={mode:O.D.ADD,eventChannel:new s.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=K.iH._id;EAPICategory=W.R;ERequestMethod=Q.Yp;treeNodes=[];allTreeItemsMap={};leafSelected=!1;webSocketEventsManFormC;constructor(i,g,E,P,Z,ie,re,ce,l,b,a,d){this.generalS=i,this.notificationS=g,this.webSocketEventsS=E,this.authCS=P,this.constantsS=Z,this.eventCenterS=ie,this.cd=re,this.eventCenterCS=ce,this.functionS=l,this.navigationCS=b,this.confirmationService=a,this.router=d}ngOnInit(){this.loadTreeData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(i=>{(i.action===y.F.SAVED||i.action===y.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadTreeData().then())})),this.generalS.setNewTitle("API Maker - WebSocket Events")}add(){this.data.formData=void 0,this.data.mode=O.D.ADD,this.data.eventChannel.emit({action:y.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.selectedRows.length&&(this.data.formData=this.selectedRows[0].data,this.data.mode=O.D.EDIT,this.data.eventChannel.emit({action:y.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal().then())}removePermanentDialog(){var i=this;return(0,t.Z)(function*(){var g;i.confirmationService.confirm({message:i.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(g=(0,t.Z)(function*(){yield i.removePermanent()}),function(){return g.apply(this,arguments)})})})()}removePermanent(){var i=this;return(0,t.Z)(function*(){i.loading.grid=!0;const g=i.selectedRows[0].data,E=yield i.webSocketEventsS.permanentDelete(g._id).toPromise();i.loading.grid=!1,E.success?(i.notificationS.showSuccess(i.constantsS.webSocketEvents.removePermanent),i.resetGridAndUrl(),i.loadTreeData().then(),i.selectedRows=[]):i.notificationS.showErrorFromResponse(E,i.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}navigateToGrid(){var i=this;return(0,t.Z)(function*(){i.router.navigate(["api-info","web-socket-events","layout-grid"]).then()})()}loadTreeData(){var i=this;return(0,t.Z)(function*(){const g=(yield i.functionS.getWSEventKTree().toPromise()).data;for(const P of g)i.generalS.convertKTreeItemToPrimeNGTreeItem(P);const E={};i.generalS.getMapOfAllItems(E,g),i.generalS.setIsExpandedStateFromOldMap(i.allTreeItemsMap,E),i.treeNodes=g,i.allTreeItemsMap=E,i.loading.grid=!1,i.cd.detectChanges()})()}resetThisUrl(){var i=this;return(0,t.Z)(function*(){i.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield i.navigationCS.setQueryParam(Y.p.am_ws_event,null)})()}selectedKeysChange(){var i=this;return(0,t.Z)(function*(){if(i.selectedRows.length){const g=i.selectedRows[0];g.children?.length?i.leafSelected=!1:(i.leafSelected=!0,g&&g?.label?i.generalS.setNewTitle(g.label,W.R.WEB_SOCKET_EVENT):i.generalS.setNewTitle("API Maker - WebSocket Events"),yield i.resetThisUrl())}else i.leafSelected=!1})()}dblClickTreeEvent(){this.leafSelected&&this.selectedRows.length&&this.edit()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(g){return new(g||n)(s.Y36(J.b),s.Y36(V.W),s.Y36(H.a),s.Y36(q.D),s.Y36(j.L),s.Y36(R.u),s.Y36(s.sBO),s.Y36(X.M),s.Y36(U.d),s.Y36(z.S),s.Y36(x.YP),s.Y36(S.F0))};static \u0275cmp=s.Xpm({type:n,selectors:[["app-web-socket-events-tree"]],viewQuery:function(g,E){if(1&g&&s.Gf(ae,5),2&g){let P;s.iGM(P=s.CRH())&&(E.webSocketEventsManFormC=P.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(g,E){1&g&&(s.TgZ(0,"div",0)(1,"div",1)(2,"span"),s._UZ(3,"img",2),s._uU(4," WebSocket Events"),s.qZA(),s.TgZ(5,"span")(6,"a",3),s._UZ(7,"img",4),s.qZA(),s.TgZ(8,"span",5),s.NdJ("click",function(){return E.add()}),s._UZ(9,"i",6),s.qZA(),s.TgZ(10,"span",7),s.NdJ("click",function(){return E.navigateToGrid()}),s._UZ(11,"i",8),s.qZA(),s.YNc(12,h,2,0,"span",9),s.YNc(13,w,2,0,"span",10),s.qZA()(),s.TgZ(14,"div",11),s.YNc(15,c,3,1,"div",12),s.TgZ(16,"div",13)(17,"p-tree",14),s.NdJ("selectionChange",function(Z){return E.selectedRows=Z})("dblclick",function(){return E.dblClickTreeEvent()})("selectionChange",function(){return E.selectedKeysChange()}),s.YNc(18,se,3,2,"ng-template",15),s.qZA(),s.YNc(19,oe,1,0,"p-progressSpinner",16),s.qZA()()(),s._UZ(20,"app-web-socket-events-man-form",17,18)),2&g&&(s.xp6(12),s.Q6J("ngIf",E.leafSelected),s.xp6(1),s.Q6J("ngIf",E.leafSelected),s.xp6(2),s.Q6J("ngIf",E.eventCenterS.group.apisRegex.allWebSocketEvents||E.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),s.xp6(2),s.Q6J("value",E.treeNodes)("selection",E.selectedRows),s.xp6(2),s.Q6J("ngIf",E.loading.grid),s.xp6(1),s.Q6J("data",E.data))},dependencies:[N.mk,N.O5,x.jx,ee.mp,te.G,ne.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 n})();const m=[{path:"",redirectTo:"layout-tree",pathMatch:"full"},{path:"layout-tree",component:(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(g){return new(g||n)};static \u0275cmp=s.Xpm({type:n,selectors:[["app-web-socket-events-layout-tree"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(g,E){1&g&&(s.TgZ(0,"div",0),s._UZ(1,"app-web-socket-events-tree"),s.qZA())},dependencies:[F],encapsulation:2})}return n})(),canActivate:[T.P]},{path:"layout-grid",component:D,canActivate:[T.P]}];let o=(()=>{class n{static \u0275fac=function(g){return new(g||n)};static \u0275mod=s.oAB({type:n});static \u0275inj=s.cJS({imports:[S.Bz.forChild(m),e.u]})}return n})()}}]);
|
package/dist/148.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[148],{148:(Xe,I,a)=>{a.r(I),a.d(I,{LogProfileM:()=>Je});var M=a(7664),b=a(8176),O=a(3726),F=a(1025),p=a(5861),v=a(5085),R=a(2452),e=a(4946),x=a(2915),Z=a(3429),C=a(7414),S=a(6814),h=a(5219),y=a(7680),U=a(5043),G=a(3885),Y=a(559),J=a(6937),Q=a(356),k=a(9329),q=a(7595),K=a(3824),W=a(8651),V=a(6607),B=a(5305),H=a(2726),c=a(3157),g=a(328),f=a(6212),m=a(6990),d=a(1162),j=a(6925),D=a(7031),w=a(7240),T=a(9961),X=a(2189),L=a(5852),z=a(3065),ee=a(7629),te=a(1042),ne=a(7145),oe=a(2559),se=a(262),_=a(5431),ae=a(3259),u=a(95),re=a(2660),ie=a(8057);function le(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add Log Profile"),e.qZA())}function pe(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View Log Profile"),e.qZA())}function de(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit Log Profile"),e.qZA())}function ce(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save Log Profile"),e.qZA())}function ge(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update Log Profile"),e.qZA())}function ue(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",27),e.YNc(2,ce,2,0,"span",4),e.YNc(3,ge,2,0,"span",4),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function me(s,i){1&s&&e._UZ(0,"p-progressSpinner",28)}let E=(()=>{class s{fb;ns;logProfileS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=g.D;form;subscriptions=[];constructor(t,o,n,r,l,A){this.fb=t,this.ns=o,this.logProfileS=n,this.generalS=r,this.authCS=l,this.constantsS=A}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var o=(0,p.Z)(function*(n){if(n)if(t.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data)}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else n.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.setDefaultValuesInForm())});return function(n){return o.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],isDefault:[!0,[]]})}setDefaultValuesInForm(){this.form.patchValue({isDefault:!0})}showModal(){$("#idLogProfileForm").modal("show")}hideModal(){$("#idLogProfileForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const o=t.form.getRawValue();o.user=t.authCS.getUserId();try{let n;t.loading.form=!0,t.data.mode===g.D.ADD?n=yield t.logProfileS.post(o).toPromise():t.data.mode===g.D.EDIT&&(n=yield t.logProfileS.put(t.data.formData._id,o,{select:d.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===g.D.ADD?t.constantsS.logProfile.addSuccess:t.constantsS.logProfile.editSuccess),t.data.eventChannel.emit({action:t.data.mode===g.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(n){t.loading.form=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to save log profile.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||s)(e.Y36(u.qu),e.Y36(T.W),e.Y36(D.T),e.Y36(w.b),e.Y36(L.D),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles-form"]],inputs:{data:"data"},decls:31,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idLogProfileForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4"],[1,"align-middle","mb-0","pt-1"],["formControlName","isDefault","inputId","idIsActive",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,le,3,0,"span",4),e.YNc(5,pe,3,0,"span",4),e.YNc(6,de,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),e._uU(16,"Name"),e.qZA(),e.TgZ(17,"div",11),e._UZ(18,"input",14),e.qZA()()(),e.TgZ(19,"div",15)(20,"div",12)(21,"label",13),e._uU(22,"Active"),e.qZA(),e.TgZ(23,"label",16),e._UZ(24,"p-checkbox",17),e.qZA()()()()()(),e.TgZ(25,"div",18)(26,"button",19),e._UZ(27,"i",20),e._uU(28," Close"),e.qZA(),e.YNc(29,ue,4,3,"button",21),e.qZA(),e.YNc(30,me,1,0,"p-progressSpinner",22),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(13),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.O5,re.y,y.G,ie.XZ],encapsulation:2})}return s})();const fe=["logProfilesFormC"];function ve(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function Ce(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function Se(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function he(s,i){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24)(4,"th",24),e.qZA())}function ye(s,i){1&s&&e._UZ(0,"i",28)}function Pe(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"i",29),e.NdJ("click",function(n){e.CHM(t);const r=e.oxw().$implicit,l=e.oxw();return e.KtG(l.saveLogProfilePermissions(n,r))}),e.qZA()}}function Ae(s,i){if(1&s&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ye,1,0,"i",26),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Pe,1,0,"i",27),e.qZA()()),2&s){const t=i.$implicit,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",(null==o.selectedRows||null==o.selectedRows[0]?null:o.selectedRows[0]._id)===t._id)}}function Ie(s,i){1&s&&e._UZ(0,"p-progressSpinner",30)}let N=(()=>{class s{logProfileS;generalS;ns;navigationCS;authCS;constantsS;apiS;instanceS;functionS;schedulerS;amEventS;tpInstalledApisS;webSocketEventsS;confirmationService;eventCenterS;logProfilesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=d.iH._id;constructor(t,o,n,r,l,A,Qe,ke,qe,Ke,We,Ve,Be,He,je){this.logProfileS=t,this.generalS=o,this.ns=n,this.navigationCS=r,this.authCS=l,this.constantsS=A,this.apiS=Qe,this.instanceS=ke,this.functionS=qe,this.schedulerS=Ke,this.amEventS=We,this.tpInstalledApisS=Ve,this.webSocketEventsS=Be,this.confirmationService=He,this.eventCenterS=je}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.logProfilesFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Log Profile")}loadGridData(){var t=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.logProfileS.query(o).subscribe(function(){var n=(0,p.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=m.keyBy(t.rows,d.iH._id));let l=t.navigationCS.getQueryParam(f.p.log_profile);l?!t.rowsMap[l]&&t.rows.length&&(l=t.rows[0]._id):t.rows.length&&(l=t.rows[0]._id),t.rowsMap[l]&&(t.selectedRows=[t.rowsMap[l]],yield t.fillData()),t.generalS.setNewTitle("API Maker - Log Profile"),t.loading.grid=!1});return function(r){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.logProfilesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.logProfilesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.logProfilesFormC.showModal()}clone(){var t=this;return(0,p.Z)(function*(){try{if(!t.selectedRows[0])return;const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;delete o._id,delete o.queryParamsMap,o.isDefault=!1,o.name=`${o.name}-clone`,(yield t.logProfileS.post(o).toPromise()).success?(t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess),t.loadGridData()):t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess)}catch{t.ns.showError(t.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.logProfile.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const o=yield t.logProfileS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,o.success?(t.ns.showSuccess(t.constantsS.logProfile.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.ns.showErrorFromResponse(o,t.constantsS.logProfile.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([f.p.log_profile,f.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.selectedSystemApis.next([]),t.eventCenterS.group.selectedFunctions.next([]),t.eventCenterS.group.selectedThirdPartyAPIs.next([]),t.eventCenterS.group.selectedSupportedAPIs.next([]),t.eventCenterS.group.selectedEvents.next([]),t.eventCenterS.group.selectedSchedulers.next([]),t.eventCenterS.group.selectedWebSocket.next([]),t.eventCenterS.group.apisRegex={}})()}logProfileSelected(){var t=this;return(0,p.Z)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return void t.resetDependents();const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;o&&o.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(o.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(o.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(o.queryParams.supportedApiNames||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(o.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.thirdPartyApiNames,t.tpInstalledApisS,v.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.eventIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.eventNames,t.amEventS))||[]),t.eventCenterS.group.schedulersIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.schedulerNames,t.schedulerS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(o.queryParams.webSocketEventNames))),o&&(t.eventCenterS.group.selectedGroups.next([o]),t.eventCenterS.group.apisRegex=o.apisRegex,yield t.navigationCS.setQueryParam(f.p.log_profile,t.selectedRows[0]._id)),o?.queryParams||(yield t.resetDependents())})()}saveLogProfilePermissions(t,o){var n=this;return(0,p.Z)(function*(){t.stopImmediatePropagation();const r=JSON.parse(JSON.stringify(o));r.supportedApiLog=n.getApiLogObj(n.eventCenterS.group.selectedSupportedAPIs.value,d.qD._id),r.functionsLog=n.getApiLogObj(n.eventCenterS.group.selectedFunctions.value,d.qD.name),r.systemApisLog=n.getApiLogObj(n.eventCenterS.group.selectedSystemApis.value,d.qD._id),r.thirdPartyApisLog=n.getApiLogObj(n.eventCenterS.group.selectedThirdPartyAPIs.value,d.qD.nameId),r.eventLog=n.getApiLogObj(n.eventCenterS.group.selectedEvents.value,d.qD.name),r.schedulersLog=n.getApiLogObj(n.eventCenterS.group.selectedSchedulers.value,d.qD.name),r.webSocketEventsLog=n.getApiLogObj(n.eventCenterS.group.selectedWebSocket.value,d.qD.id),r.apisRegex=n.eventCenterS.group.apisRegex,r.queryParams={},r.user=n.authCS.getUserId(),r.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),r.queryParams.databaseNames=m.uniq(n.eventCenterS.group.databaseNames.value),r.queryParams.collectionNames=m.uniq(n.eventCenterS.group.collectionNames.value),r.queryParams.supportedApiNames=m.uniq(n.eventCenterS.group.supportedApiIds.value),r.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),r.queryParams.systemApiNames=m.uniq(n.eventCenterS.group.systemApiIds.value),r.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,v.R.THIRD_PARTY_APIS),r.queryParams.eventNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.eventIds.value,n.amEventS),r.queryParams.schedulerNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.schedulersIds.value,n.schedulerS),r.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);try{const l=yield n.logProfileS.put(r._id,r,{select:d.iH._id}).toPromise();l&&l.success&&n.ns.showSuccess(n.constantsS.logProfile.editSuccess)}catch(l){n.ns.showErrorFromResponse(l.error||l,"Unable to save log profile.")}})()}getApiLogObj(t,o){const n={};for(const r of t)n[r[o]]={},r.saveResponseInLog&&(n[r[o]].saveResponseInLog=!0),m.isEmpty(n[r[o]])&&delete n[r[o]];return n}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickLogProfile(){this.selectedRows.length&&this.edit()}ERequestMethod=j.Yp;static \u0275fac=function(o){return new(o||s)(e.Y36(D.T),e.Y36(w.b),e.Y36(T.W),e.Y36(X.S),e.Y36(L.D),e.Y36(C.L),e.Y36(z.k),e.Y36(Z.E),e.Y36(ee.d),e.Y36(te.Z),e.Y36(ne.l),e.Y36(oe.d),e.Y36(se.a),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles"]],viewQuery:function(o,n){if(1&o&&e.Gf(fe,5),2&o){let r;e.iGM(r=e.CRH())&&(n.logProfilesFormC=r.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/log-profile.svg","alt","Log Profile",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/logs/log-profile.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["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","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",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"],["styleClass","p-datatable-striped log-profile-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"],[3,"data"],["logProfilesFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success","pTooltip","This log profile is active now",4,"ngIf"],["pTooltip","Save log profile settings","class","fas fa-save text-success fa-fw cursor-pointer",3,"click",4,"ngIf"],["pTooltip","This log profile is active now",1,"fas","fa-check","fa-fw","text-success"],["pTooltip","Save log profile settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Log Profiles"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ve,2,0,"span",8),e.YNc(11,Ce,2,0,"span",9),e.YNc(12,Se,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(l){return n.selectedRows=l})("selectionChange",function(){return n.logProfileSelected()})("dblclick",function(){return n.dblClickLogProfile()}),e.YNc(15,he,5,0,"ng-template",13),e.YNc(16,Ae,7,4,"ng-template",14),e.qZA(),e.YNc(17,Ie,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-logProfiles-form",16,17)),2&o&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[S.O5,_.iA,h.jx,_.Ei,y.G,ae.u,E]})}return s})();function xe(s,i){if(1&s&&(e.TgZ(0,"div",4)(1,"span",5)(2,"h4",6),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.constantsS.logTable.setupExternalLogs)}}function Ze(s,i){1&s&&(e.TgZ(0,"div",30),e._UZ(1,"app-w-instances",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function De(s,i){1&s&&(e.TgZ(0,"div",31),e._UZ(1,"app-w-databases",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const we=function(){return[50,50]};function Te(s,i){if(1&s&&(e.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10),e._UZ(4,"app-w-logProfiles"),e.qZA()(),e.TgZ(5,"div",11)(6,"div",10),e._UZ(7,"app-w-api-categories",12),e.qZA()(),e.TgZ(8,"div",13)(9,"p-splitter",14),e.YNc(10,Ze,2,3,"ng-template",15),e.YNc(11,De,2,3,"ng-template",15),e.qZA()(),e.TgZ(12,"div",16)(13,"div",10),e._UZ(14,"app-w-collections",17),e.qZA()(),e.TgZ(15,"div",18)(16,"div",10),e._UZ(17,"app-w-supported-api",19),e.qZA()(),e.TgZ(18,"div",20)(19,"div",10),e._UZ(20,"app-w-supported-tp-api",21),e.qZA()(),e.TgZ(21,"div",22)(22,"div",10),e._UZ(23,"app-custom-api-grid",23),e.qZA()(),e.TgZ(24,"div",24)(25,"div",10),e._UZ(26,"app-system-api-w",23),e.qZA()(),e.TgZ(27,"div",25)(28,"div",10),e._UZ(29,"app-events-grid",23),e.qZA()(),e.TgZ(30,"div",26)(31,"div",10),e._UZ(32,"app-scheduler-man-w",27),e.qZA()(),e.TgZ(33,"div",28)(34,"div",10),e._UZ(35,"app-web-socket-events-grid",29),e.qZA()()()()),2&s){const t=e.oxw(2);e.xp6(5),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","LOG_PROFILE"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(52,we)),e.xp6(3),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!0)("isDependentOnGroup",!0)("treeViewId","treeViewFromLogProfileLayout"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.EVENTS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SCHEDULERS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsMultiSelect",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!0)}}function Le(s,i){1&s&&e._UZ(0,"p-progressSpinner",32)}function _e(s,i){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xe,4,1,"div",1),e.YNc(2,Te,36,53,"div",2),e.YNc(3,Le,1,0,"p-progressSpinner",3),e.qZA()),2&s){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.loading)}}let P=(()=>{class s{eventCenterS;instanceS;constantsS;isExternalLogsSetupDoneByRoot;loading;EAPICategory=v.R;constructor(t,o,n){this.eventCenterS=t,this.instanceS=o,this.constantsS=n}ngOnInit(){this.getExternalRedisSetupFromPackageJson()}getExternalRedisSetupFromPackageJson(){var t=this;return(0,p.Z)(function*(){t.loading=!0;try{const o=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading=!1,t.isExternalLogsSetupDoneByRoot=!0===o.isLogsSetupDone}catch{t.isExternalLogsSetupDoneByRoot=!1}})()}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}EInstanceApiWidgetMode=R.a;static \u0275fac=function(o){return new(o||s)(e.Y36(x.u),e.Y36(Z.E),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-logProfile-layout"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","overflow-hidden","style","height: calc(100vh - 46px);",4,"ngIf"],["class","pt-1 pl-1 pr-1 overflow-auto",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],[1,"text-center"],[1,"mt-5","pt-5"],[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-profiles"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-events"],[1,"v-div","w-schedulers"],[3,"metaKeySelection","IsReadOnly","IsMultiSelect","IsDependentOnGroup","isLPM"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&e.YNc(0,_e,4,3,"div",0),2&o&&e.Q6J("ngIf",void 0!==n.isExternalLogsSetupDoneByRoot)},dependencies:[S.O5,h.jx,y.G,U.q,G.f,Y.O,J.n,Q.T,k.X,q.G,K.d,W.A,V.V,B.N,H.x,N],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-profiles[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%], .w-events[_ngcontent-%COMP%], .w-schedulers[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return s})();var Ee=a(2777),Ne=a(4186),Me=a(9208),be=a(7705),Oe=a(1678),Fe=a(4211),Re=a(1434),Ue=a(1558),Ge=a(8125);const Ye=[{path:"main",component:P,canActivate:[O.P]}];let Je=(()=>{class s{static \u0275fac=function(o){return new(o||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[M.Bz.forChild(Ye),b.u,Oe.DashboardM,Fe.DbCellM,Re.B,Ne.SystemApiM,Me.FunctionManM,Ee.u,be.L,Ue.SchedulerManM,Ge.AmEventsM,F.WebSocketEventsM]})}return s})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[148],{148:(Xe,I,a)=>{a.r(I),a.d(I,{LogProfileM:()=>Je});var M=a(7664),b=a(8176),O=a(3726),F=a(1025),p=a(5861),v=a(5085),R=a(2452),e=a(4946),x=a(2915),Z=a(3429),C=a(7414),S=a(6814),h=a(5219),y=a(7680),U=a(5043),G=a(3885),Y=a(559),J=a(6937),Q=a(356),k=a(9329),q=a(7595),K=a(3824),W=a(8651),V=a(6607),B=a(5305),H=a(2726),c=a(3157),g=a(328),f=a(6212),m=a(6990),d=a(1162),j=a(6925),D=a(7031),w=a(7240),T=a(9961),X=a(2189),L=a(5852),z=a(3065),ee=a(7629),te=a(1042),ne=a(7145),oe=a(2559),se=a(262),_=a(5431),ae=a(3259),u=a(95),re=a(2660),ie=a(8057);function le(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add Log Profile"),e.qZA())}function pe(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View Log Profile"),e.qZA())}function de(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit Log Profile"),e.qZA())}function ce(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save Log Profile"),e.qZA())}function ge(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update Log Profile"),e.qZA())}function ue(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",27),e.YNc(2,ce,2,0,"span",4),e.YNc(3,ge,2,0,"span",4),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function me(s,i){1&s&&e._UZ(0,"p-progressSpinner",28)}let E=(()=>{class s{fb;ns;logProfileS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=g.D;form;subscriptions=[];constructor(t,o,n,r,l,A){this.fb=t,this.ns=o,this.logProfileS=n,this.generalS=r,this.authCS=l,this.constantsS=A}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var o=(0,p.Z)(function*(n){if(n)if(t.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data)}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else n.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.setDefaultValuesInForm())});return function(n){return o.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],isDefault:[!0,[]]})}setDefaultValuesInForm(){this.form.patchValue({isDefault:!0})}showModal(){$("#idLogProfileForm").modal("show")}hideModal(){$("#idLogProfileForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const o=t.form.getRawValue();o.user=t.authCS.getUserId();try{let n;t.loading.form=!0,t.data.mode===g.D.ADD?n=yield t.logProfileS.post(o).toPromise():t.data.mode===g.D.EDIT&&(n=yield t.logProfileS.put(t.data.formData._id,o,{select:d.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===g.D.ADD?t.constantsS.logProfile.addSuccess:t.constantsS.logProfile.editSuccess),t.data.eventChannel.emit({action:t.data.mode===g.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(n){t.loading.form=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to save log profile.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||s)(e.Y36(u.qu),e.Y36(T.W),e.Y36(D.T),e.Y36(w.b),e.Y36(L.D),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles-form"]],inputs:{data:"data"},decls:31,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idLogProfileForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4"],[1,"align-middle","mb-0","pt-1"],["formControlName","isDefault","inputId","idIsActive",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,le,3,0,"span",4),e.YNc(5,pe,3,0,"span",4),e.YNc(6,de,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),e._uU(16,"Name"),e.qZA(),e.TgZ(17,"div",11),e._UZ(18,"input",14),e.qZA()()(),e.TgZ(19,"div",15)(20,"div",12)(21,"label",13),e._uU(22,"Active"),e.qZA(),e.TgZ(23,"label",16),e._UZ(24,"p-checkbox",17),e.qZA()()()()()(),e.TgZ(25,"div",18)(26,"button",19),e._UZ(27,"i",20),e._uU(28," Close"),e.qZA(),e.YNc(29,ue,4,3,"button",21),e.qZA(),e.YNc(30,me,1,0,"p-progressSpinner",22),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(13),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.O5,re.y,y.G,ie.XZ],encapsulation:2})}return s})();const fe=["logProfilesFormC"];function ve(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function Ce(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function Se(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function he(s,i){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24)(4,"th",24),e.qZA())}function ye(s,i){1&s&&e._UZ(0,"i",28)}function Pe(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"i",29),e.NdJ("click",function(n){e.CHM(t);const r=e.oxw().$implicit,l=e.oxw();return e.KtG(l.saveLogProfilePermissions(n,r))}),e.qZA()}}function Ae(s,i){if(1&s&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ye,1,0,"i",26),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Pe,1,0,"i",27),e.qZA()()),2&s){const t=i.$implicit,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",(null==o.selectedRows||null==o.selectedRows[0]?null:o.selectedRows[0]._id)===t._id)}}function Ie(s,i){1&s&&e._UZ(0,"p-progressSpinner",30)}let N=(()=>{class s{logProfileS;generalS;ns;navigationCS;authCS;constantsS;apiS;instanceS;functionS;schedulerS;amEventS;tpInstalledApisS;webSocketEventsS;confirmationService;eventCenterS;logProfilesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=d.iH._id;constructor(t,o,n,r,l,A,Qe,ke,qe,Ke,We,Ve,Be,He,je){this.logProfileS=t,this.generalS=o,this.ns=n,this.navigationCS=r,this.authCS=l,this.constantsS=A,this.apiS=Qe,this.instanceS=ke,this.functionS=qe,this.schedulerS=Ke,this.amEventS=We,this.tpInstalledApisS=Ve,this.webSocketEventsS=Be,this.confirmationService=He,this.eventCenterS=je}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.logProfilesFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Log Profile")}loadGridData(){var t=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.logProfileS.query(o).subscribe(function(){var n=(0,p.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=m.keyBy(t.rows,d.iH._id));let l=t.navigationCS.getQueryParam(f.p.log_profile);l?!t.rowsMap[l]&&t.rows.length&&(l=t.rows[0]._id):t.rows.length&&(l=t.rows[0]._id),t.rowsMap[l]&&(t.selectedRows=[t.rowsMap[l]],yield t.fillData()),t.generalS.setNewTitle("API Maker - Log Profile"),t.loading.grid=!1});return function(r){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.logProfilesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.logProfilesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.logProfilesFormC.showModal()}clone(){var t=this;return(0,p.Z)(function*(){try{if(!t.selectedRows[0])return;const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;delete o._id,delete o.queryParamsMap,o.isDefault=!1,o.name=`${o.name}-clone`,(yield t.logProfileS.post(o).toPromise()).success?(t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess),t.loadGridData()):t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess)}catch{t.ns.showError(t.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.logProfile.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const o=yield t.logProfileS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,o.success?(t.ns.showSuccess(t.constantsS.logProfile.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.ns.showErrorFromResponse(o,t.constantsS.logProfile.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([f.p.log_profile,f.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.selectedSystemApis.next([]),t.eventCenterS.group.selectedFunctions.next([]),t.eventCenterS.group.selectedThirdPartyAPIs.next([]),t.eventCenterS.group.selectedSupportedAPIs.next([]),t.eventCenterS.group.selectedEvents.next([]),t.eventCenterS.group.selectedSchedulers.next([]),t.eventCenterS.group.selectedWebSocket.next([]),t.eventCenterS.group.apisRegex={}})()}logProfileSelected(){var t=this;return(0,p.Z)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return void t.resetDependents();const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;o&&o.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(o.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(o.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(o.queryParams.supportedApiNames||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(o.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.thirdPartyApiNames,t.tpInstalledApisS,v.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.eventIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.eventNames,t.amEventS))||[]),t.eventCenterS.group.schedulersIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.schedulerNames,t.schedulerS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(o.queryParams.webSocketEventNames))),o&&(t.eventCenterS.group.selectedGroups.next([o]),t.eventCenterS.group.apisRegex=o.apisRegex,yield t.navigationCS.setQueryParam(f.p.log_profile,t.selectedRows[0]._id)),o?.queryParams||(yield t.resetDependents())})()}saveLogProfilePermissions(t,o){var n=this;return(0,p.Z)(function*(){t.stopImmediatePropagation();const r=JSON.parse(JSON.stringify(o));r.supportedApiLog=n.getApiLogObj(n.eventCenterS.group.selectedSupportedAPIs.value,d.qD._id),r.functionsLog=n.getApiLogObj(n.eventCenterS.group.selectedFunctions.value,d.qD.name),r.systemApisLog=n.getApiLogObj(n.eventCenterS.group.selectedSystemApis.value,d.qD._id),r.thirdPartyApisLog=n.getApiLogObj(n.eventCenterS.group.selectedThirdPartyAPIs.value,d.qD.nameId),r.eventLog=n.getApiLogObj(n.eventCenterS.group.selectedEvents.value,d.qD.name),r.schedulersLog=n.getApiLogObj(n.eventCenterS.group.selectedSchedulers.value,d.qD.name),r.webSocketEventsLog=n.getApiLogObj(n.eventCenterS.group.selectedWebSocket.value,d.qD.id),r.apisRegex=n.eventCenterS.group.apisRegex,r.queryParams={},r.user=n.authCS.getUserId(),r.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),r.queryParams.databaseNames=m.uniq(n.eventCenterS.group.databaseNames.value),r.queryParams.collectionNames=m.uniq(n.eventCenterS.group.collectionNames.value),r.queryParams.supportedApiNames=m.uniq(n.eventCenterS.group.supportedApiIds.value),r.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),r.queryParams.systemApiNames=m.uniq(n.eventCenterS.group.systemApiIds.value),r.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,v.R.THIRD_PARTY_APIS),r.queryParams.eventNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.eventIds.value,n.amEventS),r.queryParams.schedulerNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.schedulersIds.value,n.schedulerS),r.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);try{const l=yield n.logProfileS.put(r._id,r,{select:d.iH._id}).toPromise();l&&l.success&&n.ns.showSuccess(n.constantsS.logProfile.editSuccess)}catch(l){n.ns.showErrorFromResponse(l.error||l,"Unable to save log profile.")}})()}getApiLogObj(t,o){const n={};for(const r of t)n[r[o]]={},r.saveResponseInLog&&(n[r[o]].saveResponseInLog=!0),m.isEmpty(n[r[o]])&&delete n[r[o]];return n}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickLogProfile(){this.selectedRows.length&&this.edit()}ERequestMethod=j.Yp;static \u0275fac=function(o){return new(o||s)(e.Y36(D.T),e.Y36(w.b),e.Y36(T.W),e.Y36(X.S),e.Y36(L.D),e.Y36(C.L),e.Y36(z.k),e.Y36(Z.E),e.Y36(ee.d),e.Y36(te.Z),e.Y36(ne.l),e.Y36(oe.d),e.Y36(se.a),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles"]],viewQuery:function(o,n){if(1&o&&e.Gf(fe,5),2&o){let r;e.iGM(r=e.CRH())&&(n.logProfilesFormC=r.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/log-profile.svg","alt","Log Profile",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/logs/log-profile.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["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","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",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"],["styleClass","p-datatable-striped log-profile-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"],[3,"data"],["logProfilesFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success","pTooltip","This log profile is active now",4,"ngIf"],["pTooltip","Save log profile settings","class","fas fa-save text-success fa-fw cursor-pointer",3,"click",4,"ngIf"],["pTooltip","This log profile is active now",1,"fas","fa-check","fa-fw","text-success"],["pTooltip","Save log profile settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Log Profiles"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ve,2,0,"span",8),e.YNc(11,Ce,2,0,"span",9),e.YNc(12,Se,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(l){return n.selectedRows=l})("selectionChange",function(){return n.logProfileSelected()})("dblclick",function(){return n.dblClickLogProfile()}),e.YNc(15,he,5,0,"ng-template",13),e.YNc(16,Ae,7,4,"ng-template",14),e.qZA(),e.YNc(17,Ie,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-logProfiles-form",16,17)),2&o&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[S.O5,_.iA,h.jx,_.Ei,y.G,ae.u,E]})}return s})();function xe(s,i){if(1&s&&(e.TgZ(0,"div",4)(1,"span",5)(2,"h4",6),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.constantsS.logTable.setupExternalLogs)}}function Ze(s,i){1&s&&(e.TgZ(0,"div",30),e._UZ(1,"app-w-instances",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function De(s,i){1&s&&(e.TgZ(0,"div",31),e._UZ(1,"app-w-databases",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const we=function(){return[50,50]};function Te(s,i){if(1&s&&(e.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10),e._UZ(4,"app-w-logProfiles"),e.qZA()(),e.TgZ(5,"div",11)(6,"div",10),e._UZ(7,"app-w-api-categories",12),e.qZA()(),e.TgZ(8,"div",13)(9,"p-splitter",14),e.YNc(10,Ze,2,3,"ng-template",15),e.YNc(11,De,2,3,"ng-template",15),e.qZA()(),e.TgZ(12,"div",16)(13,"div",10),e._UZ(14,"app-w-collections",17),e.qZA()(),e.TgZ(15,"div",18)(16,"div",10),e._UZ(17,"app-w-supported-api",19),e.qZA()(),e.TgZ(18,"div",20)(19,"div",10),e._UZ(20,"app-w-supported-tp-api",21),e.qZA()(),e.TgZ(21,"div",22)(22,"div",10),e._UZ(23,"app-custom-api-grid",23),e.qZA()(),e.TgZ(24,"div",24)(25,"div",10),e._UZ(26,"app-system-api-w",23),e.qZA()(),e.TgZ(27,"div",25)(28,"div",10),e._UZ(29,"app-events-grid",23),e.qZA()(),e.TgZ(30,"div",26)(31,"div",10),e._UZ(32,"app-scheduler-man-w",27),e.qZA()(),e.TgZ(33,"div",28)(34,"div",10),e._UZ(35,"app-web-socket-events-grid",29),e.qZA()()()()),2&s){const t=e.oxw(2);e.xp6(5),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","LOG_PROFILE"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(52,we)),e.xp6(3),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!0)("isDependentOnGroup",!0)("treeViewId","treeViewFromLogProfileLayout"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.EVENTS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SCHEDULERS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsMultiSelect",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!0)}}function Le(s,i){1&s&&e._UZ(0,"p-progressSpinner",32)}function _e(s,i){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xe,4,1,"div",1),e.YNc(2,Te,36,53,"div",2),e.YNc(3,Le,1,0,"p-progressSpinner",3),e.qZA()),2&s){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.loading)}}let P=(()=>{class s{eventCenterS;instanceS;constantsS;isExternalLogsSetupDoneByRoot;loading;EAPICategory=v.R;constructor(t,o,n){this.eventCenterS=t,this.instanceS=o,this.constantsS=n}ngOnInit(){this.getExternalRedisSetupFromPackageJson()}getExternalRedisSetupFromPackageJson(){var t=this;return(0,p.Z)(function*(){t.loading=!0;try{const o=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading=!1,t.isExternalLogsSetupDoneByRoot=!0===o.isLogsSetupDone}catch{t.isExternalLogsSetupDoneByRoot=!1}})()}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}EInstanceApiWidgetMode=R.a;static \u0275fac=function(o){return new(o||s)(e.Y36(x.u),e.Y36(Z.E),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-logProfile-layout"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","overflow-hidden","style","height: calc(100vh - 46px);",4,"ngIf"],["class","pt-1 pl-1 pr-1 overflow-auto",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],[1,"text-center"],[1,"mt-5","pt-5"],[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-profiles"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-events"],[1,"v-div","w-schedulers"],[3,"metaKeySelection","IsReadOnly","IsMultiSelect","IsDependentOnGroup","isLPM"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&e.YNc(0,_e,4,3,"div",0),2&o&&e.Q6J("ngIf",void 0!==n.isExternalLogsSetupDoneByRoot)},dependencies:[S.O5,h.jx,y.G,U.q,G.f,Y.O,J.n,Q.T,k.X,q.G,K.d,W.A,V.V,B.N,H.x,N],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-profiles[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%], .w-events[_ngcontent-%COMP%], .w-schedulers[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return s})();var Ee=a(2777),Ne=a(4186),Me=a(5765),be=a(7705),Oe=a(1678),Fe=a(4211),Re=a(1434),Ue=a(1558),Ge=a(8125);const Ye=[{path:"main",component:P,canActivate:[O.P]}];let Je=(()=>{class s{static \u0275fac=function(o){return new(o||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[M.Bz.forChild(Ye),b.u,Oe.DashboardM,Fe.DbCellM,Re.B,Ne.SystemApiM,Me.FunctionManM,Ee.u,be.L,Ue.SchedulerManM,Ge.AmEventsM,F.WebSocketEventsM]})}return s})()}}]);
|
package/dist/1558.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1558],{1558:(A,M,i)=>{i.r(M),i.d(M,{SchedulerManM:()=>T});var c=i(7664),e=i(8176),o=i(4946),h=i(6607);let m=(()=>{class _{constructor(){}ngOnInit(){}static \u0275fac=function(p){return new(p||_)};static \u0275cmp=o.Xpm({type:_,selectors:[["app-scheduler-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(p,P){1&p&&(o.TgZ(0,"div",0),o._UZ(1,"app-scheduler-man-w"),o.qZA())},dependencies:[h.V],encapsulation:2})}return _})();var d=i(3726),D=i(885);const g=[{path:"scheduler-layout",component:m,canActivate:[d.P]}];let T=(()=>{class _{static \u0275fac=function(p){return new(p||_)};static \u0275mod=o.oAB({type:_});static \u0275inj=o.cJS({imports:[c.Bz.forChild(g),e.u,D.R]})}return _})()},6607:(A,M,i)=>{i.d(M,{V:()=>ce});var c=i(5861),e=i(4946),o=i(3157),h=i(328),m=i(6212),d=i(6990),g=i(1162),I=i(5085),T=i(921),_=i(1042),O=i(7240),S=i(9961),p=i(5219),P=i(2189),y=i(5852),Z=i(7414),L=i(2915),w=i(7664),R=i(95),W=i(6814),C=i(5431),U=i(7680),N=i(3259),K=i(8057),b=i(8479);const G=["schedulerManFormC"];function F(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.edit())}),e._UZ(1,"i",18),e.qZA()}}function J(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.clone())}),e._UZ(1,"i",20),e.qZA()}}function B(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function Q(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,J,2,0,"span",15),e.YNc(5,B,2,0,"span",16),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length)}}function Y(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.group.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allSchedulers)("binary",!0)}}function k(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.filterInLog.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allSchedulers)("binary",!0)}}function H(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allSchedulersPermitted)}}function j(n,r){1&n&&(e.TgZ(0,"th",34),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function V(n,r){1&n&&e._UZ(0,"th")}function $(n,r){1&n&&e._UZ(0,"th",36)}function q(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,j,2,0,"th",32),e._UZ(2,"th",33)(3,"th",34),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.YNc(6,V,1,0,"th",6),e.YNc(7,$,1,0,"th",35),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.isMultiSelect),e.xp6(5),e.Q6J("ngIf",t.isLPM),e.xp6(1),e.Q6J("ngIf",!t.isMultiSelect)}}function X(n,r){if(1&n&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",41),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function z(n,r){1&n&&e._UZ(0,"i",42)}function ee(n,r){1&n&&e._UZ(0,"i",43)}function te(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label",44)(2,"p-checkbox",45),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw(2).$implicit;return e.KtG(l.saveResponseInLog=a)})("click",function(a){e.CHM(t);const l=e.oxw(4);return e.KtG(l.generalS.stopPropagation(a))}),e.qZA()()()}if(2&n){const t=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",t.saveResponseInLog)("binary",!0)}}function ne(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,te,3,2,"div",6),e.qZA()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(1),e.Q6J("ngIf",s.selectedRows.indexOf(t)>=0)}}const se=function(){return["/api-info/api-testing/testing"]},ae=function(n,r){return{at_category:"SCHEDULERS",at_user:n,at_api:r}};function ie(n,r){if(1&n&&(e.TgZ(0,"td")(1,"div",38)(2,"a",46),e.NdJ("click",function(s){return s.stopPropagation()}),e._UZ(3,"i",47),e.qZA()()()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(2,se))("queryParams",e.WLB(3,ae,s.authCS.getUserId(),t._id))}}function re(n,r){if(1&n&&(e.TgZ(0,"tr",37),e.YNc(1,X,2,2,"td",6),e.TgZ(2,"td",38)(3,"span"),e._uU(4),e.qZA()(),e.TgZ(5,"td"),e.YNc(6,z,1,0,"i",39),e.YNc(7,ee,1,0,"i",40),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.YNc(10,ne,2,1,"td",6),e.YNc(11,ie,4,6,"td",6),e.qZA()),2&n){const t=r.$implicit,s=r.rowIndex,a=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.isMultiSelect),e.xp6(3),e.Oqu(s+1),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",!t.isActive),e.xp6(2),e.Oqu(t.name),e.xp6(1),e.Q6J("ngIf",a.isLPM),e.xp6(1),e.Q6J("ngIf",!a.isMultiSelect)}}function le(n,r){1&n&&e._UZ(0,"p-progressSpinner",48)}function oe(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.selectedRows=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.selectionChange())})("dblclick",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.dblClickSchedulerList())}),e.YNc(2,q,8,3,"ng-template",29),e.YNc(3,re,12,8,"ng-template",30),e.qZA(),e.YNc(4,le,1,0,"p-progressSpinner",31),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let ce=(()=>{class n{schedulerS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;isMultiSelect=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:h.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=g.iH._id;EUserType=T.dN;schedulerManFormC;constructor(t,s,a,l,x,f,u,v,E,_e){this.schedulerS=t,this.generalS=s,this.notificationS=a,this.confirmationService=l,this.navigationCS=x,this.authCS=f,this.constantsS=u,this.eventCenterS=v,this.cd=E,this.router=_e}ngOnInit(){var t=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{s.action===o.F.SAVED?(this.schedulerManFormC.hideModal(),this.loadGridData()):s.action===o.F.UPDATED&&(s.closeModal&&this.schedulerManFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,c.Z)(function*(a){a.length&&t.loadGridData()});return function(a){return s.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - Scheduler")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,isActive:1,active:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.schedulerS.query(s).subscribe(function(){var a=(0,c.Z)(function*(l){l.success?(t.selectedRows=[],t.rows=l.data||[],t.rowsMap=d.keyBy(t.rows,g.iH._id),t.rowsMapName=d.keyBy(t.rows,g.qH.name)):t.resetGridAndUrl();const x=t.navigationCS.getQueryParam(m.p.am_scheduler)||(t.isFilterLogTable?t.eventCenterS.filterInLog.schedulersIds.value.join(","):t.eventCenterS.group.schedulersIds.value.join(","))||(t.isDependentOnGroup&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?t.eventCenterS.group.selectedGroups.value[0]?.queryParams.schedulerNames.join(","):"");if(x){const f=x.split(","),u=d.intersection(d.keys(t.rowsMap),f),v=[];for(const E of u)t.rowsMap[E]&&v.push(t.rowsMap[E]);t.selectedRows=v,t.eventCenterS.group.selectedSchedulers.next(v),t.eventCenterS.group.schedulersIds.next(u),t.eventCenterS.filterInLog.schedulersIds.next(u)}if(t.isLPM&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?.length){const f=t.eventCenterS.group.selectedGroups.value[0];for(const u of f?.queryParams?.schedulerNames)t.rowsMapName[u]&&(t.rowsMapName[u].saveResponseInLog=f.schedulersLog?.[u]?.saveResponseInLog||!1);t.setResDataInEventCenter()}t.loading.grid=!1,t.cd.detectChanges()});return function(l){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=h.D.ADD,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_ADD_MODE}),this.schedulerManFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.VIEW,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_VIEW_MODE}),this.schedulerManFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.EDIT,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_EDIT_MODE}),this.schedulerManFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.selectedRows[0])return;const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,s.name=`${s.name}-clone`,(yield t.schedulerS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.schedulers.cloneError)}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.schedulersApis.next(this.selectedRows),this.eventCenterS.group.selectedSchedulers.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.schedulersApis.next(this.selectedRows)}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.schedulers.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const s=yield t.schedulerS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.schedulers.removePermanent),t.resetGridAndUrl(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.schedulers.removePermanentError)})()}resetDependents(){var t=this;return(0,c.Z)(function*(){yield t.navigationCS.setQueryParam(m.p.am_scheduler,null)})()}selectionChange(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then(),t.selectedRows?.[0]?t.generalS.setNewTitle(t.selectedRows[0].name,I.R.SCHEDULERS):t.generalS.setNewTitle("API Maker - Scheduler")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(m.p.am_scheduler,""),t.eventCenterS.group.schedulersIds.next([]),t.eventCenterS.group.schedulersApis.next([]),t.eventCenterS.filterInLog.schedulersIds.next([]),void t.eventCenterS.filterInLog.schedulersApis.next([]);if(t.isDependentOnGroup||t.isFilterLogTable)t.eventCenterS.group.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.group.schedulersApis.next(t.selectedRows),t.isFilterLogTable&&(t.eventCenterS.filterInLog.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.filterInLog.schedulersApis.next(t.selectedRows));else{const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?yield t.navigationCS.setQueryParam(m.p.am_scheduler,s._id):t.resetDependents()}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickSchedulerList(){this.selectedRows.length&&!this.isMultiSelect&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(_.Z),e.Y36(O.b),e.Y36(S.W),e.Y36(p.YP),e.Y36(P.S),e.Y36(y.D),e.Y36(Z.L),e.Y36(L.u),e.Y36(e.sBO),e.Y36(w.F0))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-scheduler-man-w"]],viewQuery:function(s,a){if(1&s&&e.Gf(G,5),2&s){let l;e.iGM(l=e.CRH())&&(a.schedulerManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],isMultiSelect:["IsMultiSelect","isMultiSelect"],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/schedulers.svg","alt","Schedulers",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Schedulers",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["schedulerManFormC",""],["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","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","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 Schedulers",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped schedulers-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: 40px;",4,"ngIf"],[2,"width","80px"],[2,"width","40px"],["style","width: 60px;",4,"ngIf"],[2,"width","60px"],[3,"pSelectableRow"],[1,"text-center"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[3,"value","pSelectableRow"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:","tooltipPosition","left","pTooltip","Test API",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Scheduler List"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,Q,6,3,"span",6),e.YNc(9,Y,3,2,"span",7),e.YNc(10,k,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,H,3,1,"div",6),e.YNc(13,oe,5,7,"div",9),e.qZA()(),e._UZ(14,"app-w-scheduler-man-form",10,11)),2&s&&(e.xp6(8),e.Q6J("ngIf",!a.isReadOnly),e.xp6(1),e.Q6J("ngIf",a.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",a.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers),e.xp6(1),e.Q6J("ngIf",!(a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers)),e.xp6(1),e.Q6J("data",a.data))},dependencies:[w.rH,R.JJ,R.On,W.O5,C.iA,p.jx,C.Ei,C.UA,C.Mo,U.G,N.u,K.XZ,b.o],encapsulation:2})}return n})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1558],{1558:(R,M,i)=>{i.r(M),i.d(M,{SchedulerManM:()=>E});var c=i(7664),e=i(8176),o=i(4946),h=i(6607);let f=(()=>{class _{constructor(){}ngOnInit(){}static \u0275fac=function(u){return new(u||_)};static \u0275cmp=o.Xpm({type:_,selectors:[["app-scheduler-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(u,P){1&u&&(o.TgZ(0,"div",0),o._UZ(1,"app-scheduler-man-w"),o.qZA())},dependencies:[h.V],encapsulation:2})}return _})();var d=i(3726),D=i(885);const g=[{path:"scheduler-layout",component:f,canActivate:[d.P]}];let E=(()=>{class _{static \u0275fac=function(u){return new(u||_)};static \u0275mod=o.oAB({type:_});static \u0275inj=o.cJS({imports:[c.Bz.forChild(g),e.u,D.R]})}return _})()},6607:(R,M,i)=>{i.d(M,{V:()=>de});var c=i(5861),e=i(4946),o=i(3157),h=i(328),f=i(6212),d=i(6990),g=i(1162),I=i(5085),E=i(921),_=i(1042),A=i(7240),S=i(9961),u=i(5219),P=i(2189),y=i(5852),Z=i(7414),L=i(2915),w=i(7664),O=i(95),W=i(6814),C=i(5431),U=i(7680),N=i(3259),b=i(8057),K=i(8479);const G=["schedulerManFormC"];function F(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.edit())}),e._UZ(1,"i",18),e.qZA()}}function J(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.clone())}),e._UZ(1,"i",20),e.qZA()}}function Q(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function B(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,J,2,0,"span",15),e.YNc(5,Q,2,0,"span",16),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length)}}function Y(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.group.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allSchedulers)("binary",!0)}}function k(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.filterInLog.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allSchedulers)("binary",!0)}}function H(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allSchedulersPermitted)}}function j(n,r){1&n&&(e.TgZ(0,"th",34),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function V(n,r){1&n&&e._UZ(0,"th",36)}function $(n,r){1&n&&e._UZ(0,"th")}function q(n,r){1&n&&e._UZ(0,"th",37)}function X(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,j,2,0,"th",32),e.YNc(2,V,1,0,"th",33),e._UZ(3,"th",34),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.YNc(6,$,1,0,"th",6),e.YNc(7,q,1,0,"th",35),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable),e.xp6(4),e.Q6J("ngIf",t.isLPM),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable)}}function z(n,r){if(1&n&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",42),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ee(n,r){if(1&n&&(e.TgZ(0,"td",43)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw().rowIndex;e.xp6(2),e.Oqu(t+1)}}function te(n,r){1&n&&e._UZ(0,"i",44)}function ne(n,r){1&n&&e._UZ(0,"i",45)}function se(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label",46)(2,"p-checkbox",47),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw(2).$implicit;return e.KtG(l.saveResponseInLog=a)})("click",function(a){e.CHM(t);const l=e.oxw(4);return e.KtG(l.generalS.stopPropagation(a))}),e.qZA()()()}if(2&n){const t=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",t.saveResponseInLog)("binary",!0)}}function ae(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,se,3,2,"div",6),e.qZA()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(1),e.Q6J("ngIf",s.selectedRows.indexOf(t)>=0)}}const ie=function(){return["/api-info/api-testing/testing"]},re=function(n,r){return{at_category:"SCHEDULERS",at_user:n,at_api:r}};function le(n,r){if(1&n&&(e.TgZ(0,"td")(1,"div",43)(2,"a",48),e.NdJ("click",function(s){return s.stopPropagation()}),e._UZ(3,"i",49),e.qZA()()()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(2,ie))("queryParams",e.WLB(3,re,s.authCS.getUserId(),t._id))}}function oe(n,r){if(1&n&&(e.TgZ(0,"tr",38),e.YNc(1,z,2,2,"td",6),e.YNc(2,ee,3,1,"td",39),e.TgZ(3,"td"),e.YNc(4,te,1,0,"i",40),e.YNc(5,ne,1,0,"i",41),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.YNc(8,ae,2,1,"td",6),e.YNc(9,le,4,6,"td",6),e.qZA()),2&n){const t=r.$implicit,s=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",s.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",!t.isActive),e.xp6(2),e.Oqu(t.name),e.xp6(1),e.Q6J("ngIf",s.isLPM),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable)}}function ce(n,r){1&n&&e._UZ(0,"p-progressSpinner",50)}function _e(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.selectedRows=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.selectionChange())})("dblclick",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.dblClickSchedulerList())}),e.YNc(2,X,8,4,"ng-template",29),e.YNc(3,oe,10,8,"ng-template",30),e.qZA(),e.YNc(4,ce,1,0,"p-progressSpinner",31),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let de=(()=>{class n{schedulerS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;isMultiSelect=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:h.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=g.iH._id;EUserType=E.dN;schedulerManFormC;constructor(t,s,a,l,x,m,p,v,T,pe){this.schedulerS=t,this.generalS=s,this.notificationS=a,this.confirmationService=l,this.navigationCS=x,this.authCS=m,this.constantsS=p,this.eventCenterS=v,this.cd=T,this.router=pe}ngOnInit(){var t=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{s.action===o.F.SAVED?(this.schedulerManFormC.hideModal(),this.loadGridData()):s.action===o.F.UPDATED&&(s.closeModal&&this.schedulerManFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,c.Z)(function*(a){a.length&&t.loadGridData()});return function(a){return s.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - Scheduler")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,isActive:1,active:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.schedulerS.query(s).subscribe(function(){var a=(0,c.Z)(function*(l){l.success?(t.selectedRows=[],t.rows=l.data||[],t.rowsMap=d.keyBy(t.rows,g.iH._id),t.rowsMapName=d.keyBy(t.rows,g.qH.name)):t.resetGridAndUrl();const x=t.navigationCS.getQueryParam(f.p.am_scheduler)||(t.isFilterLogTable?t.eventCenterS.filterInLog.schedulersIds.value.join(","):t.eventCenterS.group.schedulersIds.value.join(","))||(t.isDependentOnGroup&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?t.eventCenterS.group.selectedGroups.value[0]?.queryParams.schedulerNames.join(","):"");if(x){const m=x.split(","),p=d.intersection(d.keys(t.rowsMap),m),v=[];for(const T of p)t.rowsMap[T]&&v.push(t.rowsMap[T]);t.selectedRows=v,t.eventCenterS.group.selectedSchedulers.next(v),t.eventCenterS.group.schedulersIds.next(p),t.eventCenterS.filterInLog.schedulersIds.next(p)}if(t.isLPM&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?.length){const m=t.eventCenterS.group.selectedGroups.value[0];for(const p of m?.queryParams?.schedulerNames)t.rowsMapName[p]&&(t.rowsMapName[p].saveResponseInLog=m.schedulersLog?.[p]?.saveResponseInLog||!1);t.setResDataInEventCenter()}t.loading.grid=!1,t.cd.detectChanges()});return function(l){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=h.D.ADD,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_ADD_MODE}),this.schedulerManFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.VIEW,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_VIEW_MODE}),this.schedulerManFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.EDIT,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_EDIT_MODE}),this.schedulerManFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.selectedRows[0])return;const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,s.name=`${s.name}-clone`,(yield t.schedulerS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.schedulers.cloneError)}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.schedulersApis.next(this.selectedRows),this.eventCenterS.group.selectedSchedulers.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.schedulersApis.next(this.selectedRows)}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.schedulers.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const s=yield t.schedulerS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.schedulers.removePermanent),t.resetGridAndUrl(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.schedulers.removePermanentError)})()}resetDependents(){var t=this;return(0,c.Z)(function*(){yield t.navigationCS.setQueryParam(f.p.am_scheduler,null)})()}selectionChange(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then(),t.selectedRows?.[0]?t.generalS.setNewTitle(t.selectedRows[0].name,I.R.SCHEDULERS):t.generalS.setNewTitle("API Maker - Scheduler")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.am_scheduler,""),t.eventCenterS.group.schedulersIds.next([]),t.eventCenterS.group.schedulersApis.next([]),t.eventCenterS.filterInLog.schedulersIds.next([]),void t.eventCenterS.filterInLog.schedulersApis.next([]);if(t.isDependentOnGroup||t.isFilterLogTable)t.eventCenterS.group.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.group.schedulersApis.next(t.selectedRows),t.isFilterLogTable&&(t.eventCenterS.filterInLog.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.filterInLog.schedulersApis.next(t.selectedRows));else{const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?yield t.navigationCS.setQueryParam(f.p.am_scheduler,s._id):t.resetDependents()}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickSchedulerList(){this.selectedRows.length&&!this.isMultiSelect&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(_.Z),e.Y36(A.b),e.Y36(S.W),e.Y36(u.YP),e.Y36(P.S),e.Y36(y.D),e.Y36(Z.L),e.Y36(L.u),e.Y36(e.sBO),e.Y36(w.F0))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-scheduler-man-w"]],viewQuery:function(s,a){if(1&s&&e.Gf(G,5),2&s){let l;e.iGM(l=e.CRH())&&(a.schedulerManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],isMultiSelect:["IsMultiSelect","isMultiSelect"],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/schedulers.svg","alt","Schedulers",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Schedulers",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["schedulerManFormC",""],["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","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","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 Schedulers",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped schedulers-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: 40px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","40px"],["style","width: 60px;",4,"ngIf"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:","tooltipPosition","left","pTooltip","Test API",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Scheduler List"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,B,6,3,"span",6),e.YNc(9,Y,3,2,"span",7),e.YNc(10,k,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,H,3,1,"div",6),e.YNc(13,_e,5,7,"div",9),e.qZA()(),e._UZ(14,"app-w-scheduler-man-form",10,11)),2&s&&(e.xp6(8),e.Q6J("ngIf",!a.isReadOnly),e.xp6(1),e.Q6J("ngIf",a.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",a.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers),e.xp6(1),e.Q6J("ngIf",!(a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers)),e.xp6(1),e.Q6J("data",a.data))},dependencies:[w.rH,O.JJ,O.On,W.O5,C.iA,u.jx,C.Ei,C.UA,C.Mo,U.G,N.u,b.XZ,K.o],encapsulation:2})}return n})()}}]);
|