@atlaskit/profilecard 19.6.1 → 19.7.1
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/CHANGELOG.md +12 -0
- package/dist/cjs/client/errorUtils.js +14 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/errorUtils.js +14 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/errorUtils.js +14 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types-ts4.5/client/CachingClient.d.ts +18 -0
- package/dist/types-ts4.5/client/ProfileCardClient.d.ts +18 -0
- package/dist/types-ts4.5/client/TeamCentralCardClient.d.ts +45 -0
- package/dist/types-ts4.5/client/TeamProfileCardClient.d.ts +9 -0
- package/dist/types-ts4.5/client/UserProfileCardClient.d.ts +30 -0
- package/dist/types-ts4.5/client/errorUtils.d.ts +5 -0
- package/dist/types-ts4.5/client/getTeamFromAGG.d.ts +35 -0
- package/dist/types-ts4.5/client/graphqlUtils.d.ts +31 -0
- package/dist/types-ts4.5/client/index.d.ts +6 -0
- package/dist/types-ts4.5/client/types.d.ts +12 -0
- package/dist/types-ts4.5/components/Error/AccessLockSVG.d.ts +3 -0
- package/dist/types-ts4.5/components/Error/ErrorBoundary.d.ts +10 -0
- package/dist/types-ts4.5/components/Error/ErrorIllustration.d.ts +2 -0
- package/dist/types-ts4.5/components/Error/ErrorMessage.d.ts +10 -0
- package/dist/types-ts4.5/components/Error/index.d.ts +3 -0
- package/dist/types-ts4.5/components/Icon/IconLabel.d.ts +12 -0
- package/dist/types-ts4.5/components/Icon/index.d.ts +1 -0
- package/dist/types-ts4.5/components/Team/TeamForbiddenErrorState.d.ts +6 -0
- package/dist/types-ts4.5/components/Team/TeamLoadingState.d.ts +6 -0
- package/dist/types-ts4.5/components/Team/TeamProfileCard.d.ts +4 -0
- package/dist/types-ts4.5/components/Team/TeamProfileCardTrigger.d.ts +50 -0
- package/dist/types-ts4.5/components/Team/index.d.ts +4 -0
- package/dist/types-ts4.5/components/Team/lazyTeamProfileCard.d.ts +2 -0
- package/dist/types-ts4.5/components/User/OverflowProfileCardButtons.d.ts +9 -0
- package/dist/types-ts4.5/components/User/ProfileCard.d.ts +5 -0
- package/dist/types-ts4.5/components/User/ProfileCardDetails.d.ts +3 -0
- package/dist/types-ts4.5/components/User/ProfileCardResourced.d.ts +22 -0
- package/dist/types-ts4.5/components/User/ProfileCardTrigger.d.ts +4 -0
- package/dist/types-ts4.5/components/User/ReportingLinesDetails.d.ts +5 -0
- package/dist/types-ts4.5/components/User/UserLoadingState.d.ts +7 -0
- package/dist/types-ts4.5/components/User/index.d.ts +4 -0
- package/dist/types-ts4.5/components/User/lazyProfileCard.d.ts +2 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +41 -0
- package/dist/types-ts4.5/i18n/da.d.ts +41 -0
- package/dist/types-ts4.5/i18n/de.d.ts +41 -0
- package/dist/types-ts4.5/i18n/en.d.ts +41 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +41 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +41 -0
- package/dist/types-ts4.5/i18n/es.d.ts +41 -0
- package/dist/types-ts4.5/i18n/et.d.ts +27 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +41 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +41 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +41 -0
- package/dist/types-ts4.5/i18n/index.d.ts +36 -0
- package/dist/types-ts4.5/i18n/is.d.ts +27 -0
- package/dist/types-ts4.5/i18n/it.d.ts +41 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +41 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +41 -0
- package/dist/types-ts4.5/i18n/languages.d.ts +33 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +41 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +41 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +41 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +41 -0
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +27 -0
- package/dist/types-ts4.5/i18n/ro.d.ts +27 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +41 -0
- package/dist/types-ts4.5/i18n/sk.d.ts +27 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +41 -0
- package/dist/types-ts4.5/i18n/th.d.ts +41 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +41 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +41 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +41 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +41 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +41 -0
- package/dist/types-ts4.5/index.d.ts +18 -0
- package/dist/types-ts4.5/internal/filterActions.d.ts +3 -0
- package/dist/types-ts4.5/internal/relative-date.d.ts +3 -0
- package/dist/types-ts4.5/messages.d.ts +163 -0
- package/dist/types-ts4.5/mocks/index.d.ts +4 -0
- package/dist/types-ts4.5/mocks/mock-profile-client.d.ts +1 -0
- package/dist/types-ts4.5/mocks/mock-team-client.d.ts +8 -0
- package/dist/types-ts4.5/mocks/profile-data.d.ts +41 -0
- package/dist/types-ts4.5/mocks/reporting-lines-data.d.ts +2 -0
- package/dist/types-ts4.5/mocks/simple-mock-clients.d.ts +14 -0
- package/dist/types-ts4.5/mocks/team-data.d.ts +7 -0
- package/dist/types-ts4.5/mocks/util.d.ts +6 -0
- package/dist/types-ts4.5/styled/Card.d.ts +99 -0
- package/dist/types-ts4.5/styled/Error.d.ts +21 -0
- package/dist/types-ts4.5/styled/ReportingLines.d.ts +21 -0
- package/dist/types-ts4.5/styled/TeamCard.d.ts +64 -0
- package/dist/types-ts4.5/styled/constants.d.ts +13 -0
- package/dist/types-ts4.5/types.d.ts +358 -0
- package/dist/types-ts4.5/util/analytics.d.ts +59 -0
- package/dist/types-ts4.5/util/click.d.ts +4 -0
- package/dist/types-ts4.5/util/config.d.ts +2 -0
- package/dist/types-ts4.5/util/errors.d.ts +43 -0
- package/dist/types-ts4.5/util/performance.d.ts +1 -0
- package/dist/types-ts4.5/util/withOuterListeners.d.ts +6 -0
- package/package.json +5 -5
- package/tmp/api-report-tmp.d.ts +570 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 19.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41768](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41768) [`fe2e31821db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fe2e31821db) - Dont fail SLO on IdentityUserNotFoundError
|
|
8
|
+
|
|
9
|
+
## 19.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#41507](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41507) [`211ff35c18f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/211ff35c18f) - Handling of Jira custom client wrapping profile errors
|
|
14
|
+
|
|
3
15
|
## 19.6.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -7,7 +7,7 @@ exports.handleDirectoryGraphQLErrors = exports.handleAGGErrors = exports.getErro
|
|
|
7
7
|
var _errors = require("../util/errors");
|
|
8
8
|
var IGNORED_ERROR_REASONS_DIRECTORY = [
|
|
9
9
|
// Error categories from pf-directory
|
|
10
|
-
'NotPermitted', 'Gone'];
|
|
10
|
+
'NotPermitted', 'Gone', 'IdentityUserNotFoundError'];
|
|
11
11
|
var IGNORE_ERROR_TYPES_AGG = ['IdentityUserNotFoundError', 'TEAMS_FORBIDDEN', 'TEAMS_TEAM_DELETED'];
|
|
12
12
|
var IGNORE_ERROR_CLASSIFICATIONS_AGG = ['Gone'];
|
|
13
13
|
function isIgnoredError(error) {
|
|
@@ -56,6 +56,19 @@ var getErrorAttributes = exports.getErrorAttributes = function getErrorAttribute
|
|
|
56
56
|
errorCategory: error.classification
|
|
57
57
|
};
|
|
58
58
|
} else if (error instanceof Error) {
|
|
59
|
+
// Jira custom profile card client error, they wrap the error & put the underlying error in the cause property
|
|
60
|
+
if (error.message.startsWith('Unable to fetch user:')) {
|
|
61
|
+
if (error.hasOwnProperty('cause')) {
|
|
62
|
+
var causeError = error.cause;
|
|
63
|
+
if (causeError instanceof _errors.DirectoryGraphQLErrors || causeError instanceof _errors.AGGErrors) {
|
|
64
|
+
return getErrorAttributes(causeError);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
errorMessage: error.message,
|
|
69
|
+
isSLOFailure: false
|
|
70
|
+
};
|
|
71
|
+
}
|
|
59
72
|
return {
|
|
60
73
|
errorMessage: error.message,
|
|
61
74
|
isSLOFailure: true
|
|
@@ -60,7 +60,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
60
60
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
61
61
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
62
62
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
63
|
-
headers.append('atl-client-version', "19.
|
|
63
|
+
headers.append('atl-client-version', "19.7.1");
|
|
64
64
|
return headers;
|
|
65
65
|
};
|
|
66
66
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -44,7 +44,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
44
44
|
actionSubjectId: actionSubjectId,
|
|
45
45
|
attributes: _objectSpread(_objectSpread({
|
|
46
46
|
packageName: "@atlaskit/profilecard",
|
|
47
|
-
packageVersion: "19.
|
|
47
|
+
packageVersion: "19.7.1"
|
|
48
48
|
}, attributes), {}, {
|
|
49
49
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
50
50
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AGGError, AGGErrors, DirectoryGraphQLError, DirectoryGraphQLErrors } from '../util/errors';
|
|
2
2
|
const IGNORED_ERROR_REASONS_DIRECTORY = [
|
|
3
3
|
// Error categories from pf-directory
|
|
4
|
-
'NotPermitted', 'Gone'];
|
|
4
|
+
'NotPermitted', 'Gone', 'IdentityUserNotFoundError'];
|
|
5
5
|
const IGNORE_ERROR_TYPES_AGG = ['IdentityUserNotFoundError', 'TEAMS_FORBIDDEN', 'TEAMS_TEAM_DELETED'];
|
|
6
6
|
const IGNORE_ERROR_CLASSIFICATIONS_AGG = ['Gone'];
|
|
7
7
|
function isIgnoredError(error) {
|
|
@@ -50,6 +50,19 @@ export const getErrorAttributes = error => {
|
|
|
50
50
|
errorCategory: error.classification
|
|
51
51
|
};
|
|
52
52
|
} else if (error instanceof Error) {
|
|
53
|
+
// Jira custom profile card client error, they wrap the error & put the underlying error in the cause property
|
|
54
|
+
if (error.message.startsWith('Unable to fetch user:')) {
|
|
55
|
+
if (error.hasOwnProperty('cause')) {
|
|
56
|
+
const causeError = error.cause;
|
|
57
|
+
if (causeError instanceof DirectoryGraphQLErrors || causeError instanceof AGGErrors) {
|
|
58
|
+
return getErrorAttributes(causeError);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
errorMessage: error.message,
|
|
63
|
+
isSLOFailure: false
|
|
64
|
+
};
|
|
65
|
+
}
|
|
53
66
|
return {
|
|
54
67
|
errorMessage: error.message,
|
|
55
68
|
isSLOFailure: true
|
|
@@ -77,7 +77,7 @@ export const addHeaders = headers => {
|
|
|
77
77
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
78
78
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
79
79
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
80
|
-
headers.append('atl-client-version', "19.
|
|
80
|
+
headers.append('atl-client-version', "19.7.1");
|
|
81
81
|
return headers;
|
|
82
82
|
};
|
|
83
83
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -31,7 +31,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
31
31
|
actionSubjectId,
|
|
32
32
|
attributes: {
|
|
33
33
|
packageName: "@atlaskit/profilecard",
|
|
34
|
-
packageVersion: "19.
|
|
34
|
+
packageVersion: "19.7.1",
|
|
35
35
|
...attributes,
|
|
36
36
|
firedAt: Math.round(getPageTime())
|
|
37
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AGGError, AGGErrors, DirectoryGraphQLError, DirectoryGraphQLErrors } from '../util/errors';
|
|
2
2
|
var IGNORED_ERROR_REASONS_DIRECTORY = [
|
|
3
3
|
// Error categories from pf-directory
|
|
4
|
-
'NotPermitted', 'Gone'];
|
|
4
|
+
'NotPermitted', 'Gone', 'IdentityUserNotFoundError'];
|
|
5
5
|
var IGNORE_ERROR_TYPES_AGG = ['IdentityUserNotFoundError', 'TEAMS_FORBIDDEN', 'TEAMS_TEAM_DELETED'];
|
|
6
6
|
var IGNORE_ERROR_CLASSIFICATIONS_AGG = ['Gone'];
|
|
7
7
|
function isIgnoredError(error) {
|
|
@@ -50,6 +50,19 @@ export var getErrorAttributes = function getErrorAttributes(error) {
|
|
|
50
50
|
errorCategory: error.classification
|
|
51
51
|
};
|
|
52
52
|
} else if (error instanceof Error) {
|
|
53
|
+
// Jira custom profile card client error, they wrap the error & put the underlying error in the cause property
|
|
54
|
+
if (error.message.startsWith('Unable to fetch user:')) {
|
|
55
|
+
if (error.hasOwnProperty('cause')) {
|
|
56
|
+
var causeError = error.cause;
|
|
57
|
+
if (causeError instanceof DirectoryGraphQLErrors || causeError instanceof AGGErrors) {
|
|
58
|
+
return getErrorAttributes(causeError);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
errorMessage: error.message,
|
|
63
|
+
isSLOFailure: false
|
|
64
|
+
};
|
|
65
|
+
}
|
|
53
66
|
return {
|
|
54
67
|
errorMessage: error.message,
|
|
55
68
|
isSLOFailure: true
|
|
@@ -51,7 +51,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
51
51
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
52
52
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
53
53
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
54
|
-
headers.append('atl-client-version', "19.
|
|
54
|
+
headers.append('atl-client-version', "19.7.1");
|
|
55
55
|
return headers;
|
|
56
56
|
};
|
|
57
57
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -38,7 +38,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
38
38
|
actionSubjectId: actionSubjectId,
|
|
39
39
|
attributes: _objectSpread(_objectSpread({
|
|
40
40
|
packageName: "@atlaskit/profilecard",
|
|
41
|
-
packageVersion: "19.
|
|
41
|
+
packageVersion: "19.7.1"
|
|
42
42
|
}, attributes), {}, {
|
|
43
43
|
firedAt: Math.round(getPageTime())
|
|
44
44
|
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LRUMap } from 'lru_map';
|
|
2
|
+
interface CachedData<T> {
|
|
3
|
+
expire: number;
|
|
4
|
+
profile: T;
|
|
5
|
+
}
|
|
6
|
+
export interface CacheConfig {
|
|
7
|
+
cacheSize?: number;
|
|
8
|
+
cacheMaxAge?: number;
|
|
9
|
+
}
|
|
10
|
+
export default class CachingClient<T> {
|
|
11
|
+
config: Required<CacheConfig>;
|
|
12
|
+
cache: LRUMap<string, CachedData<T>> | null;
|
|
13
|
+
constructor(config: CacheConfig);
|
|
14
|
+
setCachedProfile(cacheIdentifier: string, profile: T): void;
|
|
15
|
+
getCachedProfile(cacheIdentifier: string): T | null;
|
|
16
|
+
flushCache(): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import { ClientOverrides, ProfileClientOptions, TeamCentralReportingLinesData } from '../types';
|
|
3
|
+
import TeamCentralCardClient from './TeamCentralCardClient';
|
|
4
|
+
import TeamProfileCardClient from './TeamProfileCardClient';
|
|
5
|
+
import UserProfileCardClient from './UserProfileCardClient';
|
|
6
|
+
declare class ProfileCardClient {
|
|
7
|
+
userClient: UserProfileCardClient;
|
|
8
|
+
teamClient: TeamProfileCardClient;
|
|
9
|
+
tcClient?: TeamCentralCardClient;
|
|
10
|
+
constructor(config: ProfileClientOptions, clients?: ClientOverrides);
|
|
11
|
+
flushCache(): void;
|
|
12
|
+
getProfile(cloudId: string, userId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<any>;
|
|
13
|
+
getTeamProfile(teamId: string, orgId?: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<import("../types").Team>;
|
|
14
|
+
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
15
|
+
getTeamCentralBaseUrl(): string | undefined;
|
|
16
|
+
shouldShowGiveKudos(): Promise<boolean>;
|
|
17
|
+
}
|
|
18
|
+
export default ProfileCardClient;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ProfileClientOptions, TeamCentralReportingLinesData } from '../types';
|
|
2
|
+
import CachingClient from './CachingClient';
|
|
3
|
+
export declare const buildReportingLinesQuery: (aaid: string) => {
|
|
4
|
+
query: string;
|
|
5
|
+
variables: {
|
|
6
|
+
aaid: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const buildCheckFeatureFlagQuery: (featureKey: string, context?: FeatureFlagExtraContext[]) => {
|
|
10
|
+
query: string;
|
|
11
|
+
variables: {
|
|
12
|
+
featureKey: string;
|
|
13
|
+
context: FeatureFlagExtraContext[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type TeamCentralCardClientOptions = ProfileClientOptions & {
|
|
17
|
+
teamCentralUrl: string;
|
|
18
|
+
};
|
|
19
|
+
type FeatureFlagExtraContext = {
|
|
20
|
+
key: string;
|
|
21
|
+
value: string;
|
|
22
|
+
};
|
|
23
|
+
declare class TeamCentralCardClient extends CachingClient<TeamCentralReportingLinesData> {
|
|
24
|
+
options: TeamCentralCardClientOptions;
|
|
25
|
+
/**
|
|
26
|
+
* Simple circuit breaker to avoid making unnecessary calls to Team Central on auth failures
|
|
27
|
+
* This is to handle the case where products may have provided teamCentralUrl, but the site itself
|
|
28
|
+
* doesn't actually have any TC product.
|
|
29
|
+
*
|
|
30
|
+
* There's currently no way to reset this circuit breaker, but that's fine. This is meant to
|
|
31
|
+
* catch a pretty specific edge case.
|
|
32
|
+
*/
|
|
33
|
+
bypassOnFailure: boolean;
|
|
34
|
+
featureFlagKeys: Map<string, boolean>;
|
|
35
|
+
isTCReadyPromise: Promise<boolean>;
|
|
36
|
+
constructor(options: TeamCentralCardClientOptions);
|
|
37
|
+
createTcReadyPromise(config: ProfileClientOptions): Promise<boolean>;
|
|
38
|
+
makeFeatureFlagCheckRequest(featureKey: string, context?: FeatureFlagExtraContext[]): Promise<boolean>;
|
|
39
|
+
makeRequest(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
40
|
+
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
41
|
+
getFlagEnabled(featureKey: string, productIdentifier?: string): Promise<boolean>;
|
|
42
|
+
checkWorkspaceExists(): Promise<boolean>;
|
|
43
|
+
private filterReportingLinesUser;
|
|
44
|
+
}
|
|
45
|
+
export default TeamCentralCardClient;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import type { ProfileClientOptions, Team } from '../types';
|
|
3
|
+
import CachingClient from './CachingClient';
|
|
4
|
+
export default class TeamProfileCardClient extends CachingClient<Team> {
|
|
5
|
+
options: ProfileClientOptions;
|
|
6
|
+
constructor(options: ProfileClientOptions);
|
|
7
|
+
makeRequest(teamId: string, _orgId: string | undefined): Promise<Team>;
|
|
8
|
+
getProfile(teamId: string, orgId: string | undefined, analytics?: (event: AnalyticsEventPayload) => void): Promise<Team>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import { ApiClientResponse, ProfileCardClientData, ProfileClientOptions } from '../types';
|
|
3
|
+
import CachingClient from './CachingClient';
|
|
4
|
+
/**
|
|
5
|
+
* Transform response from GraphQL
|
|
6
|
+
* - Prefix `timestring` with `remoteWeekdayString` depending on `remoteWeekdayIndex`
|
|
7
|
+
* - Remove properties which will be not used later
|
|
8
|
+
* @ignore
|
|
9
|
+
* @param {object} response
|
|
10
|
+
* @return {object}
|
|
11
|
+
*/
|
|
12
|
+
export declare const modifyResponse: (response: ApiClientResponse) => ProfileCardClientData;
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} userId
|
|
15
|
+
* @param {string} cloudId
|
|
16
|
+
* @return {string} GraphQL Query String
|
|
17
|
+
*/
|
|
18
|
+
export declare const buildUserQuery: (cloudId: string, userId: string) => {
|
|
19
|
+
query: string;
|
|
20
|
+
variables: {
|
|
21
|
+
cloudId: string;
|
|
22
|
+
userId: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default class UserProfileCardClient extends CachingClient<any> {
|
|
26
|
+
options: ProfileClientOptions;
|
|
27
|
+
constructor(options: ProfileClientOptions);
|
|
28
|
+
makeRequest(cloudId: string, userId: string): Promise<ProfileCardClientData>;
|
|
29
|
+
getProfile(cloudId: string, userId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<any>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AGGError, AGGErrors, DirectoryGraphQLError, DirectoryGraphQLErrors } from '../util/errors';
|
|
2
|
+
import { ErrorAttributes } from './types';
|
|
3
|
+
export declare const getErrorAttributes: (error?: DirectoryGraphQLErrors | Error | unknown | DirectoryGraphQLError | AGGError | AGGErrors) => ErrorAttributes;
|
|
4
|
+
export declare const handleDirectoryGraphQLErrors: (errors: unknown, traceId: string | null) => void;
|
|
5
|
+
export declare const handleAGGErrors: (errors: unknown, traceId: string | null) => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Team } from '../types';
|
|
2
|
+
interface AGGTeam extends Omit<Team, 'members'> {
|
|
3
|
+
members?: {
|
|
4
|
+
nodes: AGGMember[];
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
interface AGGMember {
|
|
8
|
+
member: {
|
|
9
|
+
accountId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
picture: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
interface AGGResult {
|
|
15
|
+
team: AGGTeam;
|
|
16
|
+
}
|
|
17
|
+
export declare const extractIdFromAri: (ari: string) => string;
|
|
18
|
+
export declare const idToAri: (teamId: string) => string;
|
|
19
|
+
export declare const convertTeam: (result: AGGResult) => Team;
|
|
20
|
+
export declare const GATEWAY_QUERY_V2: string;
|
|
21
|
+
export declare const GATEWAY_QUERY: string;
|
|
22
|
+
type TeamQueryVariables = {
|
|
23
|
+
teamId: string;
|
|
24
|
+
siteId?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const buildGatewayQuery: ({ teamId, siteId }: TeamQueryVariables) => {
|
|
27
|
+
query: string;
|
|
28
|
+
variables: {
|
|
29
|
+
siteId?: string | undefined;
|
|
30
|
+
teamId: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare const addHeaders: (headers: Headers) => Headers;
|
|
34
|
+
export declare function getTeamFromAGG(url: string, teamId: string, siteId?: string): Promise<Team>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface Query {
|
|
2
|
+
query: string;
|
|
3
|
+
variables: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
export interface GraphQLError {
|
|
6
|
+
code?: number;
|
|
7
|
+
reason?: string;
|
|
8
|
+
source?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
traceId?: string;
|
|
11
|
+
category: string;
|
|
12
|
+
type: string;
|
|
13
|
+
path: string[];
|
|
14
|
+
extensions: {
|
|
15
|
+
errorNumber: number;
|
|
16
|
+
} & Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
type HeaderProcessor = (headers: Headers) => Headers;
|
|
19
|
+
/**
|
|
20
|
+
* @param {string} serviceUrl - GraphQL service endpoint
|
|
21
|
+
* @param {Query} query - GraphQL query
|
|
22
|
+
* @param {HeaderProcessor} processHeaders - a function to add extra headers to the request
|
|
23
|
+
*/
|
|
24
|
+
export declare function directoryGraphqlQuery<D>(serviceUrl: string, query: Query, processHeaders?: HeaderProcessor): Promise<D>;
|
|
25
|
+
/**
|
|
26
|
+
* @param {string} serviceUrl - GraphQL service endpoint
|
|
27
|
+
* @param {Query} query - GraphQL query
|
|
28
|
+
* @param {HeaderProcessor} processHeaders - a function to add extra headers to the request
|
|
29
|
+
*/
|
|
30
|
+
export declare function AGGQuery<D>(serviceUrl: string, query: Query, processHeaders?: HeaderProcessor): Promise<D>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import CachingClient from './CachingClient';
|
|
2
|
+
import ProfileCardClient from './ProfileCardClient';
|
|
3
|
+
import TeamProfileClient from './TeamProfileCardClient';
|
|
4
|
+
import UserProfileClient, { modifyResponse } from './UserProfileCardClient';
|
|
5
|
+
export { CachingClient, modifyResponse, TeamProfileClient, UserProfileClient };
|
|
6
|
+
export default ProfileCardClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ErrorAttributes = {
|
|
2
|
+
errorCount?: number;
|
|
3
|
+
errorDetails?: Omit<ErrorAttributes, 'errorDetails'>[];
|
|
4
|
+
errorMessage: string;
|
|
5
|
+
errorCategory?: string;
|
|
6
|
+
errorType?: string;
|
|
7
|
+
errorPath?: string;
|
|
8
|
+
errorNumber?: number;
|
|
9
|
+
isSLOFailure: boolean;
|
|
10
|
+
traceId?: string | null;
|
|
11
|
+
errorStatusCode?: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
onError: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, {}> {
|
|
7
|
+
componentDidCatch(): void;
|
|
8
|
+
render(): React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
3
|
+
import { ProfileCardErrorType } from '../../types';
|
|
4
|
+
interface Props {
|
|
5
|
+
reload?: () => void | undefined;
|
|
6
|
+
errorType?: ProfileCardErrorType;
|
|
7
|
+
fireAnalytics: (payload: AnalyticsEventPayload) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const ErrorMessage: (props: Props) => JSX.Element;
|
|
10
|
+
export default ErrorMessage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
icon: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export default class IconLabel extends React.PureComponent<Props> {
|
|
7
|
+
static defaultProps: {
|
|
8
|
+
icon: string;
|
|
9
|
+
};
|
|
10
|
+
render(): JSX.Element | null;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IconLabel } from './IconLabel';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
3
|
+
import { TriggerProps } from '@atlaskit/popup/types';
|
|
4
|
+
import type { AnalyticsFromDuration, AnalyticsProps, ProfileCardAction, Team, TeamProfileCardTriggerProps, TeamProfileCardTriggerState } from '../../types';
|
|
5
|
+
export declare class TeamProfileCardTriggerInternal extends React.PureComponent<TeamProfileCardTriggerProps & AnalyticsProps, TeamProfileCardTriggerState> {
|
|
6
|
+
static defaultProps: Partial<TeamProfileCardTriggerProps>;
|
|
7
|
+
_isMounted: boolean;
|
|
8
|
+
showTimer: number;
|
|
9
|
+
hideTimer: number;
|
|
10
|
+
openedByHover: boolean;
|
|
11
|
+
openTime: number;
|
|
12
|
+
fireAnalytics: (payload: AnalyticsEventPayload) => void;
|
|
13
|
+
fireAnalyticsWithDuration: (generator: AnalyticsFromDuration) => void;
|
|
14
|
+
hideProfilecard: (delay?: number) => void;
|
|
15
|
+
showProfilecard: (delay?: number) => void;
|
|
16
|
+
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
17
|
+
onMouseEnter: () => void;
|
|
18
|
+
onMouseLeave: () => void;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
openKudosDrawer: () => void;
|
|
21
|
+
closeKudosDrawer: () => void;
|
|
22
|
+
kudosUrl: () => string;
|
|
23
|
+
stopPropagation: (event: React.MouseEvent<HTMLElement>) => void;
|
|
24
|
+
triggerListeners: {
|
|
25
|
+
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
26
|
+
onMouseEnter: () => void;
|
|
27
|
+
onMouseLeave: () => void;
|
|
28
|
+
};
|
|
29
|
+
cardListeners: {
|
|
30
|
+
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
31
|
+
onMouseEnter: () => void;
|
|
32
|
+
onMouseLeave: () => void;
|
|
33
|
+
};
|
|
34
|
+
state: TeamProfileCardTriggerState;
|
|
35
|
+
componentDidMount(): void;
|
|
36
|
+
componentDidUpdate(prevProps: TeamProfileCardTriggerProps): void;
|
|
37
|
+
componentWillUnmount(): void;
|
|
38
|
+
clientFetchProfile: () => void;
|
|
39
|
+
onErrorBoundary: () => void;
|
|
40
|
+
handleClientSuccess(team: Team, shouldShowGiveKudos: boolean): void;
|
|
41
|
+
handleClientError(err: any): void;
|
|
42
|
+
filterActions(): ProfileCardAction[];
|
|
43
|
+
renderProfileCard: () => JSX.Element;
|
|
44
|
+
renderKudosLauncher: () => false | JSX.Element | undefined;
|
|
45
|
+
renderTrigger: (triggerProps: TriggerProps) => JSX.Element;
|
|
46
|
+
renderPopup(): React.ReactNode;
|
|
47
|
+
render(): React.ReactNode;
|
|
48
|
+
}
|
|
49
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<TeamProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<TeamProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, keyof TeamProfileCardTriggerProps>> & Partial<Pick<Partial<TeamProfileCardTriggerProps>, never>> & React.RefAttributes<any>>;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsWithDurationProps, ProfileCardAction } from '../../types';
|
|
3
|
+
type OverflowButtonsProps = {
|
|
4
|
+
actions: ProfileCardAction[];
|
|
5
|
+
onItemClick: (action: ProfileCardAction, args: any, event: React.MouseEvent | React.KeyboardEvent, index: number) => void;
|
|
6
|
+
} & AnalyticsWithDurationProps;
|
|
7
|
+
export declare const ACTION_OVERFLOW_THRESHOLD = 2;
|
|
8
|
+
export declare const OverflowProfileCardButtons: (props: OverflowButtonsProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsProps, ProfilecardProps } from '../../types';
|
|
3
|
+
export declare const ProfilecardInternal: (props: ProfilecardProps & AnalyticsProps) => JSX.Element | null;
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<ProfilecardProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
3
|
+
import { AnalyticsProps, ProfileCardAction, ProfileCardClientData, ProfileCardResourcedProps, ProfileCardResourcedState, TeamCentralReportingLinesData } from '../../types';
|
|
4
|
+
declare class ProfileCardResourced extends React.PureComponent<ProfileCardResourcedProps & AnalyticsProps, ProfileCardResourcedState> {
|
|
5
|
+
static defaultProps: Partial<ProfileCardResourcedProps>;
|
|
6
|
+
_isMounted: boolean;
|
|
7
|
+
state: ProfileCardResourcedState;
|
|
8
|
+
fireAnalytics: (payload: AnalyticsEventPayload) => void;
|
|
9
|
+
componentDidMount(): void;
|
|
10
|
+
componentDidUpdate(prevProps: ProfileCardResourcedProps): void;
|
|
11
|
+
componentWillUnmount(): void;
|
|
12
|
+
clientFetchProfile: () => void;
|
|
13
|
+
handleClientSuccess(profileData: ProfileCardClientData, reportingLinesData: TeamCentralReportingLinesData, shouldShowGiveKudos: boolean): void;
|
|
14
|
+
handleClientError(err: any): void;
|
|
15
|
+
filterActions: () => ProfileCardAction[];
|
|
16
|
+
openKudosDrawer: () => void;
|
|
17
|
+
closeKudosDrawer: () => void;
|
|
18
|
+
render(): React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const ProfileCardResourcedInternal: typeof ProfileCardResourced;
|
|
21
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<ProfileCardResourcedProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<ProfileCardResourcedProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, keyof ProfileCardResourcedProps>> & Partial<Pick<Partial<ProfileCardResourcedProps>, never>> & React.RefAttributes<any>>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsProps, ProfileCardTriggerProps } from '../../types';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Omit<ProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<ProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, keyof ProfileCardTriggerProps>> & Partial<Pick<Partial<ProfileCardTriggerProps>, never>> & React.RefAttributes<any>>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnalyticsWithDurationProps, ProfilecardProps } from '../../types';
|
|
3
|
+
export type ReportingLinesDetailsProps = Pick<ProfilecardProps, 'reportingLines' | 'reportingLinesProfileUrl' | 'onReportingLinesClick'> & AnalyticsWithDurationProps;
|
|
4
|
+
declare const ReportingLinesDetails: (props: ReportingLinesDetailsProps) => JSX.Element;
|
|
5
|
+
export default ReportingLinesDetails;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
3
|
+
interface AnalyticsProps {
|
|
4
|
+
fireAnalytics: (payload: AnalyticsEventPayload) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const UserLoadingState: ({ fireAnalytics }: AnalyticsProps) => JSX.Element;
|
|
7
|
+
export default UserLoadingState;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ProfileCardLazy: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("../..").ProfilecardProps & import("../../types").AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any>>>;
|