@gooddata/api-client-tiger
Advanced tools
Comparing version 10.20.0-alpha.10 to 10.20.0-alpha.11
@@ -1,3 +0,3 @@ | ||
export declare const LIB_VERSION = "10.20.0-alpha.10"; | ||
export declare const LIB_VERSION = "10.20.0-alpha.11"; | ||
export declare const LIB_NAME = "@gooddata/api-client-tiger"; | ||
//# sourceMappingURL=__version.d.ts.map |
// (C) 2021 GoodData Corporation | ||
// DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD | ||
export const LIB_VERSION = "10.20.0-alpha.10"; | ||
export const LIB_VERSION = "10.20.0-alpha.11"; | ||
export const LIB_NAME = "@gooddata/api-client-tiger"; | ||
//# sourceMappingURL=__version.js.map |
@@ -35,2 +35,5 @@ import { AxiosInstance } from "axios"; | ||
userId: string; | ||
email?: string; | ||
firstName?: string; | ||
lastName?: string; | ||
organizationName: string; | ||
@@ -48,4 +51,5 @@ organizationId: string; | ||
getCurrent: () => Promise<IUserProfile>; | ||
getCurrentWithDetails: () => Promise<IUserProfile>; | ||
} | ||
export declare const tigerProfileClientFactory: (axios: AxiosInstance) => ProfileApiInterface; | ||
//# sourceMappingURL=profile.d.ts.map |
@@ -0,1 +1,2 @@ | ||
import { tigerEntitiesObjectsClientFactory } from "./entitiesObjects.js"; | ||
/** | ||
@@ -16,5 +17,34 @@ * @internal | ||
// TODO: replace with direct call of TigerClient (once methods are generated from OpenAPI) | ||
getCurrent: async () => (await axios.get("/api/v1/profile")).data, | ||
getCurrent: async (_detailed) => { | ||
return (await axios.get("/api/v1/profile")).data; | ||
}, | ||
getCurrentWithDetails: async (_detailed) => { | ||
const profile = (await axios.get("/api/v1/profile")).data; | ||
return { | ||
...profile, | ||
...(await getUserDetails(axios, profile.userId)), | ||
}; | ||
}, | ||
}; | ||
}; | ||
async function getUserDetails(axios, id) { | ||
const entitiesApi = tigerEntitiesObjectsClientFactory(axios); | ||
const user = (await entitiesApi.getEntityUsers({ | ||
id, | ||
})).data; | ||
const firstName = user.data.attributes?.firstname; | ||
const lastName = user.data.attributes?.lastname; | ||
const email = user.data.attributes?.email; | ||
return { | ||
...(firstName && | ||
lastName && { | ||
name: `${firstName} ${lastName}`, | ||
firstName, | ||
lastName, | ||
}), | ||
...(email && { | ||
email, | ||
}), | ||
}; | ||
} | ||
//# sourceMappingURL=profile.js.map |
{ | ||
"name": "@gooddata/api-client-tiger", | ||
"version": "10.20.0-alpha.10", | ||
"version": "10.20.0-alpha.11", | ||
"author": "GoodData", | ||
@@ -28,3 +28,3 @@ "description": "API Client for GoodData Cloud and GoodData.CN", | ||
"axios-cache-interceptor": "^1.2.0", | ||
"@gooddata/sdk-model": "10.20.0-alpha.10" | ||
"@gooddata/sdk-model": "10.20.0-alpha.11" | ||
}, | ||
@@ -58,3 +58,3 @@ "devDependencies": { | ||
"vitest": "1.0.4", | ||
"@gooddata/reference-workspace": "10.20.0-alpha.10" | ||
"@gooddata/reference-workspace": "10.20.0-alpha.11" | ||
}, | ||
@@ -61,0 +61,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
18505949
133890
+ Added@gooddata/sdk-model@10.20.0-alpha.11(transitive)
- Removed@gooddata/sdk-model@10.20.0-alpha.10(transitive)