@telia-ace/alliance-utilities 4.0.0-next.3 → 4.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{queryObjects as u}from"@telia-ace/alliance-framework";async function g(){return await u("currentOrganization").resolve()}import{queryObjects as p}from"@telia-ace/alliance-framework";import{AllianceError as c,FrameworkErrorCodes as d,UtilitiesErrorCodes as l,isAllianceError as f}from"@telia-ace/alliance-internal-client-utilities";async function m(){try{let r=await p("currentUser").resolve();return{...r,workspaces:r.workspaces||[],hasRole(e){return!!r&&r.roles.includes(e)}}}catch(r){throw f(r)&&r?.code===d.MissingManagedObjectProvider?new c(l.CurrentUserMissingProvider):r.message?.includes("No User Found")?new c(l.CurrentUserMissingInDatabase):r?.name==="TRPCClientError"&&r.message.includes("is not valid JSON")?new c(l.CurrentUserMissingBackend):r}}import{queryObjects as y}from"@telia-ace/alliance-framework";async function C(){let e=await y("currentWorkspace").resolve();return{...e,disableTaskbarActions:e.disableTaskbarActions||!1}}import{getAppManifest as b,getAppManifests as w,queryObjects as O}from"@telia-ace/alliance-framework";import{AllianceError as R,FrameworkErrorCodes as k}from"@telia-ace/alliance-internal-client-utilities";function z(r){let e={"app-name":r.name,"app-description":"",...Object.entries(r?.capabilities||{}).filter(([t,n])=>!!n.label).reduce((t,[n,o])=>({...t,[`capability-${n}`]:o.label||n}),{})};return r.resources?.localization?{...Object.keys(r.resources.localization).reduce((t,n)=>(t[n]=r.resources.localization[n].value,t),{}),...e}:e}function E(r,e){return Object.entries(e).reduce((i,[s,t])=>i.replaceAll(`{{${s}}}`,t),r)}async function
|
|
1
|
+
import{queryObjects as u}from"@telia-ace/alliance-framework";async function g(){return await u("currentOrganization").resolve()}import{queryObjects as p}from"@telia-ace/alliance-framework";import{AllianceError as c,FrameworkErrorCodes as d,UtilitiesErrorCodes as l,isAllianceError as f}from"@telia-ace/alliance-internal-client-utilities";async function m(){try{let r=await p("currentUser").resolve();return{...r,workspaces:r.workspaces||[],hasRole(e){return!!r&&r.roles.includes(e)}}}catch(r){throw f(r)&&r?.code===d.MissingManagedObjectProvider?new c(l.CurrentUserMissingProvider):r.message?.includes("No User Found")?new c(l.CurrentUserMissingInDatabase):r?.name==="TRPCClientError"&&r.message.includes("is not valid JSON")?new c(l.CurrentUserMissingBackend):r}}import{queryObjects as y}from"@telia-ace/alliance-framework";async function C(){let e=await y("currentWorkspace").resolve();return{...e,disableTaskbarActions:e.disableTaskbarActions||!1}}import{getAppManifest as b,getAppManifests as w,queryObjects as O}from"@telia-ace/alliance-framework";import{AllianceError as R,FrameworkErrorCodes as k}from"@telia-ace/alliance-internal-client-utilities";function z(r){let e={"app-name":r.name,"app-description":"",...Object.entries(r?.capabilities||{}).filter(([t,n])=>!!n.label).reduce((t,[n,o])=>({...t,[`capability-${n}`]:o.label||n}),{})};return r.resources?.localization?{...Object.keys(r.resources.localization).reduce((t,n)=>(t[n]=r.resources.localization[n].value,t),{}),...e}:e}function E(r,e){return Object.entries(e).reduce((i,[s,t])=>i.replaceAll(`{{${s}}}`,t),r)}async function T(r){let e=w(),i=e.find(n=>n.name===r),s=i?z(i):{},t={};return e?.find(({name:n})=>n==="resource-management")&&(t=await O("resourceTexts",{app:i?.name}).resolve()),Object.keys(s).reduce((n,o)=>(t[o]&&(n[o]=t[o]),n),s)}var a={};async function A(r){let e=r||b()?.name;return e?((!a[e]||Object.keys(a[e]).length===0)&&(a[e]=await T(e)),(i,s)=>{let t=a[e][i];if(t===void 0)throw new R(k.LocalizationTemplateNotDefined,{key:i});return!s||typeof s!="object"||Object.keys(s).length===0?t:E(t,s)}):()=>""}export{g as getCurrentOrganization,m as getCurrentUser,C as getCurrentWorkspace,A as getTranslator};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/alliance-utilities",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.5",
|
|
4
4
|
"description": "Utilities used by ACE Alliance apps.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@telia-ace/alliance-framework": "^4.0.0-next.
|
|
21
|
-
"@telia-ace/alliance-internal-client-utilities": "^4.0.0-next.
|
|
20
|
+
"@telia-ace/alliance-framework": "^4.0.0-next.5",
|
|
21
|
+
"@telia-ace/alliance-internal-client-utilities": "^4.0.0-next.5"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|