@atlaskit/teams-public 0.65.3 → 0.65.4
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/controllers/hooks/use-team-containers/index.js +5 -6
- package/dist/es2019/controllers/hooks/use-team-containers/index.js +6 -7
- package/dist/esm/controllers/hooks/use-team-containers/index.js +6 -7
- package/dist/types/controllers/hooks/use-team-containers/index.d.ts +1 -2
- package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +1 -2
- package/package.json +10 -12
- package/dist/cjs/services/agg-client/index.js +0 -254
- package/dist/cjs/services/agg-client/mocks/index.js +0 -177
- package/dist/cjs/services/agg-client/types.js +0 -1
- package/dist/cjs/services/agg-client/utils/mutations/unlink-container-mutation.js +0 -12
- package/dist/cjs/services/agg-client/utils/queries/number-of-team-connected-to-container-query.js +0 -12
- package/dist/cjs/services/agg-client/utils/queries/team-connected-to-container-query.js +0 -12
- package/dist/cjs/services/agg-client/utils/queries/team-containers-query.js +0 -15
- package/dist/cjs/services/agg-client/utils/query-context-headers.js +0 -18
- package/dist/cjs/services/base-client/index.js +0 -92
- package/dist/cjs/services/constants.js +0 -9
- package/dist/cjs/services/graphql-client/index.js +0 -12
- package/dist/cjs/services/graphql-client/main.js +0 -95
- package/dist/cjs/services/graphql-client/types.js +0 -5
- package/dist/cjs/services/graphql-client/utils/index.js +0 -160
- package/dist/cjs/services/index.js +0 -18
- package/dist/cjs/services/main.js +0 -148
- package/dist/cjs/services/types.js +0 -5
- package/dist/es2019/services/agg-client/index.js +0 -153
- package/dist/es2019/services/agg-client/mocks/index.js +0 -171
- package/dist/es2019/services/agg-client/types.js +0 -0
- package/dist/es2019/services/agg-client/utils/mutations/unlink-container-mutation.js +0 -20
- package/dist/es2019/services/agg-client/utils/queries/number-of-team-connected-to-container-query.js +0 -14
- package/dist/es2019/services/agg-client/utils/queries/team-connected-to-container-query.js +0 -55
- package/dist/es2019/services/agg-client/utils/queries/team-containers-query.js +0 -56
- package/dist/es2019/services/agg-client/utils/query-context-headers.js +0 -12
- package/dist/es2019/services/base-client/index.js +0 -64
- package/dist/es2019/services/constants.js +0 -3
- package/dist/es2019/services/graphql-client/index.js +0 -1
- package/dist/es2019/services/graphql-client/main.js +0 -47
- package/dist/es2019/services/graphql-client/types.js +0 -1
- package/dist/es2019/services/graphql-client/utils/index.js +0 -77
- package/dist/es2019/services/index.js +0 -1
- package/dist/es2019/services/main.js +0 -67
- package/dist/es2019/services/types.js +0 -1
- package/dist/esm/services/agg-client/index.js +0 -247
- package/dist/esm/services/agg-client/mocks/index.js +0 -171
- package/dist/esm/services/agg-client/types.js +0 -0
- package/dist/esm/services/agg-client/utils/mutations/unlink-container-mutation.js +0 -5
- package/dist/esm/services/agg-client/utils/queries/number-of-team-connected-to-container-query.js +0 -5
- package/dist/esm/services/agg-client/utils/queries/team-connected-to-container-query.js +0 -5
- package/dist/esm/services/agg-client/utils/queries/team-containers-query.js +0 -8
- package/dist/esm/services/agg-client/utils/query-context-headers.js +0 -12
- package/dist/esm/services/base-client/index.js +0 -85
- package/dist/esm/services/constants.js +0 -3
- package/dist/esm/services/graphql-client/index.js +0 -1
- package/dist/esm/services/graphql-client/main.js +0 -88
- package/dist/esm/services/graphql-client/types.js +0 -1
- package/dist/esm/services/graphql-client/utils/index.js +0 -152
- package/dist/esm/services/index.js +0 -1
- package/dist/esm/services/main.js +0 -141
- package/dist/esm/services/types.js +0 -1
- package/dist/types/services/agg-client/index.d.ts +0 -14
- package/dist/types/services/agg-client/mocks/index.d.ts +0 -180
- package/dist/types/services/agg-client/types.d.ts +0 -4
- package/dist/types/services/agg-client/utils/mutations/unlink-container-mutation.d.ts +0 -18
- package/dist/types/services/agg-client/utils/queries/number-of-team-connected-to-container-query.d.ts +0 -11
- package/dist/types/services/agg-client/utils/queries/team-connected-to-container-query.d.ts +0 -45
- package/dist/types/services/agg-client/utils/queries/team-containers-query.d.ts +0 -71
- package/dist/types/services/agg-client/utils/query-context-headers.d.ts +0 -5
- package/dist/types/services/base-client/index.d.ts +0 -37
- package/dist/types/services/constants.d.ts +0 -4
- package/dist/types/services/graphql-client/index.d.ts +0 -1
- package/dist/types/services/graphql-client/main.d.ts +0 -12
- package/dist/types/services/graphql-client/types.d.ts +0 -20
- package/dist/types/services/graphql-client/utils/index.d.ts +0 -3
- package/dist/types/services/index.d.ts +0 -1
- package/dist/types/services/main.d.ts +0 -46
- package/dist/types/services/types.d.ts +0 -37
- package/dist/types-ts4.5/services/agg-client/index.d.ts +0 -14
- package/dist/types-ts4.5/services/agg-client/mocks/index.d.ts +0 -180
- package/dist/types-ts4.5/services/agg-client/types.d.ts +0 -4
- package/dist/types-ts4.5/services/agg-client/utils/mutations/unlink-container-mutation.d.ts +0 -18
- package/dist/types-ts4.5/services/agg-client/utils/queries/number-of-team-connected-to-container-query.d.ts +0 -11
- package/dist/types-ts4.5/services/agg-client/utils/queries/team-connected-to-container-query.d.ts +0 -45
- package/dist/types-ts4.5/services/agg-client/utils/queries/team-containers-query.d.ts +0 -71
- package/dist/types-ts4.5/services/agg-client/utils/query-context-headers.d.ts +0 -5
- package/dist/types-ts4.5/services/base-client/index.d.ts +0 -37
- package/dist/types-ts4.5/services/constants.d.ts +0 -4
- package/dist/types-ts4.5/services/graphql-client/index.d.ts +0 -1
- package/dist/types-ts4.5/services/graphql-client/main.d.ts +0 -12
- package/dist/types-ts4.5/services/graphql-client/types.d.ts +0 -20
- package/dist/types-ts4.5/services/graphql-client/utils/index.d.ts +0 -3
- package/dist/types-ts4.5/services/index.d.ts +0 -1
- package/dist/types-ts4.5/services/main.d.ts +0 -46
- package/dist/types-ts4.5/services/types.d.ts +0 -37
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.teamsClient = exports.TeamsClient = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
var _aggClient = require("./agg-client");
|
|
14
|
-
var TeamsClient = exports.TeamsClient = /*#__PURE__*/function () {
|
|
15
|
-
function TeamsClient(
|
|
16
|
-
/**
|
|
17
|
-
* @param {ClientContextProps} context - Context including CloudId & OrgId to be used for all requests
|
|
18
|
-
*/
|
|
19
|
-
context) {
|
|
20
|
-
(0, _classCallCheck2.default)(this, TeamsClient);
|
|
21
|
-
(0, _defineProperty2.default)(this, "_aggClient", _aggClient.aggClient);
|
|
22
|
-
if (context) {
|
|
23
|
-
this.setContext(context);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Sets the base URL to be used in the client requests
|
|
29
|
-
* @param {string} baseUrl - The new base URL
|
|
30
|
-
*/
|
|
31
|
-
return (0, _createClass2.default)(TeamsClient, [{
|
|
32
|
-
key: "setBaseUrl",
|
|
33
|
-
value: function setBaseUrl(baseUrl) {
|
|
34
|
-
this._aggClient.setBaseUrl(baseUrl);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Sets context including CloudId & OrgId to be used for all requests
|
|
39
|
-
*/
|
|
40
|
-
}, {
|
|
41
|
-
key: "setContext",
|
|
42
|
-
value: function setContext(context) {
|
|
43
|
-
this._aggClient.setContext(context);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Get the containers for a given team
|
|
48
|
-
* @param {string} teamId
|
|
49
|
-
* @returns {Promise<TeamContainers>}
|
|
50
|
-
*/
|
|
51
|
-
}, {
|
|
52
|
-
key: "getTeamContainers",
|
|
53
|
-
value: (function () {
|
|
54
|
-
var _getTeamContainers = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(teamId) {
|
|
55
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
56
|
-
while (1) switch (_context.prev = _context.next) {
|
|
57
|
-
case 0:
|
|
58
|
-
return _context.abrupt("return", this._aggClient.getTeamContainers(teamId));
|
|
59
|
-
case 1:
|
|
60
|
-
case "end":
|
|
61
|
-
return _context.stop();
|
|
62
|
-
}
|
|
63
|
-
}, _callee, this);
|
|
64
|
-
}));
|
|
65
|
-
function getTeamContainers(_x) {
|
|
66
|
-
return _getTeamContainers.apply(this, arguments);
|
|
67
|
-
}
|
|
68
|
-
return getTeamContainers;
|
|
69
|
-
}()
|
|
70
|
-
/**
|
|
71
|
-
* Get the number of teams connected to a container (Confluence space or Jira project)
|
|
72
|
-
* @param {string} containerId
|
|
73
|
-
* @returns {Promise}
|
|
74
|
-
*/
|
|
75
|
-
)
|
|
76
|
-
}, {
|
|
77
|
-
key: "getNumberOfConnectedTeams",
|
|
78
|
-
value: (function () {
|
|
79
|
-
var _getNumberOfConnectedTeams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(containerId) {
|
|
80
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
81
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
82
|
-
case 0:
|
|
83
|
-
return _context2.abrupt("return", this._aggClient.queryNumberOfTeamConnectedToContainer(containerId));
|
|
84
|
-
case 1:
|
|
85
|
-
case "end":
|
|
86
|
-
return _context2.stop();
|
|
87
|
-
}
|
|
88
|
-
}, _callee2, this);
|
|
89
|
-
}));
|
|
90
|
-
function getNumberOfConnectedTeams(_x2) {
|
|
91
|
-
return _getNumberOfConnectedTeams.apply(this, arguments);
|
|
92
|
-
}
|
|
93
|
-
return getNumberOfConnectedTeams;
|
|
94
|
-
}()
|
|
95
|
-
/**
|
|
96
|
-
* Get teams connected to a container (Confluence space or Jira project)
|
|
97
|
-
* @param {string} containerId
|
|
98
|
-
* @returns {Promise}
|
|
99
|
-
*/
|
|
100
|
-
)
|
|
101
|
-
}, {
|
|
102
|
-
key: "getConnectedTeams",
|
|
103
|
-
value: (function () {
|
|
104
|
-
var _getConnectedTeams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(containerId) {
|
|
105
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
106
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
107
|
-
case 0:
|
|
108
|
-
return _context3.abrupt("return", this._aggClient.queryTeamsConnectedToContainer(containerId));
|
|
109
|
-
case 1:
|
|
110
|
-
case "end":
|
|
111
|
-
return _context3.stop();
|
|
112
|
-
}
|
|
113
|
-
}, _callee3, this);
|
|
114
|
-
}));
|
|
115
|
-
function getConnectedTeams(_x3) {
|
|
116
|
-
return _getConnectedTeams.apply(this, arguments);
|
|
117
|
-
}
|
|
118
|
-
return getConnectedTeams;
|
|
119
|
-
}()
|
|
120
|
-
/**
|
|
121
|
-
* Unlink a container from a team
|
|
122
|
-
* @param {string} teamId
|
|
123
|
-
* @param {string} containerId
|
|
124
|
-
* @returns {Promise<void>}
|
|
125
|
-
*/
|
|
126
|
-
)
|
|
127
|
-
}, {
|
|
128
|
-
key: "unlinkTeamContainer",
|
|
129
|
-
value: (function () {
|
|
130
|
-
var _unlinkTeamContainer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(teamId, containerId) {
|
|
131
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
132
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
133
|
-
case 0:
|
|
134
|
-
return _context4.abrupt("return", this._aggClient.unlinkTeamContainer(teamId, containerId));
|
|
135
|
-
case 1:
|
|
136
|
-
case "end":
|
|
137
|
-
return _context4.stop();
|
|
138
|
-
}
|
|
139
|
-
}, _callee4, this);
|
|
140
|
-
}));
|
|
141
|
-
function unlinkTeamContainer(_x4, _x5) {
|
|
142
|
-
return _unlinkTeamContainer.apply(this, arguments);
|
|
143
|
-
}
|
|
144
|
-
return unlinkTeamContainer;
|
|
145
|
-
}())
|
|
146
|
-
}]);
|
|
147
|
-
}();
|
|
148
|
-
var teamsClient = exports.teamsClient = new TeamsClient();
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { teamIdToAri } from '../../common/utils/team-id-to-ari';
|
|
2
|
-
import { toUserId } from '../../common/utils/user-ari';
|
|
3
|
-
import { DEFAULT_CONFIG } from '../constants';
|
|
4
|
-
import { BaseGraphQlClient } from '../graphql-client';
|
|
5
|
-
import { UnlinkContainerMutation } from './utils/mutations/unlink-container-mutation';
|
|
6
|
-
import { NumberOfTeamConnectedToContainerQuery } from './utils/queries/number-of-team-connected-to-container-query';
|
|
7
|
-
import { TeamConnectedToContainerQuery } from './utils/queries/team-connected-to-container-query';
|
|
8
|
-
import { TeamContainersQueryV2 } from './utils/queries/team-containers-query';
|
|
9
|
-
export class AGGClient extends BaseGraphQlClient {
|
|
10
|
-
constructor(baseUrl, config) {
|
|
11
|
-
super(`${baseUrl}/graphql`, config);
|
|
12
|
-
}
|
|
13
|
-
setBaseUrl(baseUrl) {
|
|
14
|
-
this.setServiceUrl(`${baseUrl}/graphql`);
|
|
15
|
-
}
|
|
16
|
-
async getTeamContainers(teamId) {
|
|
17
|
-
const teamAri = teamIdToAri(teamId);
|
|
18
|
-
const cypherQuery = `MATCH (team:IdentityTeam {ari: '${teamAri}'})-[:team_connected_to_container]->(container) RETURN container`;
|
|
19
|
-
const response = await this.makeGraphQLRequest({
|
|
20
|
-
query: TeamContainersQueryV2,
|
|
21
|
-
variables: {
|
|
22
|
-
cypherQuery,
|
|
23
|
-
params: {
|
|
24
|
-
id: teamAri
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}, {
|
|
28
|
-
operationName: 'TeamContainersQueryV2'
|
|
29
|
-
});
|
|
30
|
-
return this.processResponse(response);
|
|
31
|
-
}
|
|
32
|
-
processResponse(response) {
|
|
33
|
-
const containersResult = response.graphStore.cypherQueryV2.edges.reduce((containers, edge) => {
|
|
34
|
-
edge.node.columns.forEach(column => {
|
|
35
|
-
var _column$value;
|
|
36
|
-
const containerData = (_column$value = column.value) === null || _column$value === void 0 ? void 0 : _column$value.data;
|
|
37
|
-
if (!containerData) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if ((containerData === null || containerData === void 0 ? void 0 : containerData.__typename) === 'ConfluenceSpace') {
|
|
41
|
-
containers.push({
|
|
42
|
-
id: containerData.id,
|
|
43
|
-
type: containerData.__typename,
|
|
44
|
-
name: containerData.confluenceSpaceName || '',
|
|
45
|
-
icon: `${containerData.links.base}${containerData.icon.path}`,
|
|
46
|
-
createdDate: new Date(containerData.createdDate),
|
|
47
|
-
link: `${containerData.links.base}${containerData.links.webUi}`,
|
|
48
|
-
containerTypeProperties: {
|
|
49
|
-
subType: undefined,
|
|
50
|
-
name: undefined
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
} else if ((containerData === null || containerData === void 0 ? void 0 : containerData.__typename) === 'JiraProject') {
|
|
54
|
-
containers.push({
|
|
55
|
-
id: containerData.id,
|
|
56
|
-
type: containerData.__typename,
|
|
57
|
-
name: containerData.jiraProjectName,
|
|
58
|
-
icon: containerData.avatar.medium,
|
|
59
|
-
createdDate: new Date(containerData.created),
|
|
60
|
-
link: containerData.webUrl,
|
|
61
|
-
containerTypeProperties: {
|
|
62
|
-
subType: containerData.projectType || '',
|
|
63
|
-
name: containerData.projectTypeName || ''
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
} else if ((containerData === null || containerData === void 0 ? void 0 : containerData.__typename) === 'LoomSpace') {
|
|
67
|
-
containers.push({
|
|
68
|
-
id: containerData.id,
|
|
69
|
-
type: containerData.__typename,
|
|
70
|
-
name: containerData.loomSpaceName,
|
|
71
|
-
icon: '',
|
|
72
|
-
link: containerData.url
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return containers;
|
|
77
|
-
}, []);
|
|
78
|
-
return containersResult;
|
|
79
|
-
}
|
|
80
|
-
async unlinkTeamContainer(teamId, containerId) {
|
|
81
|
-
const teamAri = teamIdToAri(teamId);
|
|
82
|
-
const response = await this.makeGraphQLRequest({
|
|
83
|
-
query: UnlinkContainerMutation,
|
|
84
|
-
variables: {
|
|
85
|
-
containerId,
|
|
86
|
-
teamId: teamAri
|
|
87
|
-
}
|
|
88
|
-
}, {
|
|
89
|
-
operationName: 'UnlinkContainerMutation'
|
|
90
|
-
});
|
|
91
|
-
return response.graphStore;
|
|
92
|
-
}
|
|
93
|
-
async queryNumberOfTeamConnectedToContainer(containerId) {
|
|
94
|
-
var _response$graphStore, _response$graphStore$, _response$graphStore$2;
|
|
95
|
-
const response = await this.makeGraphQLRequest({
|
|
96
|
-
query: NumberOfTeamConnectedToContainerQuery,
|
|
97
|
-
variables: {
|
|
98
|
-
containerId
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
operationName: 'NumberOfTeamConnectedToContainerQuery'
|
|
102
|
-
});
|
|
103
|
-
return response === null || response === void 0 ? void 0 : (_response$graphStore = response.graphStore) === null || _response$graphStore === void 0 ? void 0 : (_response$graphStore$ = _response$graphStore.teamConnectedToContainerInverse) === null || _response$graphStore$ === void 0 ? void 0 : (_response$graphStore$2 = _response$graphStore$.edges) === null || _response$graphStore$2 === void 0 ? void 0 : _response$graphStore$2.length;
|
|
104
|
-
}
|
|
105
|
-
async queryTeamsConnectedToContainer(containerId) {
|
|
106
|
-
var _response$graphStore2, _response$graphStore3, _response$graphStore4;
|
|
107
|
-
const response = await this.makeGraphQLRequest({
|
|
108
|
-
query: TeamConnectedToContainerQuery,
|
|
109
|
-
variables: {
|
|
110
|
-
containerId
|
|
111
|
-
}
|
|
112
|
-
}, {
|
|
113
|
-
operationName: 'TeamConnectedToContainerQuery'
|
|
114
|
-
});
|
|
115
|
-
return response === null || response === void 0 ? void 0 : (_response$graphStore2 = response.graphStore) === null || _response$graphStore2 === void 0 ? void 0 : (_response$graphStore3 = _response$graphStore2.teamConnectedToContainerInverse) === null || _response$graphStore3 === void 0 ? void 0 : (_response$graphStore4 = _response$graphStore3.edges) === null || _response$graphStore4 === void 0 ? void 0 : _response$graphStore4.map(({
|
|
116
|
-
node
|
|
117
|
-
}) => {
|
|
118
|
-
var _node$creator, _node$members$nodes$m, _node$members, _node$members$nodes$l, _node$members2;
|
|
119
|
-
return {
|
|
120
|
-
id: node.id,
|
|
121
|
-
displayName: node.displayName,
|
|
122
|
-
description: node.description,
|
|
123
|
-
state: node.state,
|
|
124
|
-
membershipSettings: node.membershipSettings,
|
|
125
|
-
organizationId: node.organizationId,
|
|
126
|
-
creatorId: (_node$creator = node.creator) === null || _node$creator === void 0 ? void 0 : _node$creator.id,
|
|
127
|
-
isVerified: node.isVerified,
|
|
128
|
-
members: (_node$members$nodes$m = (_node$members = node.members) === null || _node$members === void 0 ? void 0 : _node$members.nodes.map(({
|
|
129
|
-
member
|
|
130
|
-
}) => {
|
|
131
|
-
var _member$name;
|
|
132
|
-
return {
|
|
133
|
-
id: member !== null && member !== void 0 && member.id ? toUserId(member === null || member === void 0 ? void 0 : member.id) : '',
|
|
134
|
-
fullName: (_member$name = member === null || member === void 0 ? void 0 : member.name) !== null && _member$name !== void 0 ? _member$name : '',
|
|
135
|
-
avatarUrl: member === null || member === void 0 ? void 0 : member.picture,
|
|
136
|
-
status: member === null || member === void 0 ? void 0 : member.accountStatus
|
|
137
|
-
};
|
|
138
|
-
})) !== null && _node$members$nodes$m !== void 0 ? _node$members$nodes$m : [],
|
|
139
|
-
includesYou: false,
|
|
140
|
-
// to-do - this needs to be computed - https://product-fabric.atlassian.net/browse/CCECO-4368
|
|
141
|
-
memberCount: (_node$members$nodes$l = (_node$members2 = node.members) === null || _node$members2 === void 0 ? void 0 : _node$members2.nodes.length) !== null && _node$members$nodes$l !== void 0 ? _node$members$nodes$l : 0,
|
|
142
|
-
largeAvatarImageUrl: node.largeAvatarImageUrl,
|
|
143
|
-
smallAvatarImageUrl: node.smallAvatarImageUrl,
|
|
144
|
-
largeHeaderImageUrl: node.largeHeaderImageUrl,
|
|
145
|
-
smallHeaderImageUrl: node.smallHeaderImageUrl,
|
|
146
|
-
restriction: 'ORG_MEMBERS' // to-do - figure out if this should be optional (it's deprecated) - https://product-fabric.atlassian.net/browse/CCECO-4368
|
|
147
|
-
};
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
export const aggClient = new AGGClient(DEFAULT_CONFIG.stargateRoot, {
|
|
152
|
-
logException: () => {}
|
|
153
|
-
});
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
export const MOCK_TEAM_CONTAINERS = {
|
|
2
|
-
graphStore: {
|
|
3
|
-
cypherQuery: {
|
|
4
|
-
edges: [{
|
|
5
|
-
node: {
|
|
6
|
-
from: {
|
|
7
|
-
id: '1'
|
|
8
|
-
},
|
|
9
|
-
to: {
|
|
10
|
-
id: '2',
|
|
11
|
-
data: {
|
|
12
|
-
__typename: 'ConfluenceSpace',
|
|
13
|
-
confluenceSpaceName: 'Confluence Space',
|
|
14
|
-
type: 'confluence',
|
|
15
|
-
createdDate: '2021-01-01',
|
|
16
|
-
links: {
|
|
17
|
-
base: 'https://example.com',
|
|
18
|
-
webUi: 'web-link'
|
|
19
|
-
},
|
|
20
|
-
icon: {
|
|
21
|
-
path: 'https://avatar-management--avatars.us-west-2.staging.public.atl-paas.net/712020:2981defd-17f1-440e-a377-8c7657b72a6f/4b5b0d55-614b-4e75-858f-9da3d0c7e3f8/128'
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}, {
|
|
27
|
-
node: {
|
|
28
|
-
from: {
|
|
29
|
-
id: '1'
|
|
30
|
-
},
|
|
31
|
-
to: {
|
|
32
|
-
id: '3',
|
|
33
|
-
data: {
|
|
34
|
-
__typename: 'JiraProject',
|
|
35
|
-
jiraProjectName: 'Jira Project',
|
|
36
|
-
webUrl: 'web-link',
|
|
37
|
-
created: '2021-01-01',
|
|
38
|
-
avatar: {
|
|
39
|
-
medium: 'https://avatar-management--avatars.us-west-2.staging.public.atl-paas.net/712020:2981defd-17f1-440e-a377-8c7657b72a6f/4b5b0d55-614b-4e75-858f-9da3d0c7e3f8/128'
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
export const MOCK_TEAM_CONTAINERSV2 = {
|
|
49
|
-
graphStore: {
|
|
50
|
-
cypherQueryV2: {
|
|
51
|
-
edges: [{
|
|
52
|
-
node: {
|
|
53
|
-
columns: [{
|
|
54
|
-
key: 'container',
|
|
55
|
-
value: {
|
|
56
|
-
data: {
|
|
57
|
-
__typename: 'ConfluenceSpace',
|
|
58
|
-
id: '2',
|
|
59
|
-
confluenceSpaceName: 'Confluence Space',
|
|
60
|
-
type: 'confluence',
|
|
61
|
-
createdDate: '2021-01-01',
|
|
62
|
-
links: {
|
|
63
|
-
base: 'https://example.com',
|
|
64
|
-
webUi: '/wiki/spaces/SPACE'
|
|
65
|
-
},
|
|
66
|
-
icon: {
|
|
67
|
-
path: '/wiki/download/attachments/123/icon.png'
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}]
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
node: {
|
|
75
|
-
columns: [{
|
|
76
|
-
key: 'container',
|
|
77
|
-
value: {
|
|
78
|
-
data: {
|
|
79
|
-
__typename: 'JiraProject',
|
|
80
|
-
id: '3',
|
|
81
|
-
jiraProjectName: 'Jira Project',
|
|
82
|
-
webUrl: 'https://example.com/jira/project',
|
|
83
|
-
created: '2021-01-01',
|
|
84
|
-
avatar: {
|
|
85
|
-
medium: 'https://avatar-management--avatars.us-west-2.staging.public.atl-paas.net/712020:2981defd-17f1-440e-a377-8c7657b72a6f/4b5b0d55-614b-4e75-858f-9da3d0c7e3f8/128'
|
|
86
|
-
},
|
|
87
|
-
projectType: 'software',
|
|
88
|
-
projectTypeName: 'Software Project'
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}]
|
|
92
|
-
}
|
|
93
|
-
}]
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
export const MOCK_NUMBER_OF_CONNECTED_TEAMS = {
|
|
98
|
-
graphStore: {
|
|
99
|
-
teamConnectedToContainerInverse: {
|
|
100
|
-
edges: [{
|
|
101
|
-
id: 'ari:cloud:identity::team/8ee37950-7de7-41ec-aee2-2c02c95949f4'
|
|
102
|
-
}]
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
export const MOCK_CONNECTED_TEAMS = {
|
|
107
|
-
graphStore: {
|
|
108
|
-
teamConnectedToContainerInverse: {
|
|
109
|
-
edges: [{
|
|
110
|
-
node: {
|
|
111
|
-
id: 'ari:cloud:identity::team/8ee37950-7de7-41ec-aee2-2c02c95949f4',
|
|
112
|
-
description: "Super team's super description",
|
|
113
|
-
displayName: 'THE SUPER TEAM',
|
|
114
|
-
smallAvatarImageUrl: 'https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/teams/avatars/0.svg',
|
|
115
|
-
smallHeaderImageUrl: 'https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/gradients/0.svg',
|
|
116
|
-
largeAvatarImageUrl: 'https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/teams/avatars/0.svg',
|
|
117
|
-
largeHeaderImageUrl: 'https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/gradients/0.svg',
|
|
118
|
-
members: {
|
|
119
|
-
nodes: [{
|
|
120
|
-
role: 'ADMIN',
|
|
121
|
-
state: 'FULL_MEMBER',
|
|
122
|
-
member: {
|
|
123
|
-
name: 'Shrutha Kashyap',
|
|
124
|
-
picture: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/70121:c17bdf1f-39db-4611-a700-2f8c1aff841e/cf4058fd-75f2-4824-8041-c8efa4cc0ea8/128',
|
|
125
|
-
accountStatus: 'active',
|
|
126
|
-
extendedProfile: {
|
|
127
|
-
jobTitle: 'Full Stack Software Engineer'
|
|
128
|
-
},
|
|
129
|
-
id: 'ari:cloud:identity::user/70121:c17bdf1f-39db-4611-a700-2f8c1aff841e'
|
|
130
|
-
}
|
|
131
|
-
}],
|
|
132
|
-
pageInfo: {
|
|
133
|
-
endCursor: null,
|
|
134
|
-
hasNextPage: false
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
organizationId: 'ari:cloud:platform::org/434kbc65-c30c-1a22-6933-d25085c532ca',
|
|
138
|
-
membershipSettings: 'MEMBER_INVITE',
|
|
139
|
-
isVerified: false,
|
|
140
|
-
state: 'ACTIVE',
|
|
141
|
-
creator: {
|
|
142
|
-
id: 'ari:cloud:identity::user/70121:c17bdf1f-39db-4611-a700-2f8c1aff841e'
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}]
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
export const MOCK_CONNECTED_TEAMS_RESULT = [{
|
|
150
|
-
id: 'ari:cloud:identity::team/8ee37950-7de7-41ec-aee2-2c02c95949f4',
|
|
151
|
-
displayName: 'THE SUPER TEAM',
|
|
152
|
-
description: "Super team's super description",
|
|
153
|
-
state: 'ACTIVE',
|
|
154
|
-
membershipSettings: 'MEMBER_INVITE',
|
|
155
|
-
organizationId: 'ari:cloud:platform::org/434kbc65-c30c-1a22-6933-d25085c532ca',
|
|
156
|
-
creatorId: 'ari:cloud:identity::user/70121:c17bdf1f-39db-4611-a700-2f8c1aff841e',
|
|
157
|
-
isVerified: false,
|
|
158
|
-
members: [{
|
|
159
|
-
id: '70121:c17bdf1f-39db-4611-a700-2f8c1aff841e',
|
|
160
|
-
fullName: 'Shrutha Kashyap',
|
|
161
|
-
avatarUrl: 'https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/70121:c17bdf1f-39db-4611-a700-2f8c1aff841e/cf4058fd-75f2-4824-8041-c8efa4cc0ea8/128',
|
|
162
|
-
status: 'active'
|
|
163
|
-
}],
|
|
164
|
-
includesYou: false,
|
|
165
|
-
memberCount: 1,
|
|
166
|
-
smallAvatarImageUrl: 'https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/teams/avatars/0.svg',
|
|
167
|
-
smallHeaderImageUrl: 'https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/gradients/0.svg',
|
|
168
|
-
largeAvatarImageUrl: 'https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/teams/avatars/0.svg',
|
|
169
|
-
largeHeaderImageUrl: 'https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/gradients/0.svg',
|
|
170
|
-
restriction: 'ORG_MEMBERS'
|
|
171
|
-
}];
|
|
File without changes
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { print } from 'graphql';
|
|
2
|
-
import gql from 'graphql-tag';
|
|
3
|
-
export const UnlinkContainerMutation = print(gql`
|
|
4
|
-
mutation unlinkTeamToContainerMutation($teamId: ID!, $containerId: ID!) {
|
|
5
|
-
graphStore @optIn(to: ["GraphStoreMutation"]) {
|
|
6
|
-
deleteTeamConnectedToContainer(
|
|
7
|
-
input: { relationships: [{ from: $teamId, to: $containerId }] }
|
|
8
|
-
) @optIn(to: ["GraphStoreTeamConnectedToContainer"]) {
|
|
9
|
-
errors {
|
|
10
|
-
message
|
|
11
|
-
extensions {
|
|
12
|
-
statusCode
|
|
13
|
-
errorType
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
success
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`);
|
package/dist/es2019/services/agg-client/utils/queries/number-of-team-connected-to-container-query.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { print } from 'graphql';
|
|
2
|
-
import gql from 'graphql-tag';
|
|
3
|
-
export const NumberOfTeamConnectedToContainerQuery = print(gql`
|
|
4
|
-
query getNumberOfTeamsForContainer($containerId: ID!) {
|
|
5
|
-
graphStore @optIn(to: "GraphStore") {
|
|
6
|
-
teamConnectedToContainerInverse(id: $containerId, consistentRead: true)
|
|
7
|
-
@optIn(to: "GraphStoreTeamConnectedToContainer") {
|
|
8
|
-
edges {
|
|
9
|
-
id
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
`);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { print } from 'graphql';
|
|
2
|
-
import gql from 'graphql-tag';
|
|
3
|
-
export const TeamConnectedToContainerQuery = print(gql`
|
|
4
|
-
query getTeamsForContainer($containerId: ID!) {
|
|
5
|
-
graphStore @optIn(to: "GraphStore") {
|
|
6
|
-
teamConnectedToContainerInverse(id: $containerId, consistentRead: true)
|
|
7
|
-
@optIn(to: "GraphStoreTeamConnectedToContainer") {
|
|
8
|
-
edges {
|
|
9
|
-
node {
|
|
10
|
-
... on TeamV2 {
|
|
11
|
-
id
|
|
12
|
-
description
|
|
13
|
-
displayName
|
|
14
|
-
creator {
|
|
15
|
-
id
|
|
16
|
-
}
|
|
17
|
-
smallAvatarImageUrl
|
|
18
|
-
smallHeaderImageUrl
|
|
19
|
-
largeAvatarImageUrl
|
|
20
|
-
largeHeaderImageUrl
|
|
21
|
-
members {
|
|
22
|
-
nodes {
|
|
23
|
-
member {
|
|
24
|
-
id
|
|
25
|
-
name
|
|
26
|
-
picture
|
|
27
|
-
accountStatus
|
|
28
|
-
... on AtlassianAccountUser {
|
|
29
|
-
extendedProfile {
|
|
30
|
-
jobTitle
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
... on AppUser {
|
|
34
|
-
appType
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
role
|
|
38
|
-
state
|
|
39
|
-
}
|
|
40
|
-
pageInfo {
|
|
41
|
-
endCursor
|
|
42
|
-
hasNextPage
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
organizationId
|
|
46
|
-
membershipSettings
|
|
47
|
-
isVerified
|
|
48
|
-
state
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
`);
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { print } from 'graphql';
|
|
2
|
-
import gql from 'graphql-tag';
|
|
3
|
-
export const TeamContainersQueryV2 = print(gql`
|
|
4
|
-
query TeamContainersQueryV2($cypherQuery: String!, $params: JSON!) {
|
|
5
|
-
graphStore @optIn(to: ["GraphStore", "GraphStoreCypherQueryV2"]) {
|
|
6
|
-
cypherQueryV2(query: $cypherQuery, params: $params) {
|
|
7
|
-
edges {
|
|
8
|
-
node {
|
|
9
|
-
columns {
|
|
10
|
-
key
|
|
11
|
-
value {
|
|
12
|
-
... on GraphStoreCypherQueryV2AriNode {
|
|
13
|
-
data {
|
|
14
|
-
__typename
|
|
15
|
-
... on ConfluenceSpace {
|
|
16
|
-
id
|
|
17
|
-
confluenceSpaceName: name
|
|
18
|
-
type
|
|
19
|
-
createdDate
|
|
20
|
-
links {
|
|
21
|
-
base
|
|
22
|
-
webUi
|
|
23
|
-
}
|
|
24
|
-
icon {
|
|
25
|
-
path
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
... on JiraProject {
|
|
29
|
-
id
|
|
30
|
-
jiraProjectName: name
|
|
31
|
-
webUrl
|
|
32
|
-
created
|
|
33
|
-
avatar {
|
|
34
|
-
medium
|
|
35
|
-
}
|
|
36
|
-
projectType
|
|
37
|
-
projectTypeName
|
|
38
|
-
}
|
|
39
|
-
... on LoomSpace {
|
|
40
|
-
id
|
|
41
|
-
loomSpaceName: name
|
|
42
|
-
url
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`);
|
|
54
|
-
export const getTeamContainersQuery = () => {
|
|
55
|
-
return TeamContainersQueryV2;
|
|
56
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates headers object with X-Query-Context header if cloudId is provided.
|
|
3
|
-
* Use this for AGG client makeGraphQLRequest calls.
|
|
4
|
-
*/
|
|
5
|
-
export function createQueryContextHeaders(cloudId) {
|
|
6
|
-
if (!cloudId) {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
'X-Query-Context': `ari:cloud:platform::site/${cloudId}`
|
|
11
|
-
};
|
|
12
|
-
}
|