@atlaskit/profilecard 20.8.3 → 20.10.0
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 +19 -0
- package/afm-jira/tsconfig.json +83 -83
- package/afm-post-office/tsconfig.json +83 -83
- package/dist/cjs/client/ProfileCardClient.js +10 -4
- package/dist/cjs/client/RovoAgentCardClient.js +57 -12
- package/dist/cjs/client/UserProfileCardClient.js +6 -37
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/Actions.js +54 -11
- package/dist/cjs/components/Agent/AgentProfileCard.js +6 -1
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +5 -1
- package/dist/cjs/components/User/ProfileCardTrigger.js +1 -1
- package/dist/cjs/mocks/simple-mock-clients.js +2 -1
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/ProfileCardClient.js +8 -4
- package/dist/es2019/client/RovoAgentCardClient.js +48 -10
- package/dist/es2019/client/UserProfileCardClient.js +28 -69
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/Actions.js +33 -4
- package/dist/es2019/components/Agent/AgentProfileCard.js +5 -2
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +5 -1
- package/dist/es2019/components/User/ProfileCardTrigger.js +1 -1
- package/dist/es2019/mocks/simple-mock-clients.js +2 -1
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/ProfileCardClient.js +10 -4
- package/dist/esm/client/RovoAgentCardClient.js +57 -12
- package/dist/esm/client/UserProfileCardClient.js +6 -37
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/Actions.js +56 -13
- package/dist/esm/components/Agent/AgentProfileCard.js +6 -1
- package/dist/esm/components/Agent/hooks/useAgentActions.js +5 -1
- package/dist/esm/components/User/ProfileCardTrigger.js +1 -1
- package/dist/esm/mocks/simple-mock-clients.js +2 -1
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/client/ProfileCardClient.d.ts +1 -0
- package/dist/types/client/RovoAgentCardClient.d.ts +2 -1
- package/dist/types/client/UserProfileCardClient.d.ts +0 -12
- package/dist/types/components/Agent/Actions.d.ts +4 -2
- package/dist/types/components/Agent/hooks/useAgentActions.d.ts +1 -0
- package/dist/types/types.d.ts +8 -9
- package/dist/types-ts4.5/client/ProfileCardClient.d.ts +1 -0
- package/dist/types-ts4.5/client/RovoAgentCardClient.d.ts +2 -1
- package/dist/types-ts4.5/client/UserProfileCardClient.d.ts +0 -12
- package/dist/types-ts4.5/components/Agent/Actions.d.ts +4 -2
- package/dist/types-ts4.5/components/Agent/hooks/useAgentActions.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +8 -9
- package/package.json +9 -9
- package/.eslintrc +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 20.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#163699](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/163699)
|
|
8
|
+
[`f946e35c60150`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f946e35c60150) -
|
|
9
|
+
Refactor to use shared agent dropdown from @atlaskit/rovo-agent-components
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 20.9.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`2e6586eb695c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2e6586eb695c1) -
|
|
20
|
+
Clean up feature flag migrate_cloud_user_to_agg_user_query_profile_card
|
|
21
|
+
|
|
3
22
|
## 20.8.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.jira.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../tsDist/@atlaskit__profilecard/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*"
|
|
18
|
+
],
|
|
19
|
+
"references": [
|
|
20
|
+
{
|
|
21
|
+
"path": "../../../analytics/analytics-next/afm-jira/tsconfig.json"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"path": "../../../uip/atlassian-context/afm-jira/tsconfig.json"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "../../../design-system/avatar/afm-jira/tsconfig.json"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"path": "../../../design-system/avatar-group/afm-jira/tsconfig.json"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"path": "../../../design-system/button/afm-jira/tsconfig.json"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "../../../design-system/dropdown-menu/afm-jira/tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../design-system/empty-state/afm-jira/tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../../../design-system/focus-ring/afm-jira/tsconfig.json"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "../../../team-central/give-kudos/afm-jira/tsconfig.json"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"path": "../../../design-system/icon/afm-jira/tsconfig.json"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"path": "../../../design-system/lozenge/afm-jira/tsconfig.json"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"path": "../../../design-system/menu/afm-jira/tsconfig.json"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"path": "../../../design-system/modal-dialog/afm-jira/tsconfig.json"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"path": "../../../design-system/popup/afm-jira/tsconfig.json"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"path": "../../../design-system/primitives/afm-jira/tsconfig.json"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"path": "../../../ai-mate/rovo-agent-components/afm-jira/tsconfig.json"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"path": "../../../design-system/spinner/afm-jira/tsconfig.json"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"path": "../../../design-system/theme/afm-jira/tsconfig.json"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"path": "../../../design-system/tokens/afm-jira/tsconfig.json"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"path": "../../../design-system/tooltip/afm-jira/tsconfig.json"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
@@ -1,84 +1,84 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.post-office.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../tsDist/@atlaskit__profilecard/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*"
|
|
18
|
+
],
|
|
19
|
+
"references": [
|
|
20
|
+
{
|
|
21
|
+
"path": "../../../analytics/analytics-next/afm-post-office/tsconfig.json"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"path": "../../../uip/atlassian-context/afm-post-office/tsconfig.json"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "../../../design-system/avatar/afm-post-office/tsconfig.json"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"path": "../../../design-system/avatar-group/afm-post-office/tsconfig.json"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"path": "../../../design-system/button/afm-post-office/tsconfig.json"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "../../../design-system/dropdown-menu/afm-post-office/tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../design-system/empty-state/afm-post-office/tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../../../design-system/focus-ring/afm-post-office/tsconfig.json"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "../../../team-central/give-kudos/afm-post-office/tsconfig.json"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"path": "../../../design-system/icon/afm-post-office/tsconfig.json"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"path": "../../../design-system/lozenge/afm-post-office/tsconfig.json"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"path": "../../../design-system/menu/afm-post-office/tsconfig.json"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"path": "../../../design-system/modal-dialog/afm-post-office/tsconfig.json"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"path": "../../../design-system/popup/afm-post-office/tsconfig.json"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"path": "../../../design-system/primitives/afm-post-office/tsconfig.json"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"path": "../../../ai-mate/rovo-agent-components/afm-post-office/tsconfig.json"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"path": "../../../design-system/spinner/afm-post-office/tsconfig.json"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"path": "../../../design-system/theme/afm-post-office/tsconfig.json"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"path": "../../../design-system/tokens/afm-post-office/tsconfig.json"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"path": "../../../design-system/tooltip/afm-post-office/tsconfig.json"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
@@ -165,17 +165,23 @@ var ProfileCardClient = /*#__PURE__*/function () {
|
|
|
165
165
|
var _this$rovoAgentClient2;
|
|
166
166
|
return (_this$rovoAgentClient2 = this.rovoAgentClient) === null || _this$rovoAgentClient2 === void 0 ? void 0 : _this$rovoAgentClient2.getProfile(id, analytics);
|
|
167
167
|
}
|
|
168
|
+
}, {
|
|
169
|
+
key: "getRovoAgentPermissions",
|
|
170
|
+
value: function getRovoAgentPermissions(id, fireAnalytics) {
|
|
171
|
+
var _this$rovoAgentClient3;
|
|
172
|
+
return (_this$rovoAgentClient3 = this.rovoAgentClient) === null || _this$rovoAgentClient3 === void 0 ? void 0 : _this$rovoAgentClient3.getPermissions(id, fireAnalytics);
|
|
173
|
+
}
|
|
168
174
|
}, {
|
|
169
175
|
key: "deleteAgent",
|
|
170
176
|
value: function deleteAgent(id, analytics) {
|
|
171
|
-
var _this$
|
|
172
|
-
return (_this$
|
|
177
|
+
var _this$rovoAgentClient4;
|
|
178
|
+
return (_this$rovoAgentClient4 = this.rovoAgentClient) === null || _this$rovoAgentClient4 === void 0 ? void 0 : _this$rovoAgentClient4.deleteAgent(id, analytics);
|
|
173
179
|
}
|
|
174
180
|
}, {
|
|
175
181
|
key: "setFavouriteAgent",
|
|
176
182
|
value: function setFavouriteAgent(id, isFavourite, analytics) {
|
|
177
|
-
var _this$
|
|
178
|
-
return (_this$
|
|
183
|
+
var _this$rovoAgentClient5;
|
|
184
|
+
return (_this$rovoAgentClient5 = this.rovoAgentClient) === null || _this$rovoAgentClient5 === void 0 ? void 0 : _this$rovoAgentClient5.setFavouriteAgent(id, isFavourite, analytics);
|
|
179
185
|
}
|
|
180
186
|
}]);
|
|
181
187
|
return ProfileCardClient;
|
|
@@ -7,29 +7,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _analytics = require("../util/analytics");
|
|
17
17
|
var _performance = require("../util/performance");
|
|
18
18
|
var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
|
|
19
19
|
var _errorUtils = require("./errorUtils");
|
|
20
|
-
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
20
|
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; }
|
|
23
21
|
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; }
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
|
|
22
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
+
var createHeaders = function createHeaders(product, cloudId, isBodyJson) {
|
|
25
|
+
var headers = new Headers({
|
|
26
|
+
'X-Product': product,
|
|
27
|
+
'X-Experience-Id': 'profile-card',
|
|
28
|
+
'X-Cloudid': cloudId || ''
|
|
29
|
+
});
|
|
30
|
+
if (isBodyJson) {
|
|
31
|
+
headers.set('Content-Type', 'application/json');
|
|
32
|
+
}
|
|
33
|
+
return headers;
|
|
33
34
|
};
|
|
34
35
|
var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClient) {
|
|
35
36
|
(0, _inherits2.default)(RovoAgentCardClient, _CachingClient);
|
|
@@ -202,6 +203,50 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
202
203
|
};
|
|
203
204
|
}());
|
|
204
205
|
}
|
|
206
|
+
}, {
|
|
207
|
+
key: "getPermissions",
|
|
208
|
+
value: function getPermissions(id, fireAnalytics) {
|
|
209
|
+
var _this5 = this;
|
|
210
|
+
if (!this.options.cloudId) {
|
|
211
|
+
return Promise.reject(new Error('cloudId is missing'));
|
|
212
|
+
}
|
|
213
|
+
return new Promise(function (resolve, reject) {
|
|
214
|
+
var startTime = (0, _performance.getPageTime)();
|
|
215
|
+
var product = _this5.options.productIdentifier || 'rovo';
|
|
216
|
+
if (fireAnalytics) {
|
|
217
|
+
fireAnalytics((0, _analytics.agentRequestAnalytics)('triggered'));
|
|
218
|
+
}
|
|
219
|
+
var headers = createHeaders(product, _this5.options.cloudId, true);
|
|
220
|
+
fetch(new Request("/gateway/api/assist/api/rovo/v2/permissions/agents/".concat(id), {
|
|
221
|
+
method: 'POST',
|
|
222
|
+
credentials: 'include',
|
|
223
|
+
mode: 'cors',
|
|
224
|
+
headers: headers,
|
|
225
|
+
body: JSON.stringify({
|
|
226
|
+
permission_ids: ['AGENT_CREATE', 'AGENT_UPDATE', 'AGENT_DELETE', 'AGENT_DEACTIVATE', 'AGENT_READ']
|
|
227
|
+
})
|
|
228
|
+
})).then(function (response) {
|
|
229
|
+
return response.json();
|
|
230
|
+
}).then(function (data) {
|
|
231
|
+
if (fireAnalytics) {
|
|
232
|
+
fireAnalytics((0, _analytics.agentRequestAnalytics)('succeeded', 'getAgentPermissions', {
|
|
233
|
+
duration: (0, _performance.getPageTime)() - startTime,
|
|
234
|
+
gateway: true
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
resolve(data);
|
|
238
|
+
}).catch(function (error) {
|
|
239
|
+
if (fireAnalytics) {
|
|
240
|
+
fireAnalytics((0, _analytics.agentRequestAnalytics)('failed', 'getAgentPermissions', _objectSpread(_objectSpread({
|
|
241
|
+
duration: (0, _performance.getPageTime)() - startTime
|
|
242
|
+
}, (0, _errorUtils.getErrorAttributes)(error)), {}, {
|
|
243
|
+
gateway: true
|
|
244
|
+
})));
|
|
245
|
+
}
|
|
246
|
+
reject(error);
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
}
|
|
205
250
|
}]);
|
|
206
251
|
return RovoAgentCardClient;
|
|
207
252
|
}(_CachingClient2.default);
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.modifyResponse = exports.default = exports.
|
|
7
|
+
exports.modifyResponse = exports.default = exports.buildAggUserQuery = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -13,7 +13,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _analytics = require("../util/analytics");
|
|
18
17
|
var _date = require("../util/date");
|
|
19
18
|
var _performance = require("../util/performance");
|
|
@@ -54,21 +53,6 @@ var modifyResponse = exports.modifyResponse = function modifyResponse(response)
|
|
|
54
53
|
accountType: data.accountType || undefined
|
|
55
54
|
};
|
|
56
55
|
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @param {string} userId
|
|
60
|
-
* @param {string} cloudId
|
|
61
|
-
* @return {string} GraphQL Query String
|
|
62
|
-
*/
|
|
63
|
-
var buildUserQuery = exports.buildUserQuery = function buildUserQuery(cloudId, userId) {
|
|
64
|
-
return {
|
|
65
|
-
query: "query User($userId: String!, $cloudId: String!) {\n User: CloudUser(userId: $userId, cloudId: $cloudId) {\n id\n isCurrentUser\n status\n statusModifiedDate\n isBot\n isNotMentionable\n fullName\n nickname\n email\n meta: title\n location\n companyName\n avatarUrl(size: 192)\n remoteWeekdayIndex: localTime(format: \"d\")\n remoteWeekdayString: localTime(format: \"ddd\")\n remoteTimeString: localTime(format: \"h:mma\")\n }\n }",
|
|
66
|
-
variables: {
|
|
67
|
-
cloudId: cloudId,
|
|
68
|
-
userId: userId
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
56
|
var buildAggUserQuery = exports.buildAggUserQuery = function buildAggUserQuery(userId) {
|
|
73
57
|
return {
|
|
74
58
|
query: "query user($userId: ID!) {\n\t\tuser(accountId: $userId) {\n\t\t\tid\n\t\t\tname\n\t\t\tpicture\n\t\t\taccountStatus\n\t\t\t__typename\n\t\t\t... on AtlassianAccountUser {\n\t\t\t\temail\n\t\t\t\tnickname\n\t\t\t\tzoneinfo\n\t\t\t\textendedProfile {\n\t\t\t\t\tjobTitle\n\t\t\t\t\torganization\n\t\t\t\t\tlocation\n\t\t\t\t\tclosedDate\n\t\t\t\t\tinactiveDate\n\t\t\t\t}\n\t\t\t}\n\t\t\t... on CustomerUser {\n\t\t\t\temail\n\t\t\t\tzoneinfo\n\t\t\t}\n\t\t\t... on AppUser {\n \t\t\tappType\n \t\t}\n\t\t}\n\t}",
|
|
@@ -114,16 +98,14 @@ var UserProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
|
|
|
114
98
|
key: "makeRequest",
|
|
115
99
|
value: function () {
|
|
116
100
|
var _makeRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(cloudId, userId) {
|
|
117
|
-
var _user$extendedProfile, _user$extendedProfile2, _user$extendedProfile3, _user$extendedProfile4, _user$extendedProfile5
|
|
101
|
+
var _user$extendedProfile, _user$extendedProfile2, _user$extendedProfile3, _user$extendedProfile4, _user$extendedProfile5;
|
|
102
|
+
var gatewayGraphqlUrl, urlWithOperationName, userQueryPromise, user, timestring, localWeekdayIndex;
|
|
118
103
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
119
104
|
while (1) switch (_context2.prev = _context2.next) {
|
|
120
105
|
case 0:
|
|
121
|
-
if (!(0, _platformFeatureFlags.fg)('migrate_cloud_user_to_agg_user_query_profile_card')) {
|
|
122
|
-
_context2.next = 11;
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
106
|
gatewayGraphqlUrl = this.options.gatewayGraphqlUrl || '/gateway/api/graphql';
|
|
126
|
-
|
|
107
|
+
urlWithOperationName = "".concat(gatewayGraphqlUrl, "?operationName=aggUserQuery");
|
|
108
|
+
userQueryPromise = queryAGGUser(urlWithOperationName, userId);
|
|
127
109
|
_context2.next = 5;
|
|
128
110
|
return userQueryPromise;
|
|
129
111
|
case 5:
|
|
@@ -150,20 +132,7 @@ var UserProfileCardClient = exports.default = /*#__PURE__*/function (_CachingCli
|
|
|
150
132
|
companyName: (_user$extendedProfile5 = user.extendedProfile) === null || _user$extendedProfile5 === void 0 ? void 0 : _user$extendedProfile5.organization,
|
|
151
133
|
timestring: timestring
|
|
152
134
|
}));
|
|
153
|
-
case
|
|
154
|
-
if (this.options.url) {
|
|
155
|
-
_context2.next = 13;
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
throw new Error('options.url is a required parameter');
|
|
159
|
-
case 13:
|
|
160
|
-
query = buildUserQuery(cloudId, userId);
|
|
161
|
-
_context2.next = 16;
|
|
162
|
-
return (0, _graphqlUtils.directoryGraphqlQuery)(this.options.url, query);
|
|
163
|
-
case 16:
|
|
164
|
-
response = _context2.sent;
|
|
165
|
-
return _context2.abrupt("return", modifyResponse(response));
|
|
166
|
-
case 18:
|
|
135
|
+
case 9:
|
|
167
136
|
case "end":
|
|
168
137
|
return _context2.stop();
|
|
169
138
|
}
|
|
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
|
|
|
11
11
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
12
12
|
var addHeaders = function addHeaders(headers) {
|
|
13
13
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
14
|
-
headers.append('atl-client-version', "20.
|
|
14
|
+
headers.append('atl-client-version', "20.10.0");
|
|
15
15
|
return headers;
|
|
16
16
|
};
|
|
17
17
|
function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -57,7 +57,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
57
57
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
58
58
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
59
59
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
60
|
-
headers.append('atl-client-version', "20.
|
|
60
|
+
headers.append('atl-client-version', "20.10.0");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|