@atlaskit/profilecard 25.7.4 → 25.7.6

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/client/ProfileCardClient.js +27 -26
  3. package/dist/cjs/client/RovoAgentCardClient.js +19 -19
  4. package/dist/cjs/client/TeamCentralCardClient.js +27 -26
  5. package/dist/cjs/client/UserProfileCardClient.js +8 -8
  6. package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +12 -12
  7. package/dist/cjs/client/getTeamFromAGG.js +5 -5
  8. package/dist/cjs/client/graphqlUtils.js +12 -12
  9. package/dist/cjs/components/Agent/Actions.js +4 -4
  10. package/dist/cjs/components/Agent/AgentDeleteConfirmationModal.js +5 -5
  11. package/dist/cjs/components/Agent/AgentProfileCard.js +28 -27
  12. package/dist/cjs/components/Agent/AgentProfileCardResourced.js +28 -28
  13. package/dist/cjs/components/Agent/AgentProfileCardTrigger.js +32 -32
  14. package/dist/cjs/components/Agent/hooks/duplicateFetch.js +36 -36
  15. package/dist/cjs/components/Agent/hooks/useAgentActions.js +14 -14
  16. package/dist/cjs/components/User/ProfileCardTrigger.js +16 -16
  17. package/dist/cjs/components/common/ProfileCardTrigger.js +2 -2
  18. package/dist/cjs/util/analytics.js +2 -2
  19. package/dist/cjs/util/useProfileInfo.js +11 -11
  20. package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
  21. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  22. package/dist/es2019/components/User/ProfileCardTrigger.js +1 -1
  23. package/dist/es2019/util/analytics.js +2 -2
  24. package/dist/esm/client/ProfileCardClient.js +27 -26
  25. package/dist/esm/client/RovoAgentCardClient.js +19 -19
  26. package/dist/esm/client/TeamCentralCardClient.js +27 -26
  27. package/dist/esm/client/UserProfileCardClient.js +8 -8
  28. package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +12 -12
  29. package/dist/esm/client/getTeamFromAGG.js +5 -5
  30. package/dist/esm/client/graphqlUtils.js +12 -12
  31. package/dist/esm/components/Agent/Actions.js +4 -4
  32. package/dist/esm/components/Agent/AgentDeleteConfirmationModal.js +5 -5
  33. package/dist/esm/components/Agent/AgentProfileCard.js +27 -26
  34. package/dist/esm/components/Agent/AgentProfileCardResourced.js +27 -27
  35. package/dist/esm/components/Agent/AgentProfileCardTrigger.js +31 -31
  36. package/dist/esm/components/Agent/hooks/duplicateFetch.js +36 -36
  37. package/dist/esm/components/Agent/hooks/useAgentActions.js +14 -14
  38. package/dist/esm/components/User/ProfileCardTrigger.js +15 -15
  39. package/dist/esm/components/common/ProfileCardTrigger.js +2 -2
  40. package/dist/esm/util/analytics.js +2 -2
  41. package/dist/esm/util/useProfileInfo.js +11 -11
  42. package/package.json +6 -9
@@ -34,7 +34,7 @@ var _AgentProfileCardWrapper = require("./AgentProfileCardWrapper");
34
34
  var _ConversationStarters = require("./ConversationStarters");
35
35
  var _useAgentActions = require("./hooks/useAgentActions");
36
36
  var _messages = require("./messages");
37
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
37
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
38
38
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
39
39
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
40
40
  var styles = {
@@ -100,49 +100,50 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
100
100
  setStarCount(agent === null || agent === void 0 ? void 0 : agent.favourite_count);
101
101
  }, [agent === null || agent === void 0 ? void 0 : agent.favourite, agent === null || agent === void 0 ? void 0 : agent.favourite_count]);
102
102
  var handleSetFavourite = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
103
- return _regenerator.default.wrap(function _callee$(_context) {
103
+ var _t;
104
+ return _regenerator.default.wrap(function (_context) {
104
105
  while (1) switch (_context.prev = _context.next) {
105
106
  case 0:
106
107
  if (!(agent !== null && agent !== void 0 && agent.id)) {
107
- _context.next = 10;
108
+ _context.next = 4;
108
109
  break;
109
110
  }
110
111
  _context.prev = 1;
111
- _context.next = 4;
112
+ _context.next = 2;
112
113
  return resourceClient.setFavouriteAgent(agent.id, !isStarred, fireEvent);
113
- case 4:
114
+ case 2:
114
115
  if (isStarred) {
115
116
  setStarCount(starCount ? starCount - 1 : 0);
116
117
  } else {
117
118
  setStarCount((starCount || 0) + 1);
118
119
  }
119
120
  setIsStarred(!isStarred);
120
- _context.next = 10;
121
+ _context.next = 4;
121
122
  break;
122
- case 8:
123
- _context.prev = 8;
124
- _context.t0 = _context["catch"](1);
125
- case 10:
123
+ case 3:
124
+ _context.prev = 3;
125
+ _t = _context["catch"](1);
126
+ case 4:
126
127
  case "end":
127
128
  return _context.stop();
128
129
  }
129
- }, _callee, null, [[1, 8]]);
130
+ }, _callee, null, [[1, 3]]);
130
131
  })), [agent === null || agent === void 0 ? void 0 : agent.id, fireEvent, isStarred, resourceClient, starCount]);
131
132
  var handleOnDelete = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
132
- var _onDeleteAgent, restore;
133
- return _regenerator.default.wrap(function _callee2$(_context2) {
133
+ var _onDeleteAgent, restore, _t2;
134
+ return _regenerator.default.wrap(function (_context2) {
134
135
  while (1) switch (_context2.prev = _context2.next) {
135
136
  case 0:
136
137
  if (!(agent && onDeleteAgent)) {
137
- _context2.next = 12;
138
+ _context2.next = 4;
138
139
  break;
139
140
  }
140
141
  // Optimistically remove from cache
141
142
  _onDeleteAgent = onDeleteAgent(agent.id), restore = _onDeleteAgent.restore;
142
- _context2.prev = 2;
143
- _context2.next = 5;
143
+ _context2.prev = 1;
144
+ _context2.next = 2;
144
145
  return resourceClient.deleteAgent(agent.id, fireEvent);
145
- case 5:
146
+ case 2:
146
147
  addFlag === null || addFlag === void 0 || addFlag({
147
148
  title: formatMessage(_messages.messages.agentDeletedSuccessFlagTitle),
148
149
  description: formatMessage(_messages.messages.agentDeletedSuccessFlagDescription, {
@@ -151,11 +152,11 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
151
152
  type: 'success',
152
153
  id: 'ptc-directory.agent-profile.delete-agent-success'
153
154
  });
154
- _context2.next = 12;
155
+ _context2.next = 4;
155
156
  break;
156
- case 8:
157
- _context2.prev = 8;
158
- _context2.t0 = _context2["catch"](2);
157
+ case 3:
158
+ _context2.prev = 3;
159
+ _t2 = _context2["catch"](1);
159
160
  // Restore agent to cache on error
160
161
  restore();
161
162
  addFlag === null || addFlag === void 0 || addFlag({
@@ -164,11 +165,11 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
164
165
  type: 'error',
165
166
  id: 'ptc-directory.agent-profile.delete-agent-error'
166
167
  });
167
- case 12:
168
+ case 4:
168
169
  case "end":
169
170
  return _context2.stop();
170
171
  }
171
- }, _callee2, null, [[2, 8]]);
172
+ }, _callee2, null, [[1, 3]]);
172
173
  })), [addFlag, agent, formatMessage, onDeleteAgent, resourceClient, fireEvent]);
173
174
  (0, _react.useEffect)(function () {
174
175
  if (!isLoading && agent) {
@@ -280,14 +281,14 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
280
281
  return _onCopyAgent(agent.id);
281
282
  },
282
283
  onDuplicateAgent: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
283
- return _regenerator.default.wrap(function _callee3$(_context3) {
284
+ return _regenerator.default.wrap(function (_context3) {
284
285
  while (1) switch (_context3.prev = _context3.next) {
285
286
  case 0:
286
- _context3.next = 2;
287
+ _context3.next = 1;
287
288
  return onDuplicateAgent(agent.id);
288
- case 2:
289
+ case 1:
289
290
  return _context3.abrupt("return", _context3.sent);
290
- case 3:
291
+ case 2:
291
292
  case "end":
292
293
  return _context3.stop();
293
294
  }
@@ -19,7 +19,7 @@ var _rovoAgentUtils = require("../../util/rovoAgentUtils");
19
19
  var _ErrorMessage = _interopRequireDefault(require("../Error/ErrorMessage"));
20
20
  var _AgentProfileCardWrapper = require("./AgentProfileCardWrapper");
21
21
  var _lazyAgentProfileCard = require("./lazyAgentProfileCard");
22
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
23
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
25
  var AgentProfileCardResourced = exports.AgentProfileCardResourced = function AgentProfileCardResourced(props) {
@@ -52,20 +52,20 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
52
52
  var profileHref = navResult.href;
53
53
  var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
54
54
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
55
- var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, currentCreatorUserId, creatorInfo;
56
- return _regenerator.default.wrap(function _callee$(_context) {
55
+ var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, currentCreatorUserId, creatorInfo, _t;
56
+ return _regenerator.default.wrap(function (_context) {
57
57
  while (1) switch (_context.prev = _context.next) {
58
58
  case 0:
59
59
  creator_type = _ref.creator_type, creator = _ref.creator, authoringTeam = _ref.authoringTeam;
60
60
  _context.prev = 1;
61
61
  currentCreatorUserId = (0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing') ? creator_type === 'CUSTOMER' && creator ? (0, _rovoAgentUtils.getAAIDFromARI)(creator) : undefined : creatorUserId;
62
62
  if (!(currentCreatorUserId && props.cloudId)) {
63
- _context.next = 8;
63
+ _context.next = 3;
64
64
  break;
65
65
  }
66
- _context.next = 6;
66
+ _context.next = 2;
67
67
  return props.resourceClient.getProfile(props.cloudId, currentCreatorUserId, fireEvent);
68
- case 6:
68
+ case 2:
69
69
  userCreatorInfo = _context.sent;
70
70
  if ((0, _platformFeatureFlags.fg)('jira_ai_fix_agent_profile_card_flashing')) {
71
71
  profileHref = (0, _navigation.navigateToTeamsApp)({
@@ -76,7 +76,7 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
76
76
  cloudId: props.cloudId
77
77
  }).href;
78
78
  }
79
- case 8:
79
+ case 3:
80
80
  creatorInfo = (0, _AgentProfileInfo.getAgentCreator)({
81
81
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
82
82
  authoringTeam: authoringTeam ? {
@@ -90,33 +90,33 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
90
90
  forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
91
91
  });
92
92
  return _context.abrupt("return", creatorInfo);
93
- case 12:
94
- _context.prev = 12;
95
- _context.t0 = _context["catch"](1);
93
+ case 4:
94
+ _context.prev = 4;
95
+ _t = _context["catch"](1);
96
96
  return _context.abrupt("return", undefined);
97
- case 15:
97
+ case 5:
98
98
  case "end":
99
99
  return _context.stop();
100
100
  }
101
- }, _callee, null, [[1, 12]]);
101
+ }, _callee, null, [[1, 4]]);
102
102
  }));
103
103
  return function (_x) {
104
104
  return _ref2.apply(this, arguments);
105
105
  };
106
106
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
107
107
  var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
108
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo;
109
- return _regenerator.default.wrap(function _callee2$(_context2) {
108
+ var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo, _t2;
109
+ return _regenerator.default.wrap(function (_context2) {
110
110
  while (1) switch (_context2.prev = _context2.next) {
111
111
  case 0:
112
112
  setIsLoading(true);
113
113
  _context2.prev = 1;
114
- _context2.next = 4;
114
+ _context2.next = 2;
115
115
  return props.resourceClient.getRovoAgentProfile({
116
116
  type: 'identity',
117
117
  value: props.accountId
118
118
  }, fireEvent);
119
- case 4:
119
+ case 2:
120
120
  profileResult = _context2.sent;
121
121
  profileData = profileResult.restData;
122
122
  creatorInfoProps = {
@@ -124,28 +124,28 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
124
124
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
125
125
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
126
126
  };
127
- _context2.next = 9;
127
+ _context2.next = 3;
128
128
  return getCreator(creatorInfoProps);
129
- case 9:
129
+ case 3:
130
130
  agentCreatorInfo = _context2.sent;
131
131
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
132
132
  creatorInfo: agentCreatorInfo
133
133
  }));
134
- _context2.next = 16;
134
+ _context2.next = 5;
135
135
  break;
136
- case 13:
137
- _context2.prev = 13;
138
- _context2.t0 = _context2["catch"](1);
139
- setError(_context2.t0);
140
- case 16:
141
- _context2.prev = 16;
136
+ case 4:
137
+ _context2.prev = 4;
138
+ _t2 = _context2["catch"](1);
139
+ setError(_t2);
140
+ case 5:
141
+ _context2.prev = 5;
142
142
  setIsLoading(false);
143
- return _context2.finish(16);
144
- case 19:
143
+ return _context2.finish(5);
144
+ case 6:
145
145
  case "end":
146
146
  return _context2.stop();
147
147
  }
148
- }, _callee2, null, [[1, 13, 16, 19]]);
148
+ }, _callee2, null, [[1, 4, 5, 6]]);
149
149
  })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
150
150
 
151
151
  // Depend on accountId rather than fetchData to avoid a re-fetch loop:
@@ -19,7 +19,7 @@ var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics
19
19
  var _rovoAgentUtils = require("../../util/rovoAgentUtils");
20
20
  var _ProfileCardTrigger = _interopRequireDefault(require("../common/ProfileCardTrigger"));
21
21
  var _lazyAgentProfileCard = require("./lazyAgentProfileCard");
22
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
23
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
25
  var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
@@ -38,54 +38,54 @@ var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = /*#__PURE__*/(0,
38
38
  */
39
39
  var getCreator = /*#__PURE__*/function () {
40
40
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref2) {
41
- var creator_type, creator, authoringTeam, _userId, _authoringTeam$displa, _authoringTeam$profil, _navigateToTeamsApp, profileHref, creatorInfo;
42
- return _regenerator.default.wrap(function _callee$(_context) {
41
+ var creator_type, creator, authoringTeam, _userId, _authoringTeam$displa, _authoringTeam$profil, _navigateToTeamsApp, profileHref, creatorInfo, _t, _t2;
42
+ return _regenerator.default.wrap(function (_context) {
43
43
  while (1) switch (_context.prev = _context.next) {
44
44
  case 0:
45
45
  creator_type = _ref2.creator_type, creator = _ref2.creator, authoringTeam = _ref2.authoringTeam;
46
46
  if (creator) {
47
- _context.next = 3;
47
+ _context.next = 1;
48
48
  break;
49
49
  }
50
50
  return _context.abrupt("return", undefined);
51
- case 3:
51
+ case 1:
52
52
  if (!((0, _isForgeAgent.isForgeAgentByCreatorType)(creator_type) && (0, _platformFeatureFlags.fg)('rovo_agent_support_a2a_avatar'))) {
53
- _context.next = 5;
53
+ _context.next = 2;
54
54
  break;
55
55
  }
56
56
  return _context.abrupt("return", {
57
57
  type: 'THIRD_PARTY',
58
58
  name: creator !== null && creator !== void 0 ? creator : ''
59
59
  });
60
- case 5:
61
- _context.t0 = creator_type;
62
- _context.next = _context.t0 === 'SYSTEM' ? 8 : _context.t0 === 'THIRD_PARTY' ? 9 : _context.t0 === 'FORGE' ? 10 : _context.t0 === 'CUSTOMER' ? 11 : 27;
60
+ case 2:
61
+ _t = creator_type;
62
+ _context.next = _t === 'SYSTEM' ? 3 : _t === 'THIRD_PARTY' ? 4 : _t === 'FORGE' ? 5 : _t === 'CUSTOMER' ? 6 : 12;
63
63
  break;
64
- case 8:
64
+ case 3:
65
65
  return _context.abrupt("return", {
66
66
  type: 'SYSTEM'
67
67
  });
68
- case 9:
68
+ case 4:
69
69
  return _context.abrupt("return", {
70
70
  type: 'THIRD_PARTY',
71
71
  name: creator !== null && creator !== void 0 ? creator : ''
72
72
  });
73
- case 10:
73
+ case 5:
74
74
  return _context.abrupt("return", {
75
75
  type: 'THIRD_PARTY',
76
76
  name: creator !== null && creator !== void 0 ? creator : ''
77
77
  });
78
- case 11:
78
+ case 6:
79
79
  _userId = (0, _rovoAgentUtils.getAAIDFromARI)(creator) || '';
80
- _context.prev = 12;
80
+ _context.prev = 7;
81
81
  if (!(!_userId || !cloudId)) {
82
- _context.next = 15;
82
+ _context.next = 8;
83
83
  break;
84
84
  }
85
85
  return _context.abrupt("return", undefined);
86
- case 15:
86
+ case 8:
87
87
  if (!authoringTeam) {
88
- _context.next = 17;
88
+ _context.next = 9;
89
89
  break;
90
90
  }
91
91
  return _context.abrupt("return", {
@@ -93,7 +93,7 @@ var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = /*#__PURE__*/(0,
93
93
  name: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
94
94
  profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : ''
95
95
  });
96
- case 17:
96
+ case 9:
97
97
  _navigateToTeamsApp = (0, _navigation.navigateToTeamsApp)({
98
98
  type: 'USER',
99
99
  payload: {
@@ -101,9 +101,9 @@ var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = /*#__PURE__*/(0,
101
101
  },
102
102
  cloudId: cloudId
103
103
  }), profileHref = _navigateToTeamsApp.href;
104
- _context.next = 20;
104
+ _context.next = 10;
105
105
  return props.resourceClient.getProfile(cloudId, _userId, fireEvent);
106
- case 20:
106
+ case 10:
107
107
  creatorInfo = _context.sent;
108
108
  return _context.abrupt("return", {
109
109
  type: 'CUSTOMER',
@@ -111,17 +111,17 @@ var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = /*#__PURE__*/(0,
111
111
  profileLink: (0, _platformFeatureFlags.fg)('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(_userId),
112
112
  id: _userId
113
113
  });
114
- case 24:
115
- _context.prev = 24;
116
- _context.t1 = _context["catch"](12);
114
+ case 11:
115
+ _context.prev = 11;
116
+ _t2 = _context["catch"](7);
117
117
  return _context.abrupt("return", undefined);
118
- case 27:
118
+ case 12:
119
119
  return _context.abrupt("return", undefined);
120
- case 28:
120
+ case 13:
121
121
  case "end":
122
122
  return _context.stop();
123
123
  }
124
- }, _callee, null, [[12, 24]]);
124
+ }, _callee, null, [[7, 11]]);
125
125
  }));
126
126
  return function getCreator(_x) {
127
127
  return _ref3.apply(this, arguments);
@@ -131,29 +131,29 @@ var AgentProfileCardTrigger = exports.AgentProfileCardTrigger = /*#__PURE__*/(0,
131
131
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
132
132
  var _agentProfileResult$a, _agentProfileResult$a2;
133
133
  var agentProfileResult, agentInfo, agentCreatorInfo;
134
- return _regenerator.default.wrap(function _callee2$(_context2) {
134
+ return _regenerator.default.wrap(function (_context2) {
135
135
  while (1) switch (_context2.prev = _context2.next) {
136
136
  case 0:
137
- _context2.next = 2;
137
+ _context2.next = 1;
138
138
  return resourceClient.getRovoAgentProfile({
139
139
  type: agentIdType,
140
140
  value: userId
141
141
  }, fireEvent);
142
- case 2:
142
+ case 1:
143
143
  agentProfileResult = _context2.sent;
144
144
  agentInfo = agentProfileResult.restData;
145
- _context2.next = 6;
145
+ _context2.next = 2;
146
146
  return getCreator({
147
147
  creator_type: agentInfo.creator_type,
148
148
  creator: agentInfo.creator || undefined,
149
149
  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
150
150
  });
151
- case 6:
151
+ case 2:
152
152
  agentCreatorInfo = _context2.sent;
153
153
  return _context2.abrupt("return", _objectSpread(_objectSpread({}, agentInfo), {}, {
154
154
  creatorInfo: agentCreatorInfo
155
155
  }));
156
- case 8:
156
+ case 3:
157
157
  case "end":
158
158
  return _context2.stop();
159
159
  }
@@ -18,12 +18,12 @@ var GRAPHQL_ENDPOINT = '/gateway/api/graphql';
18
18
  */
19
19
  var fetchHasVersionCapability = exports.fetchHasVersionCapability = /*#__PURE__*/function () {
20
20
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(cloudId) {
21
- var _json$data, response, json, result;
22
- return _regenerator.default.wrap(function _callee$(_context) {
21
+ var _json$data, response, json, result, _t;
22
+ return _regenerator.default.wrap(function (_context) {
23
23
  while (1) switch (_context.prev = _context.next) {
24
24
  case 0:
25
25
  _context.prev = 0;
26
- _context.next = 3;
26
+ _context.next = 1;
27
27
  return fetch(GRAPHQL_ENDPOINT, {
28
28
  method: 'POST',
29
29
  credentials: 'include',
@@ -37,23 +37,23 @@ var fetchHasVersionCapability = exports.fetchHasVersionCapability = /*#__PURE__*
37
37
  }
38
38
  })
39
39
  });
40
- case 3:
40
+ case 1:
41
41
  response = _context.sent;
42
- _context.next = 6;
42
+ _context.next = 2;
43
43
  return response.json();
44
- case 6:
44
+ case 2:
45
45
  json = _context.sent;
46
46
  result = json === null || json === void 0 || (_json$data = json.data) === null || _json$data === void 0 ? void 0 : _json$data.agentStudio_hasVersionCapability;
47
47
  return _context.abrupt("return", (result === null || result === void 0 ? void 0 : result.__typename) === 'AgentStudioHasVersionCapability' ? Boolean(result.hasVersionCapability) : false);
48
- case 11:
49
- _context.prev = 11;
50
- _context.t0 = _context["catch"](0);
48
+ case 3:
49
+ _context.prev = 3;
50
+ _t = _context["catch"](0);
51
51
  return _context.abrupt("return", false);
52
- case 14:
52
+ case 4:
53
53
  case "end":
54
54
  return _context.stop();
55
55
  }
56
- }, _callee, null, [[0, 11]]);
56
+ }, _callee, null, [[0, 3]]);
57
57
  }));
58
58
  return function fetchHasVersionCapability(_x) {
59
59
  return _ref.apply(this, arguments);
@@ -66,12 +66,12 @@ var fetchHasVersionCapability = exports.fetchHasVersionCapability = /*#__PURE__*
66
66
  */
67
67
  var fetchActivationId = exports.fetchActivationId = /*#__PURE__*/function () {
68
68
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(cloudId) {
69
- var _json$data$tenantCont, _json$data2, response, json;
70
- return _regenerator.default.wrap(function _callee2$(_context2) {
69
+ var _json$data$tenantCont, _json$data2, response, json, _t2;
70
+ return _regenerator.default.wrap(function (_context2) {
71
71
  while (1) switch (_context2.prev = _context2.next) {
72
72
  case 0:
73
73
  _context2.prev = 0;
74
- _context2.next = 3;
74
+ _context2.next = 1;
75
75
  return fetch(GRAPHQL_ENDPOINT, {
76
76
  method: 'POST',
77
77
  credentials: 'include',
@@ -86,22 +86,22 @@ var fetchActivationId = exports.fetchActivationId = /*#__PURE__*/function () {
86
86
  }
87
87
  })
88
88
  });
89
- case 3:
89
+ case 1:
90
90
  response = _context2.sent;
91
- _context2.next = 6;
91
+ _context2.next = 2;
92
92
  return response.json();
93
- case 6:
93
+ case 2:
94
94
  json = _context2.sent;
95
95
  return _context2.abrupt("return", (_json$data$tenantCont = json === null || json === void 0 || (_json$data2 = json.data) === null || _json$data2 === void 0 || (_json$data2 = _json$data2.tenantContexts) === null || _json$data2 === void 0 || (_json$data2 = _json$data2[0]) === null || _json$data2 === void 0 || (_json$data2 = _json$data2.activationIdByProduct) === null || _json$data2 === void 0 ? void 0 : _json$data2.active) !== null && _json$data$tenantCont !== void 0 ? _json$data$tenantCont : null);
96
- case 10:
97
- _context2.prev = 10;
98
- _context2.t0 = _context2["catch"](0);
96
+ case 3:
97
+ _context2.prev = 3;
98
+ _t2 = _context2["catch"](0);
99
99
  return _context2.abrupt("return", null);
100
- case 13:
100
+ case 4:
101
101
  case "end":
102
102
  return _context2.stop();
103
103
  }
104
- }, _callee2, null, [[0, 10]]);
104
+ }, _callee2, null, [[0, 3]]);
105
105
  }));
106
106
  return function fetchActivationId(_x2) {
107
107
  return _ref2.apply(this, arguments);
@@ -116,12 +116,12 @@ var fetchActivationId = exports.fetchActivationId = /*#__PURE__*/function () {
116
116
  */
117
117
  var fetchDuplicateAgentMutation = exports.fetchDuplicateAgentMutation = /*#__PURE__*/function () {
118
118
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(agentAri) {
119
- var _json$data3, _result$agent, _result$errors$0$mess, _result$errors, response, json, result;
120
- return _regenerator.default.wrap(function _callee3$(_context3) {
119
+ var _json$data3, _result$agent, _result$errors$0$mess, _result$errors, response, json, result, _t3;
120
+ return _regenerator.default.wrap(function (_context3) {
121
121
  while (1) switch (_context3.prev = _context3.next) {
122
122
  case 0:
123
123
  _context3.prev = 0;
124
- _context3.next = 3;
124
+ _context3.next = 1;
125
125
  return fetch(GRAPHQL_ENDPOINT, {
126
126
  method: 'POST',
127
127
  credentials: 'include',
@@ -135,38 +135,38 @@ var fetchDuplicateAgentMutation = exports.fetchDuplicateAgentMutation = /*#__PUR
135
135
  }
136
136
  })
137
137
  });
138
- case 3:
138
+ case 1:
139
139
  response = _context3.sent;
140
- _context3.next = 6;
140
+ _context3.next = 2;
141
141
  return response.json();
142
- case 6:
142
+ case 2:
143
143
  json = _context3.sent;
144
144
  result = json === null || json === void 0 || (_json$data3 = json.data) === null || _json$data3 === void 0 ? void 0 : _json$data3.agentStudio_duplicateAgent;
145
145
  if (!(result !== null && result !== void 0 && result.success && result !== null && result !== void 0 && (_result$agent = result.agent) !== null && _result$agent !== void 0 && _result$agent.id)) {
146
- _context3.next = 10;
146
+ _context3.next = 3;
147
147
  break;
148
148
  }
149
149
  return _context3.abrupt("return", {
150
150
  success: true,
151
151
  newAgentAri: result.agent.id
152
152
  });
153
- case 10:
153
+ case 3:
154
154
  return _context3.abrupt("return", {
155
155
  success: false,
156
156
  errorMessage: (_result$errors$0$mess = result === null || result === void 0 || (_result$errors = result.errors) === null || _result$errors === void 0 || (_result$errors = _result$errors[0]) === null || _result$errors === void 0 ? void 0 : _result$errors.message) !== null && _result$errors$0$mess !== void 0 ? _result$errors$0$mess : 'Duplicate agent mutation failed'
157
157
  });
158
- case 13:
159
- _context3.prev = 13;
160
- _context3.t0 = _context3["catch"](0);
158
+ case 4:
159
+ _context3.prev = 4;
160
+ _t3 = _context3["catch"](0);
161
161
  return _context3.abrupt("return", {
162
162
  success: false,
163
- errorMessage: _context3.t0 instanceof Error ? _context3.t0.message : 'Network error during duplication'
163
+ errorMessage: _t3 instanceof Error ? _t3.message : 'Network error during duplication'
164
164
  });
165
- case 16:
165
+ case 5:
166
166
  case "end":
167
167
  return _context3.stop();
168
168
  }
169
- }, _callee3, null, [[0, 13]]);
169
+ }, _callee3, null, [[0, 4]]);
170
170
  }));
171
171
  return function fetchDuplicateAgentMutation(_x3) {
172
172
  return _ref3.apply(this, arguments);