dinocollab-core 2.1.30 → 2.1.31
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createClass as
|
|
1
|
+
import{createClass as n,classCallCheck as e,defineProperty as r,asyncToGenerator as t,regenerator as i}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{authService as a}from"partner-oidc-auth";import{EAppName as s}from"./types.js";var o;!function(n){n.Admin="Admin",n.User="User",n.Manage="Manage"}(o||(o={}));var l=new(n(function n(){var l=this;e(this,n),r(this,"getAppName",function(){var n,e;return null!==(n=null===(e=l.window)||void 0===e||null===(e=e.env)||void 0===e?void 0:e.REACT_APP_NAME)&&void 0!==n?n:s.ClientApp}),r(this,"isAdmin",function(n){return(null!=n?n:[]).some(function(n){return n===o.Admin})&&l.getAppName()===s.ClientAdmin}),r(this,"getGraphqlSite",t(i().m(function n(){var e,r,t;return i().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,a.getRoles();case 1:e=n.v,r=l.getAppName(),t=r,n.n=t===s.ClientAdmin?2:(s.ClientApp,3);break;case 2:return n.a(2,l.isAdmin(e)?o.Admin:o.Manage);case 3:return n.a(2,o.User);case 4:return n.a(2)}},n)}))),this.window=global.window}));export{l as AppProfile};
|
|
2
2
|
//# sourceMappingURL=app-profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-profile.js","sources":["../../../../src/http-service/graphql/app-profile.ts"],"sourcesContent":["import { authService } from 'partner-oidc-auth'\r\nimport { EAppName } from './types'\r\n\r\nenum RoleKeyInternalSite {\r\n Admin = 'Admin',\r\n User = 'User',\r\n Manage = 'Manage'\r\n}\r\n\r\nclass AppProfileBase {\r\n window: Window & { [key: string]: any }\r\n constructor() {\r\n this.window = global.window\r\n }\r\n\r\n getAppName = () => this.window
|
|
1
|
+
{"version":3,"file":"app-profile.js","sources":["../../../../src/http-service/graphql/app-profile.ts"],"sourcesContent":["import { authService } from 'partner-oidc-auth'\r\nimport { EAppName } from './types'\r\n\r\nenum RoleKeyInternalSite {\r\n Admin = 'Admin',\r\n User = 'User',\r\n Manage = 'Manage'\r\n}\r\n\r\nclass AppProfileBase {\r\n window: Window & { [key: string]: any }\r\n constructor() {\r\n this.window = global.window\r\n }\r\n\r\n getAppName = () => (this.window?.env?.REACT_APP_NAME as EAppName) ?? EAppName.ClientApp\r\n\r\n isAdmin = (roles?: string[]) => {\r\n return (roles ?? []).some((e) => e === RoleKeyInternalSite.Admin) && this.getAppName() === EAppName.ClientAdmin\r\n }\r\n\r\n getGraphqlSite = async () => {\r\n const roles = await authService.getRoles()\r\n const appName = this.getAppName()\r\n switch (appName) {\r\n case EAppName.ClientAdmin:\r\n return this.isAdmin(roles) ? RoleKeyInternalSite.Admin : RoleKeyInternalSite.Manage\r\n case EAppName.ClientApp:\r\n default:\r\n return RoleKeyInternalSite.User\r\n }\r\n }\r\n}\r\n\r\nexport const AppProfile = new AppProfileBase()\r\n"],"names":["RoleKeyInternalSite","AppProfile","_createClass","AppProfileBase","_this","this","_classCallCheck","_defineProperty","_this$window$env$REAC","_this$window","window","env","REACT_APP_NAME","EAppName","ClientApp","roles","some","e","Admin","getAppName","ClientAdmin","_asyncToGenerator","_regenerator","m","_callee","appName","_t","w","_context","n","authService","getRoles","v","a","isAdmin","Manage","User","global"],"mappings":"kPAGA,IAAKA,GAAL,SAAKA,GACHA,EAAA,MAAA,QACAA,EAAA,KAAA,OACAA,EAAA,OAAA,QACD,CAJD,CAAKA,IAAAA,EAIJ,CAAA,IAAA,IA2BYC,EAAa,IAzBNC,EAElB,SAAAC,IAAA,IAAAC,EAAAC,KAAAC,OAAAH,GAAAI,EAIaF,KAAA,aAAA,WAAA,IAAAG,EAAAC,EAAA,OAAoD,QAApDD,EAAkB,QAAlBC,EAAOL,EAAKM,cAAM,IAAAD,GAAK,QAALA,EAAXA,EAAaE,WAAG,IAAAF,OAAA,EAAhBA,EAAkBG,sBAA2B,IAAAJ,EAAAA,EAAIK,EAASC,SAAS,GAAAP,EAAAF,KAAA,UAE7E,SAACU,GACT,OAAQA,QAAAA,EAAS,IAAIC,KAAK,SAACC,GAAC,OAAKA,IAAMjB,EAAoBkB,KAAM,IAAId,EAAKe,eAAiBN,EAASO,cACrGb,EAAAF,KAAA,iBAAAgB,EAAAC,IAAAC,EAEgB,SAAAC,IAAA,IAAAT,EAAAU,EAAAC,EAAA,OAAAJ,IAAAK,EAAA,SAAAC,GAAA,cAAAA,EAAAC,GAAA,KAAA,EAAA,OAAAD,EAAAC,EAAA,EACKC,EAAYC,WAAU,KAAA,EAApChB,EAAKa,EAAAI,EACLP,EAAUrB,EAAKe,aAAYO,EACzBD,EAAOG,EAAAC,EAAAH,IACRb,EAASO,YAAWM,GAEpBb,EAASC,UAAS,GAAA,MAAA,KAAA,EAAA,OAAAc,EAAAK,EADd7B,EAAAA,EAAK8B,QAAQnB,GAASf,EAAoBkB,MAAQlB,EAAoBmC,QAAM,KAAA,EAAA,OAAAP,EAAAK,EAG5EjC,EAAAA,EAAoBoC,MAAI,KAAA,EAAA,OAAAR,EAAAK,EAAA,GAAA,EAAAT,EAEpC,KAnBCnB,KAAKK,OAAS2B,OAAO3B,MACvB"}
|