@gooddata/api-client-tiger 10.20.0-alpha.10 → 10.20.0-alpha.11
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/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/api-client-tiger.d.ts +4 -0
- package/esm/profile.d.ts +4 -0
- package/esm/profile.d.ts.map +1 -1
- package/esm/profile.js +31 -1
- package/esm/profile.js.map +1 -1
- package/package.json +3 -3
package/esm/__version.d.ts
CHANGED
package/esm/__version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2021 GoodData Corporation
|
|
2
2
|
// DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
|
|
3
|
-
export const LIB_VERSION = "10.20.0-alpha.
|
|
3
|
+
export const LIB_VERSION = "10.20.0-alpha.11";
|
|
4
4
|
export const LIB_NAME = "@gooddata/api-client-tiger";
|
|
5
5
|
//# sourceMappingURL=__version.js.map
|
|
@@ -39536,6 +39536,9 @@ declare interface ITotalItem {
|
|
|
39536
39536
|
export declare interface IUserProfile {
|
|
39537
39537
|
name: string;
|
|
39538
39538
|
userId: string;
|
|
39539
|
+
email?: string;
|
|
39540
|
+
firstName?: string;
|
|
39541
|
+
lastName?: string;
|
|
39539
39542
|
organizationName: string;
|
|
39540
39543
|
organizationId: string;
|
|
39541
39544
|
links: {
|
|
@@ -67810,6 +67813,7 @@ export declare interface PositiveAttributeFilterPositiveAttributeFilter {
|
|
|
67810
67813
|
|
|
67811
67814
|
export declare interface ProfileApiInterface {
|
|
67812
67815
|
getCurrent: () => Promise<IUserProfile>;
|
|
67816
|
+
getCurrentWithDetails: () => Promise<IUserProfile>;
|
|
67813
67817
|
}
|
|
67814
67818
|
|
|
67815
67819
|
/**
|
package/esm/profile.d.ts
CHANGED
|
@@ -32,6 +32,9 @@ export declare function isStaticFeatures(features: ILiveFeatures | IStaticFeatur
|
|
|
32
32
|
export interface IUserProfile {
|
|
33
33
|
name: string;
|
|
34
34
|
userId: string;
|
|
35
|
+
email?: string;
|
|
36
|
+
firstName?: string;
|
|
37
|
+
lastName?: string;
|
|
35
38
|
organizationName: string;
|
|
36
39
|
organizationId: string;
|
|
37
40
|
links: {
|
|
@@ -44,6 +47,7 @@ export interface IUserProfile {
|
|
|
44
47
|
}
|
|
45
48
|
export interface ProfileApiInterface {
|
|
46
49
|
getCurrent: () => Promise<IUserProfile>;
|
|
50
|
+
getCurrentWithDetails: () => Promise<IUserProfile>;
|
|
47
51
|
}
|
|
48
52
|
export declare const tigerProfileClientFactory: (axios: AxiosInstance) => ProfileApiInterface;
|
|
49
53
|
//# sourceMappingURL=profile.d.ts.map
|
package/esm/profile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAGxE,MAAM,MAAM,cAAc,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE;QACF,aAAa,EAAE;YACX,IAAI,EAAE,MAAM,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;SACf,CAAC;QACF,OAAO,EAAE,cAAc,CAAC;KAC3B,CAAC;CACL;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC1B,QAAQ,EAAE,aAAa,GAAG,eAAe,GAAG,SAAS,GACtD,QAAQ,IAAI,aAAa,CAE3B;AAED,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,EAAE,cAAc,CAAC;KAC3B,CAAC;CACL;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,QAAQ,EAAE,aAAa,GAAG,eAAe,GAAG,SAAS,GACtD,QAAQ,IAAI,eAAe,CAE7B;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,QAAQ,CAAC,EAAE,aAAa,GAAG,eAAe,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,cAAc,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IACxC,qBAAqB,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,yBAAyB,UAAW,aAAa,KAAG,mBAehE,CAAC"}
|
package/esm/profile.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { tigerEntitiesObjectsClientFactory } from "./entitiesObjects.js";
|
|
1
2
|
/**
|
|
2
3
|
* @internal
|
|
3
4
|
*/
|
|
@@ -13,7 +14,36 @@ export function isStaticFeatures(features) {
|
|
|
13
14
|
export const tigerProfileClientFactory = (axios) => {
|
|
14
15
|
return {
|
|
15
16
|
// TODO: replace with direct call of TigerClient (once methods are generated from OpenAPI)
|
|
16
|
-
getCurrent: async () =>
|
|
17
|
+
getCurrent: async (_detailed) => {
|
|
18
|
+
return (await axios.get("/api/v1/profile")).data;
|
|
19
|
+
},
|
|
20
|
+
getCurrentWithDetails: async (_detailed) => {
|
|
21
|
+
const profile = (await axios.get("/api/v1/profile")).data;
|
|
22
|
+
return {
|
|
23
|
+
...profile,
|
|
24
|
+
...(await getUserDetails(axios, profile.userId)),
|
|
25
|
+
};
|
|
26
|
+
},
|
|
17
27
|
};
|
|
18
28
|
};
|
|
29
|
+
async function getUserDetails(axios, id) {
|
|
30
|
+
const entitiesApi = tigerEntitiesObjectsClientFactory(axios);
|
|
31
|
+
const user = (await entitiesApi.getEntityUsers({
|
|
32
|
+
id,
|
|
33
|
+
})).data;
|
|
34
|
+
const firstName = user.data.attributes?.firstname;
|
|
35
|
+
const lastName = user.data.attributes?.lastname;
|
|
36
|
+
const email = user.data.attributes?.email;
|
|
37
|
+
return {
|
|
38
|
+
...(firstName &&
|
|
39
|
+
lastName && {
|
|
40
|
+
name: `${firstName} ${lastName}`,
|
|
41
|
+
firstName,
|
|
42
|
+
lastName,
|
|
43
|
+
}),
|
|
44
|
+
...(email && {
|
|
45
|
+
email,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
19
49
|
//# sourceMappingURL=profile.js.map
|
package/esm/profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAmBzE;;GAEG;AACH,MAAM,UAAU,cAAc,CAC1B,QAAqD;IAErD,OAAQ,QAA0B,EAAE,IAAI,KAAK,SAAS,CAAC;AAC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;SACX,CAAC;QACN,GAAG,CAAC,KAAK,IAAI;YACT,KAAK;SACR,CAAC;KACL,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/api-client-tiger",
|
|
3
|
-
"version": "10.20.0-alpha.
|
|
3
|
+
"version": "10.20.0-alpha.11",
|
|
4
4
|
"author": "GoodData",
|
|
5
5
|
"description": "API Client for GoodData Cloud and GoodData.CN",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"lodash": "^4.17.21",
|
|
26
26
|
"tslib": "^2.5.0",
|
|
27
27
|
"axios-cache-interceptor": "^1.2.0",
|
|
28
|
-
"@gooddata/sdk-model": "10.20.0-alpha.
|
|
28
|
+
"@gooddata/sdk-model": "10.20.0-alpha.11"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@gooddata/eslint-config": "^4.1.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"prettier": "~2.5.0",
|
|
55
55
|
"typescript": "5.3.3",
|
|
56
56
|
"vitest": "1.0.4",
|
|
57
|
-
"@gooddata/reference-workspace": "10.20.0-alpha.
|
|
57
|
+
"@gooddata/reference-workspace": "10.20.0-alpha.11"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"clean": "rm -rf ci dist esm coverage *.log tsconfig.tsbuildinfo",
|