@atlaskit/profilecard 24.19.0 → 24.20.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 +18 -21
- package/dist/cjs/client/RovoAgentCardClient.js +201 -33
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +55 -34
- package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +55 -33
- package/dist/cjs/mocks/agent-data.js +7 -1
- package/dist/cjs/mocks/simple-mock-clients.js +8 -3
- package/dist/cjs/util/analytics.js +2 -2
- package/dist/es2019/client/RovoAgentCardClient.js +135 -9
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +26 -3
- package/dist/es2019/components/Agent/AgentProfileCardTrigger.js +26 -3
- package/dist/es2019/mocks/agent-data.js +6 -0
- package/dist/es2019/mocks/simple-mock-clients.js +6 -3
- package/dist/es2019/util/analytics.js +2 -2
- package/dist/esm/client/RovoAgentCardClient.js +202 -34
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +55 -34
- package/dist/esm/components/Agent/AgentProfileCardTrigger.js +55 -33
- package/dist/esm/mocks/agent-data.js +6 -0
- package/dist/esm/mocks/simple-mock-clients.js +6 -3
- package/dist/esm/util/analytics.js +2 -2
- package/dist/types/client/ProfileCardClient.d.ts +1 -1
- package/dist/types/client/RovoAgentCardClient.d.ts +14 -4
- package/dist/types/mocks/agent-data.d.ts +2 -1
- package/dist/types/mocks/simple-mock-clients.d.ts +2 -2
- package/dist/types/types.d.ts +11 -1
- package/dist/types-ts4.5/client/ProfileCardClient.d.ts +1 -1
- package/dist/types-ts4.5/client/RovoAgentCardClient.d.ts +14 -4
- package/dist/types-ts4.5/mocks/agent-data.d.ts +2 -1
- package/dist/types-ts4.5/mocks/simple-mock-clients.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +11 -1
- package/package.json +10 -7
|
@@ -33,44 +33,60 @@ export var AgentProfileCardTrigger = /*#__PURE__*/forwardRef(function (_ref, ref
|
|
|
33
33
|
fireEvent(createAnalyticsEvent, payload);
|
|
34
34
|
}
|
|
35
35
|
}, [createAnalyticsEvent]);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
|
|
39
|
+
* @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
|
|
40
|
+
*/
|
|
36
41
|
var getCreator = /*#__PURE__*/function () {
|
|
37
|
-
var
|
|
38
|
-
var _userId, _navigateToTeamsApp, profileHref, creatorInfo;
|
|
42
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
43
|
+
var creator_type, creator, authoringTeam, _userId, _authoringTeam$displa, _authoringTeam$profil, _navigateToTeamsApp, profileHref, creatorInfo;
|
|
39
44
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
40
45
|
while (1) switch (_context.prev = _context.next) {
|
|
41
46
|
case 0:
|
|
47
|
+
creator_type = _ref2.creator_type, creator = _ref2.creator, authoringTeam = _ref2.authoringTeam;
|
|
42
48
|
if (creator) {
|
|
43
|
-
_context.next =
|
|
49
|
+
_context.next = 3;
|
|
44
50
|
break;
|
|
45
51
|
}
|
|
46
52
|
return _context.abrupt("return", undefined);
|
|
47
|
-
case
|
|
53
|
+
case 3:
|
|
48
54
|
_context.t0 = creator_type;
|
|
49
|
-
_context.next = _context.t0 === 'SYSTEM' ?
|
|
55
|
+
_context.next = _context.t0 === 'SYSTEM' ? 6 : _context.t0 === 'THIRD_PARTY' ? 7 : _context.t0 === 'FORGE' ? 8 : _context.t0 === 'CUSTOMER' ? 9 : 25;
|
|
50
56
|
break;
|
|
51
|
-
case
|
|
57
|
+
case 6:
|
|
52
58
|
return _context.abrupt("return", {
|
|
53
59
|
type: 'SYSTEM'
|
|
54
60
|
});
|
|
55
|
-
case
|
|
61
|
+
case 7:
|
|
56
62
|
return _context.abrupt("return", {
|
|
57
63
|
type: 'THIRD_PARTY',
|
|
58
64
|
name: creator !== null && creator !== void 0 ? creator : ''
|
|
59
65
|
});
|
|
60
|
-
case
|
|
66
|
+
case 8:
|
|
61
67
|
return _context.abrupt("return", {
|
|
62
68
|
type: 'THIRD_PARTY',
|
|
63
69
|
name: creator !== null && creator !== void 0 ? creator : ''
|
|
64
70
|
});
|
|
65
|
-
case
|
|
71
|
+
case 9:
|
|
66
72
|
_userId = getAAIDFromARI(creator) || '';
|
|
67
|
-
_context.prev =
|
|
73
|
+
_context.prev = 10;
|
|
68
74
|
if (!(!_userId || !cloudId)) {
|
|
69
|
-
_context.next =
|
|
75
|
+
_context.next = 13;
|
|
70
76
|
break;
|
|
71
77
|
}
|
|
72
78
|
return _context.abrupt("return", undefined);
|
|
73
|
-
case
|
|
79
|
+
case 13:
|
|
80
|
+
if (!(authoringTeam && fg('agent_studio_permissions_settings_m3_profiles'))) {
|
|
81
|
+
_context.next = 15;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
return _context.abrupt("return", {
|
|
85
|
+
type: 'CUSTOMER',
|
|
86
|
+
name: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
|
|
87
|
+
profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : ''
|
|
88
|
+
});
|
|
89
|
+
case 15:
|
|
74
90
|
_navigateToTeamsApp = navigateToTeamsApp({
|
|
75
91
|
type: 'USER',
|
|
76
92
|
payload: {
|
|
@@ -78,9 +94,9 @@ export var AgentProfileCardTrigger = /*#__PURE__*/forwardRef(function (_ref, ref
|
|
|
78
94
|
},
|
|
79
95
|
cloudId: cloudId
|
|
80
96
|
}), profileHref = _navigateToTeamsApp.href;
|
|
81
|
-
_context.next =
|
|
97
|
+
_context.next = 18;
|
|
82
98
|
return props.resourceClient.getProfile(cloudId, _userId, fireAnalytics, fireEventNext);
|
|
83
|
-
case
|
|
99
|
+
case 18:
|
|
84
100
|
creatorInfo = _context.sent;
|
|
85
101
|
return _context.abrupt("return", {
|
|
86
102
|
type: 'CUSTOMER',
|
|
@@ -88,25 +104,26 @@ export var AgentProfileCardTrigger = /*#__PURE__*/forwardRef(function (_ref, ref
|
|
|
88
104
|
profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(_userId),
|
|
89
105
|
id: _userId
|
|
90
106
|
});
|
|
91
|
-
case 19:
|
|
92
|
-
_context.prev = 19;
|
|
93
|
-
_context.t1 = _context["catch"](9);
|
|
94
|
-
return _context.abrupt("return", undefined);
|
|
95
107
|
case 22:
|
|
108
|
+
_context.prev = 22;
|
|
109
|
+
_context.t1 = _context["catch"](10);
|
|
110
|
+
return _context.abrupt("return", undefined);
|
|
111
|
+
case 25:
|
|
96
112
|
return _context.abrupt("return", undefined);
|
|
97
|
-
case
|
|
113
|
+
case 26:
|
|
98
114
|
case "end":
|
|
99
115
|
return _context.stop();
|
|
100
116
|
}
|
|
101
|
-
}, _callee, null, [[
|
|
117
|
+
}, _callee, null, [[10, 22]]);
|
|
102
118
|
}));
|
|
103
|
-
return function getCreator(_x
|
|
104
|
-
return
|
|
119
|
+
return function getCreator(_x) {
|
|
120
|
+
return _ref3.apply(this, arguments);
|
|
105
121
|
};
|
|
106
122
|
}();
|
|
107
123
|
var fetchAgentProfile = /*#__PURE__*/function () {
|
|
108
|
-
var
|
|
109
|
-
var
|
|
124
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
125
|
+
var _agentProfileResult$a, _agentProfileResult$a2;
|
|
126
|
+
var agentProfileResult, agentInfo, agentCreatorInfo;
|
|
110
127
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
111
128
|
while (1) switch (_context2.prev = _context2.next) {
|
|
112
129
|
case 0:
|
|
@@ -116,27 +133,32 @@ export var AgentProfileCardTrigger = /*#__PURE__*/forwardRef(function (_ref, ref
|
|
|
116
133
|
value: userId
|
|
117
134
|
}, fireAnalytics, fireEventNext);
|
|
118
135
|
case 2:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
136
|
+
agentProfileResult = _context2.sent;
|
|
137
|
+
agentInfo = agentProfileResult.restData;
|
|
138
|
+
_context2.next = 6;
|
|
139
|
+
return getCreator({
|
|
140
|
+
creator_type: agentInfo.creator_type,
|
|
141
|
+
creator: agentInfo.creator || undefined,
|
|
142
|
+
authoringTeam: (_agentProfileResult$a = (_agentProfileResult$a2 = agentProfileResult.aggData) === null || _agentProfileResult$a2 === void 0 ? void 0 : _agentProfileResult$a2.authoringTeam) !== null && _agentProfileResult$a !== void 0 ? _agentProfileResult$a : undefined
|
|
143
|
+
});
|
|
144
|
+
case 6:
|
|
123
145
|
agentCreatorInfo = _context2.sent;
|
|
124
146
|
return _context2.abrupt("return", _objectSpread(_objectSpread({}, agentInfo), {}, {
|
|
125
147
|
creatorInfo: agentCreatorInfo
|
|
126
148
|
}));
|
|
127
|
-
case
|
|
149
|
+
case 8:
|
|
128
150
|
case "end":
|
|
129
151
|
return _context2.stop();
|
|
130
152
|
}
|
|
131
153
|
}, _callee2);
|
|
132
154
|
}));
|
|
133
155
|
return function fetchAgentProfile() {
|
|
134
|
-
return
|
|
156
|
+
return _ref4.apply(this, arguments);
|
|
135
157
|
};
|
|
136
158
|
}();
|
|
137
|
-
var renderProfileCard = function renderProfileCard(
|
|
138
|
-
var profileData =
|
|
139
|
-
error =
|
|
159
|
+
var renderProfileCard = function renderProfileCard(_ref5) {
|
|
160
|
+
var profileData = _ref5.profileData,
|
|
161
|
+
error = _ref5.error;
|
|
140
162
|
return /*#__PURE__*/React.createElement(Suspense, {
|
|
141
163
|
fallback: null
|
|
142
164
|
}, /*#__PURE__*/React.createElement(AgentProfileCardLazy, {
|
|
@@ -11,4 +11,10 @@ var agentData = {
|
|
|
11
11
|
user_defined_conversation_starters: [],
|
|
12
12
|
deactivated: false
|
|
13
13
|
};
|
|
14
|
+
export var agentAggData = {
|
|
15
|
+
authoringTeam: {
|
|
16
|
+
displayName: 'Profile card agent',
|
|
17
|
+
profileUrl: 'https://example.com/profile'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
14
20
|
export default agentData;
|
|
@@ -12,7 +12,7 @@ import ProfileCardClient from '../client/ProfileCardClient';
|
|
|
12
12
|
import RovoAgentCardClient from '../client/RovoAgentCardClient';
|
|
13
13
|
import TeamProfileCardClient from '../client/TeamProfileCardClient';
|
|
14
14
|
import UserProfileCardClient from '../client/UserProfileCardClient';
|
|
15
|
-
import agentData from './agent-data';
|
|
15
|
+
import agentData, { agentAggData } from './agent-data';
|
|
16
16
|
import profiles from './profile-data';
|
|
17
17
|
import teamData from './team-data';
|
|
18
18
|
import { getTimeString, getWeekday } from './util';
|
|
@@ -61,8 +61,11 @@ var SimpleMockAgentClient = /*#__PURE__*/function (_RovoAgentCardClient) {
|
|
|
61
61
|
_inherits(SimpleMockAgentClient, _RovoAgentCardClient);
|
|
62
62
|
return _createClass(SimpleMockAgentClient, [{
|
|
63
63
|
key: "makeRequest",
|
|
64
|
-
value: function makeRequest(id
|
|
65
|
-
return Promise.resolve(
|
|
64
|
+
value: function makeRequest(id) {
|
|
65
|
+
return Promise.resolve({
|
|
66
|
+
restData: agentData,
|
|
67
|
+
aggData: agentAggData
|
|
68
|
+
});
|
|
66
69
|
}
|
|
67
70
|
}]);
|
|
68
71
|
}(RovoAgentCardClient);
|
|
@@ -7,7 +7,7 @@ import { getPageTime } from './performance';
|
|
|
7
7
|
var ANALYTICS_CHANNEL = 'peopleTeams';
|
|
8
8
|
export var PACKAGE_META_DATA = {
|
|
9
9
|
packageName: "@atlaskit/profilecard",
|
|
10
|
-
packageVersion: "24.
|
|
10
|
+
packageVersion: "24.20.0"
|
|
11
11
|
};
|
|
12
12
|
var runItLater = function runItLater(cb) {
|
|
13
13
|
var requestIdleCallback = window.requestIdleCallback;
|
|
@@ -52,7 +52,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
52
52
|
actionSubjectId: actionSubjectId,
|
|
53
53
|
attributes: _objectSpread(_objectSpread({
|
|
54
54
|
packageName: "@atlaskit/profilecard",
|
|
55
|
-
packageVersion: "24.
|
|
55
|
+
packageVersion: "24.20.0"
|
|
56
56
|
}, attributes), {}, {
|
|
57
57
|
firedAt: Math.round(getPageTime())
|
|
58
58
|
})
|
|
@@ -21,7 +21,7 @@ declare class ProfileCardClient implements ProfileClient {
|
|
|
21
21
|
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
22
22
|
getTeamCentralBaseUrl(teamCentralScopes?: TeamCentralScopes): Promise<string | undefined>;
|
|
23
23
|
shouldShowGiveKudos(): Promise<boolean>;
|
|
24
|
-
getRovoAgentProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<import("../types").
|
|
24
|
+
getRovoAgentProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<import("../types").RovoAgentCardClientResult>;
|
|
25
25
|
getRovoAgentPermissions(id: string, fireAnalytics?: ((event: AnalyticsEventPayload) => void) | undefined, analyticsNext?: FireEventType): Promise<import("../types").AgentPermissions>;
|
|
26
26
|
deleteAgent(id: string, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<void>;
|
|
27
27
|
setFavouriteAgent(id: string, isFavourite: boolean, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<void>;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
2
|
import { type FireEventType } from '@atlaskit/teams-app-internal-analytics';
|
|
3
|
-
import type { AgentIdType, AgentPermissions, ProfileClientOptions,
|
|
3
|
+
import type { AgentIdType, AgentPermissions, ProfileClientOptions, RovoAgentCardClientResult } from '../types';
|
|
4
4
|
import CachingClient from './CachingClient';
|
|
5
|
-
export default class RovoAgentCardClient extends CachingClient<
|
|
5
|
+
export default class RovoAgentCardClient extends CachingClient<RovoAgentCardClientResult> {
|
|
6
6
|
options: ProfileClientOptions;
|
|
7
7
|
constructor(options: ProfileClientOptions);
|
|
8
8
|
private basePath;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
private getActivationId;
|
|
10
|
+
private getAgentByARIAgg;
|
|
11
|
+
private getAgentByAccountIdAgg;
|
|
12
|
+
makeRequest(id: AgentIdType, analyticsNext?: FireEventType): Promise<RovoAgentCardClientResult>;
|
|
13
|
+
/**
|
|
14
|
+
* This function will call both REST and AGG endpoints to get the agent profile
|
|
15
|
+
* There are some data that is only available in the AGG endpoint, so we need to call both
|
|
16
|
+
* For any new fields, please only add them to the AGG endpoint
|
|
17
|
+
*
|
|
18
|
+
* @TODO migrate everything to AGG endpoint
|
|
19
|
+
*/
|
|
20
|
+
getProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<RovoAgentCardClientResult>;
|
|
11
21
|
deleteAgent(agentId: string, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<void>;
|
|
12
22
|
setFavouriteAgent(agentId: string, isFavourite: boolean, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<void>;
|
|
13
23
|
getPermissions(id: string, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType): Promise<AgentPermissions>;
|
|
@@ -2,7 +2,7 @@ import ProfileCardClient from '../client/ProfileCardClient';
|
|
|
2
2
|
import RovoAgentCardClient from '../client/RovoAgentCardClient';
|
|
3
3
|
import TeamProfileCardClient from '../client/TeamProfileCardClient';
|
|
4
4
|
import UserProfileCardClient from '../client/UserProfileCardClient';
|
|
5
|
-
import { type AgentIdType, type ProfileCardClientData, type
|
|
5
|
+
import { type AgentIdType, type ProfileCardClientData, type RovoAgentCardClientResult, type Team } from '../types';
|
|
6
6
|
declare class SimpleMockTeamClient extends TeamProfileCardClient {
|
|
7
7
|
makeRequest(teamId: string): Promise<Team>;
|
|
8
8
|
}
|
|
@@ -10,7 +10,7 @@ declare class SimpleMockUserClient extends UserProfileCardClient {
|
|
|
10
10
|
makeRequest(cloudId: string, userId: string): Promise<ProfileCardClientData>;
|
|
11
11
|
}
|
|
12
12
|
declare class SimpleMockAgentClient extends RovoAgentCardClient {
|
|
13
|
-
makeRequest(id: AgentIdType
|
|
13
|
+
makeRequest(id: AgentIdType): Promise<RovoAgentCardClientResult>;
|
|
14
14
|
}
|
|
15
15
|
export declare const simpleMockUserClient: SimpleMockUserClient;
|
|
16
16
|
export declare const simpleMockTeamClient: SimpleMockTeamClient;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -80,6 +80,16 @@ export interface RovoAgent {
|
|
|
80
80
|
icon?: string | null;
|
|
81
81
|
external_config_reference?: string;
|
|
82
82
|
}
|
|
83
|
+
export type RovoAgentAgg = {
|
|
84
|
+
authoringTeam: {
|
|
85
|
+
displayName: string | null | undefined;
|
|
86
|
+
profileUrl: string | null | undefined;
|
|
87
|
+
} | null | undefined;
|
|
88
|
+
};
|
|
89
|
+
export type RovoAgentCardClientResult = {
|
|
90
|
+
restData: RovoAgent;
|
|
91
|
+
aggData: RovoAgentAgg | null | undefined;
|
|
92
|
+
};
|
|
83
93
|
export interface RovoAgentCreatorInfo {
|
|
84
94
|
type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE';
|
|
85
95
|
name?: string;
|
|
@@ -485,7 +495,7 @@ export interface ProfileClient {
|
|
|
485
495
|
getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
|
|
486
496
|
shouldShowGiveKudos: () => Promise<boolean>;
|
|
487
497
|
getTeamCentralBaseUrl: (teamCentralScopes?: TeamCentralScopes) => Promise<string | undefined>;
|
|
488
|
-
getRovoAgentProfile: (id: AgentIdType, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<
|
|
498
|
+
getRovoAgentProfile: (id: AgentIdType, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<RovoAgentCardClientResult>;
|
|
489
499
|
getRovoAgentPermissions: (id: string, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<AgentPermissions>;
|
|
490
500
|
deleteAgent: (id: string, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<void>;
|
|
491
501
|
setFavouriteAgent: (id: string, isFavourite: boolean, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<void>;
|
|
@@ -21,7 +21,7 @@ declare class ProfileCardClient implements ProfileClient {
|
|
|
21
21
|
getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
|
|
22
22
|
getTeamCentralBaseUrl(teamCentralScopes?: TeamCentralScopes): Promise<string | undefined>;
|
|
23
23
|
shouldShowGiveKudos(): Promise<boolean>;
|
|
24
|
-
getRovoAgentProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<import("../types").
|
|
24
|
+
getRovoAgentProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<import("../types").RovoAgentCardClientResult>;
|
|
25
25
|
getRovoAgentPermissions(id: string, fireAnalytics?: ((event: AnalyticsEventPayload) => void) | undefined, analyticsNext?: FireEventType): Promise<import("../types").AgentPermissions>;
|
|
26
26
|
deleteAgent(id: string, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<void>;
|
|
27
27
|
setFavouriteAgent(id: string, isFavourite: boolean, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<void>;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
2
|
import { type FireEventType } from '@atlaskit/teams-app-internal-analytics';
|
|
3
|
-
import type { AgentIdType, AgentPermissions, ProfileClientOptions,
|
|
3
|
+
import type { AgentIdType, AgentPermissions, ProfileClientOptions, RovoAgentCardClientResult } from '../types';
|
|
4
4
|
import CachingClient from './CachingClient';
|
|
5
|
-
export default class RovoAgentCardClient extends CachingClient<
|
|
5
|
+
export default class RovoAgentCardClient extends CachingClient<RovoAgentCardClientResult> {
|
|
6
6
|
options: ProfileClientOptions;
|
|
7
7
|
constructor(options: ProfileClientOptions);
|
|
8
8
|
private basePath;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
private getActivationId;
|
|
10
|
+
private getAgentByARIAgg;
|
|
11
|
+
private getAgentByAccountIdAgg;
|
|
12
|
+
makeRequest(id: AgentIdType, analyticsNext?: FireEventType): Promise<RovoAgentCardClientResult>;
|
|
13
|
+
/**
|
|
14
|
+
* This function will call both REST and AGG endpoints to get the agent profile
|
|
15
|
+
* There are some data that is only available in the AGG endpoint, so we need to call both
|
|
16
|
+
* For any new fields, please only add them to the AGG endpoint
|
|
17
|
+
*
|
|
18
|
+
* @TODO migrate everything to AGG endpoint
|
|
19
|
+
*/
|
|
20
|
+
getProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<RovoAgentCardClientResult>;
|
|
11
21
|
deleteAgent(agentId: string, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<void>;
|
|
12
22
|
setFavouriteAgent(agentId: string, isFavourite: boolean, analytics?: (event: AnalyticsEventPayload) => void, analyticsNext?: FireEventType): Promise<void>;
|
|
13
23
|
getPermissions(id: string, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType): Promise<AgentPermissions>;
|
|
@@ -2,7 +2,7 @@ import ProfileCardClient from '../client/ProfileCardClient';
|
|
|
2
2
|
import RovoAgentCardClient from '../client/RovoAgentCardClient';
|
|
3
3
|
import TeamProfileCardClient from '../client/TeamProfileCardClient';
|
|
4
4
|
import UserProfileCardClient from '../client/UserProfileCardClient';
|
|
5
|
-
import { type AgentIdType, type ProfileCardClientData, type
|
|
5
|
+
import { type AgentIdType, type ProfileCardClientData, type RovoAgentCardClientResult, type Team } from '../types';
|
|
6
6
|
declare class SimpleMockTeamClient extends TeamProfileCardClient {
|
|
7
7
|
makeRequest(teamId: string): Promise<Team>;
|
|
8
8
|
}
|
|
@@ -10,7 +10,7 @@ declare class SimpleMockUserClient extends UserProfileCardClient {
|
|
|
10
10
|
makeRequest(cloudId: string, userId: string): Promise<ProfileCardClientData>;
|
|
11
11
|
}
|
|
12
12
|
declare class SimpleMockAgentClient extends RovoAgentCardClient {
|
|
13
|
-
makeRequest(id: AgentIdType
|
|
13
|
+
makeRequest(id: AgentIdType): Promise<RovoAgentCardClientResult>;
|
|
14
14
|
}
|
|
15
15
|
export declare const simpleMockUserClient: SimpleMockUserClient;
|
|
16
16
|
export declare const simpleMockTeamClient: SimpleMockTeamClient;
|
|
@@ -80,6 +80,16 @@ export interface RovoAgent {
|
|
|
80
80
|
icon?: string | null;
|
|
81
81
|
external_config_reference?: string;
|
|
82
82
|
}
|
|
83
|
+
export type RovoAgentAgg = {
|
|
84
|
+
authoringTeam: {
|
|
85
|
+
displayName: string | null | undefined;
|
|
86
|
+
profileUrl: string | null | undefined;
|
|
87
|
+
} | null | undefined;
|
|
88
|
+
};
|
|
89
|
+
export type RovoAgentCardClientResult = {
|
|
90
|
+
restData: RovoAgent;
|
|
91
|
+
aggData: RovoAgentAgg | null | undefined;
|
|
92
|
+
};
|
|
83
93
|
export interface RovoAgentCreatorInfo {
|
|
84
94
|
type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE';
|
|
85
95
|
name?: string;
|
|
@@ -491,7 +501,7 @@ export interface ProfileClient {
|
|
|
491
501
|
getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
|
|
492
502
|
shouldShowGiveKudos: () => Promise<boolean>;
|
|
493
503
|
getTeamCentralBaseUrl: (teamCentralScopes?: TeamCentralScopes) => Promise<string | undefined>;
|
|
494
|
-
getRovoAgentProfile: (id: AgentIdType, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<
|
|
504
|
+
getRovoAgentProfile: (id: AgentIdType, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<RovoAgentCardClientResult>;
|
|
495
505
|
getRovoAgentPermissions: (id: string, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<AgentPermissions>;
|
|
496
506
|
deleteAgent: (id: string, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<void>;
|
|
497
507
|
setFavouriteAgent: (id: string, isFavourite: boolean, fireAnalytics?: (event: AnalyticsEventPayload) => void, fireAnalyticsNext?: FireEventType) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.20.1",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/avatar": "^25.4.0",
|
|
46
46
|
"@atlaskit/avatar-group": "^12.3.0",
|
|
47
47
|
"@atlaskit/button": "^23.5.0",
|
|
48
|
-
"@atlaskit/css": "^0.
|
|
48
|
+
"@atlaskit/css": "^0.15.0",
|
|
49
49
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
50
50
|
"@atlaskit/empty-state": "^10.1.0",
|
|
51
51
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
@@ -61,19 +61,19 @@
|
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
62
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
63
63
|
"@atlaskit/popup": "^4.4.0",
|
|
64
|
-
"@atlaskit/primitives": "^
|
|
65
|
-
"@atlaskit/rovo-agent-components": "^3.
|
|
64
|
+
"@atlaskit/primitives": "^15.0.0",
|
|
65
|
+
"@atlaskit/rovo-agent-components": "^3.9.0",
|
|
66
66
|
"@atlaskit/rovo-triggers": "^3.13.0",
|
|
67
67
|
"@atlaskit/spinner": "^19.0.0",
|
|
68
68
|
"@atlaskit/teams-app-config": "^1.12.0",
|
|
69
|
-
"@atlaskit/teams-app-internal-analytics": "^1.
|
|
69
|
+
"@atlaskit/teams-app-internal-analytics": "^1.17.0",
|
|
70
70
|
"@atlaskit/teams-avatar": "^2.3.0",
|
|
71
71
|
"@atlaskit/teams-public": "^0.62.0",
|
|
72
72
|
"@atlaskit/theme": "^21.0.0",
|
|
73
|
-
"@atlaskit/tokens": "^
|
|
73
|
+
"@atlaskit/tokens": "^7.0.0",
|
|
74
74
|
"@atlaskit/tooltip": "^20.5.0",
|
|
75
75
|
"@babel/runtime": "^7.0.0",
|
|
76
|
-
"@compiled/react": "^0.18.
|
|
76
|
+
"@compiled/react": "^0.18.6",
|
|
77
77
|
"@emotion/react": "^11.7.1",
|
|
78
78
|
"@emotion/styled": "^11.0.0",
|
|
79
79
|
"date-fns": "^2.17.0",
|
|
@@ -173,6 +173,9 @@
|
|
|
173
173
|
},
|
|
174
174
|
"jira_ai_profilecard_hide_agent_actions": {
|
|
175
175
|
"type": "boolean"
|
|
176
|
+
},
|
|
177
|
+
"agent_studio_permissions_settings_m3_profiles": {
|
|
178
|
+
"type": "boolean"
|
|
176
179
|
}
|
|
177
180
|
},
|
|
178
181
|
"sideEffects": [
|