@atlaskit/profilecard 23.11.1 → 23.11.2
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 +8 -0
- package/dist/cjs/client/RovoAgentCardClient.js +10 -4
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/RovoAgentCardClient.js +8 -4
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/RovoAgentCardClient.js +10 -4
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/client/RovoAgentCardClient.d.ts +1 -0
- package/dist/types-ts4.5/client/RovoAgentCardClient.d.ts +1 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 23.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#154380](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154380)
|
|
8
|
+
[`d9b89b5a507e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d9b89b5a507e5) -
|
|
9
|
+
Migrate rovo endpoints away from assistant-service
|
|
10
|
+
|
|
3
11
|
## 23.11.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -13,6 +13,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
13
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _analytics = require("../util/analytics");
|
|
17
18
|
var _performance = require("../util/performance");
|
|
18
19
|
var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
|
|
@@ -42,12 +43,17 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
42
43
|
}
|
|
43
44
|
(0, _inherits2.default)(RovoAgentCardClient, _CachingClient);
|
|
44
45
|
return (0, _createClass2.default)(RovoAgentCardClient, [{
|
|
46
|
+
key: "basePath",
|
|
47
|
+
value: function basePath() {
|
|
48
|
+
return (0, _platformFeatureFlags.fg)('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
45
51
|
key: "makeRequest",
|
|
46
52
|
value: function makeRequest(id, cloudId) {
|
|
47
53
|
var product = this.options.productIdentifier || 'rovo';
|
|
48
54
|
var headers = createHeaders(product, this.options.cloudId);
|
|
49
55
|
if (id.type === 'identity') {
|
|
50
|
-
return fetch(new Request("/
|
|
56
|
+
return fetch(new Request("".concat(this.basePath(), "/accountid/").concat(id.value), {
|
|
51
57
|
method: 'GET',
|
|
52
58
|
credentials: 'include',
|
|
53
59
|
mode: 'cors',
|
|
@@ -56,7 +62,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
56
62
|
return response.json();
|
|
57
63
|
});
|
|
58
64
|
}
|
|
59
|
-
return fetch(new Request("/
|
|
65
|
+
return fetch(new Request("".concat(this.basePath(), "/").concat(id.value), {
|
|
60
66
|
method: 'GET',
|
|
61
67
|
credentials: 'include',
|
|
62
68
|
mode: 'cors',
|
|
@@ -121,7 +127,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
121
127
|
analytics((0, _analytics.agentRequestAnalytics)('triggered'));
|
|
122
128
|
}
|
|
123
129
|
var headers = createHeaders(product, _this3.options.cloudId);
|
|
124
|
-
fetch(new Request("/
|
|
130
|
+
fetch(new Request("".concat(_this3.basePath(), "/").concat(agentId), {
|
|
125
131
|
method: 'DELETE',
|
|
126
132
|
credentials: 'include',
|
|
127
133
|
mode: 'cors',
|
|
@@ -168,7 +174,7 @@ var RovoAgentCardClient = exports.default = /*#__PURE__*/function (_CachingClien
|
|
|
168
174
|
}
|
|
169
175
|
headers = createHeaders(product, _this4.options.cloudId);
|
|
170
176
|
_context.next = 8;
|
|
171
|
-
return fetch(new Request("/
|
|
177
|
+
return fetch(new Request("".concat(_this4.basePath(), "/").concat(agentId, "/favourite"), {
|
|
172
178
|
method: requestMethod,
|
|
173
179
|
credentials: 'include',
|
|
174
180
|
mode: 'cors',
|
|
@@ -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', "23.11.
|
|
14
|
+
headers.append('atl-client-version', "23.11.2");
|
|
15
15
|
return headers;
|
|
16
16
|
};
|
|
17
17
|
function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -66,7 +66,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
66
66
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
67
67
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
68
68
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
69
|
-
headers.append('atl-client-version', "23.11.
|
|
69
|
+
headers.append('atl-client-version', "23.11.2");
|
|
70
70
|
return headers;
|
|
71
71
|
};
|
|
72
72
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
45
45
|
actionSubjectId: actionSubjectId,
|
|
46
46
|
attributes: _objectSpread(_objectSpread({
|
|
47
47
|
packageName: "@atlaskit/profilecard",
|
|
48
|
-
packageVersion: "23.11.
|
|
48
|
+
packageVersion: "23.11.2"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { agentRequestAnalytics } from '../util/analytics';
|
|
2
3
|
import { getPageTime } from '../util/performance';
|
|
3
4
|
import CachingClient from './CachingClient';
|
|
@@ -18,18 +19,21 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
18
19
|
super(options);
|
|
19
20
|
this.options = options;
|
|
20
21
|
}
|
|
22
|
+
basePath() {
|
|
23
|
+
return fg('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
|
|
24
|
+
}
|
|
21
25
|
makeRequest(id, cloudId) {
|
|
22
26
|
const product = this.options.productIdentifier || 'rovo';
|
|
23
27
|
const headers = createHeaders(product, this.options.cloudId);
|
|
24
28
|
if (id.type === 'identity') {
|
|
25
|
-
return fetch(new Request(
|
|
29
|
+
return fetch(new Request(`${this.basePath()}/accountid/${id.value}`, {
|
|
26
30
|
method: 'GET',
|
|
27
31
|
credentials: 'include',
|
|
28
32
|
mode: 'cors',
|
|
29
33
|
headers
|
|
30
34
|
})).then(response => response.json());
|
|
31
35
|
}
|
|
32
|
-
return fetch(new Request(
|
|
36
|
+
return fetch(new Request(`${this.basePath()}/${id.value}`, {
|
|
33
37
|
method: 'GET',
|
|
34
38
|
credentials: 'include',
|
|
35
39
|
mode: 'cors',
|
|
@@ -86,7 +90,7 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
86
90
|
analytics(agentRequestAnalytics('triggered'));
|
|
87
91
|
}
|
|
88
92
|
const headers = createHeaders(product, this.options.cloudId);
|
|
89
|
-
fetch(new Request(
|
|
93
|
+
fetch(new Request(`${this.basePath()}/${agentId}`, {
|
|
90
94
|
method: 'DELETE',
|
|
91
95
|
credentials: 'include',
|
|
92
96
|
mode: 'cors',
|
|
@@ -124,7 +128,7 @@ export default class RovoAgentCardClient extends CachingClient {
|
|
|
124
128
|
analytics(agentRequestAnalytics('triggered', 'actionSubjectId'));
|
|
125
129
|
}
|
|
126
130
|
const headers = createHeaders(product, this.options.cloudId);
|
|
127
|
-
await fetch(new Request(
|
|
131
|
+
await fetch(new Request(`${this.basePath()}/${agentId}/favourite`, {
|
|
128
132
|
method: requestMethod,
|
|
129
133
|
credentials: 'include',
|
|
130
134
|
mode: 'cors',
|
|
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
|
|
|
6
6
|
}`;
|
|
7
7
|
const addHeaders = headers => {
|
|
8
8
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
9
|
-
headers.append('atl-client-version', "23.11.
|
|
9
|
+
headers.append('atl-client-version', "23.11.2");
|
|
10
10
|
return headers;
|
|
11
11
|
};
|
|
12
12
|
export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
|
|
@@ -75,7 +75,7 @@ export const addHeaders = headers => {
|
|
|
75
75
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
76
76
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
77
77
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
78
|
-
headers.append('atl-client-version', "23.11.
|
|
78
|
+
headers.append('atl-client-version', "23.11.2");
|
|
79
79
|
return headers;
|
|
80
80
|
};
|
|
81
81
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
32
32
|
actionSubjectId,
|
|
33
33
|
attributes: {
|
|
34
34
|
packageName: "@atlaskit/profilecard",
|
|
35
|
-
packageVersion: "23.11.
|
|
35
|
+
packageVersion: "23.11.2",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -10,6 +10,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
10
10
|
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) { _defineProperty(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; }
|
|
11
11
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { agentRequestAnalytics } from '../util/analytics';
|
|
14
15
|
import { getPageTime } from '../util/performance';
|
|
15
16
|
import CachingClient from './CachingClient';
|
|
@@ -35,12 +36,17 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
35
36
|
}
|
|
36
37
|
_inherits(RovoAgentCardClient, _CachingClient);
|
|
37
38
|
return _createClass(RovoAgentCardClient, [{
|
|
39
|
+
key: "basePath",
|
|
40
|
+
value: function basePath() {
|
|
41
|
+
return fg('pt-deprecate-assistance-service') ? '/gateway/api/assist/rovo/v1/agents' : '/gateway/api/assist/agents/v1';
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
38
44
|
key: "makeRequest",
|
|
39
45
|
value: function makeRequest(id, cloudId) {
|
|
40
46
|
var product = this.options.productIdentifier || 'rovo';
|
|
41
47
|
var headers = createHeaders(product, this.options.cloudId);
|
|
42
48
|
if (id.type === 'identity') {
|
|
43
|
-
return fetch(new Request("/
|
|
49
|
+
return fetch(new Request("".concat(this.basePath(), "/accountid/").concat(id.value), {
|
|
44
50
|
method: 'GET',
|
|
45
51
|
credentials: 'include',
|
|
46
52
|
mode: 'cors',
|
|
@@ -49,7 +55,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
49
55
|
return response.json();
|
|
50
56
|
});
|
|
51
57
|
}
|
|
52
|
-
return fetch(new Request("/
|
|
58
|
+
return fetch(new Request("".concat(this.basePath(), "/").concat(id.value), {
|
|
53
59
|
method: 'GET',
|
|
54
60
|
credentials: 'include',
|
|
55
61
|
mode: 'cors',
|
|
@@ -114,7 +120,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
114
120
|
analytics(agentRequestAnalytics('triggered'));
|
|
115
121
|
}
|
|
116
122
|
var headers = createHeaders(product, _this3.options.cloudId);
|
|
117
|
-
fetch(new Request("/
|
|
123
|
+
fetch(new Request("".concat(_this3.basePath(), "/").concat(agentId), {
|
|
118
124
|
method: 'DELETE',
|
|
119
125
|
credentials: 'include',
|
|
120
126
|
mode: 'cors',
|
|
@@ -161,7 +167,7 @@ var RovoAgentCardClient = /*#__PURE__*/function (_CachingClient) {
|
|
|
161
167
|
}
|
|
162
168
|
headers = createHeaders(product, _this4.options.cloudId);
|
|
163
169
|
_context.next = 8;
|
|
164
|
-
return fetch(new Request("/
|
|
170
|
+
return fetch(new Request("".concat(_this4.basePath(), "/").concat(agentId, "/favourite"), {
|
|
165
171
|
method: requestMethod,
|
|
166
172
|
credentials: 'include',
|
|
167
173
|
mode: 'cors',
|
|
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
|
|
|
4
4
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
5
5
|
var addHeaders = function addHeaders(headers) {
|
|
6
6
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
7
|
-
headers.append('atl-client-version', "23.11.
|
|
7
|
+
headers.append('atl-client-version', "23.11.2");
|
|
8
8
|
return headers;
|
|
9
9
|
};
|
|
10
10
|
export function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -57,7 +57,7 @@ export var 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', "23.11.
|
|
60
|
+
headers.append('atl-client-version', "23.11.2");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
39
39
|
actionSubjectId: actionSubjectId,
|
|
40
40
|
attributes: _objectSpread(_objectSpread({
|
|
41
41
|
packageName: "@atlaskit/profilecard",
|
|
42
|
-
packageVersion: "23.11.
|
|
42
|
+
packageVersion: "23.11.2"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
|
@@ -4,6 +4,7 @@ import CachingClient from './CachingClient';
|
|
|
4
4
|
export default class RovoAgentCardClient extends CachingClient<RovoAgent> {
|
|
5
5
|
options: ProfileClientOptions;
|
|
6
6
|
constructor(options: ProfileClientOptions);
|
|
7
|
+
private basePath;
|
|
7
8
|
makeRequest(id: AgentIdType, cloudId: string): Promise<RovoAgent>;
|
|
8
9
|
getProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void): Promise<RovoAgent>;
|
|
9
10
|
deleteAgent(agentId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<void>;
|
|
@@ -4,6 +4,7 @@ import CachingClient from './CachingClient';
|
|
|
4
4
|
export default class RovoAgentCardClient extends CachingClient<RovoAgent> {
|
|
5
5
|
options: ProfileClientOptions;
|
|
6
6
|
constructor(options: ProfileClientOptions);
|
|
7
|
+
private basePath;
|
|
7
8
|
makeRequest(id: AgentIdType, cloudId: string): Promise<RovoAgent>;
|
|
8
9
|
getProfile(id: AgentIdType, analytics?: (event: AnalyticsEventPayload) => void): Promise<RovoAgent>;
|
|
9
10
|
deleteAgent(agentId: string, analytics?: (event: AnalyticsEventPayload) => void): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "23.11.
|
|
3
|
+
"version": "23.11.2",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/avatar-group": "^12.0.0",
|
|
57
57
|
"@atlaskit/button": "^23.0.0",
|
|
58
58
|
"@atlaskit/css": "^0.10.0",
|
|
59
|
-
"@atlaskit/dropdown-menu": "^14.
|
|
59
|
+
"@atlaskit/dropdown-menu": "^14.2.0",
|
|
60
60
|
"@atlaskit/empty-state": "^10.0.0",
|
|
61
61
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
62
62
|
"@atlaskit/give-kudos": "^4.1.0",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@atlaskit/logo": "^18.0.0",
|
|
66
66
|
"@atlaskit/lozenge": "^12.2.0",
|
|
67
67
|
"@atlaskit/menu": "^5.0.0",
|
|
68
|
-
"@atlaskit/modal-dialog": "^14.
|
|
68
|
+
"@atlaskit/modal-dialog": "^14.2.0",
|
|
69
69
|
"@atlaskit/people-teams-ui-public": "^3.1.0",
|
|
70
70
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
71
|
-
"@atlaskit/popup": "^4.
|
|
71
|
+
"@atlaskit/popup": "^4.2.0",
|
|
72
72
|
"@atlaskit/primitives": "^14.7.0",
|
|
73
73
|
"@atlaskit/rovo-agent-components": "^2.8.0",
|
|
74
74
|
"@atlaskit/rovo-triggers": "^2.11.0",
|
|
@@ -165,6 +165,9 @@
|
|
|
165
165
|
},
|
|
166
166
|
"jfp-a11y-autodev-profile-card-name-heading": {
|
|
167
167
|
"type": "boolean"
|
|
168
|
+
},
|
|
169
|
+
"pt-deprecate-assistance-service": {
|
|
170
|
+
"type": "boolean"
|
|
168
171
|
}
|
|
169
172
|
},
|
|
170
173
|
"sideEffects": [
|