@atlaskit/teams-public 0.64.0 → 0.65.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.
Files changed (24) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/controllers/hooks/use-team-containers/index.js +6 -5
  3. package/dist/cjs/controllers/hooks/use-team-containers/mocks.js +125 -0
  4. package/dist/cjs/services/agg-client/index.js +8 -72
  5. package/dist/cjs/services/agg-client/utils/queries/team-containers-query.js +4 -6
  6. package/dist/es2019/controllers/hooks/use-team-containers/index.js +6 -5
  7. package/dist/es2019/controllers/hooks/use-team-containers/mocks.js +119 -0
  8. package/dist/es2019/services/agg-client/index.js +14 -71
  9. package/dist/es2019/services/agg-client/utils/queries/team-containers-query.js +1 -53
  10. package/dist/esm/controllers/hooks/use-team-containers/index.js +6 -5
  11. package/dist/esm/controllers/hooks/use-team-containers/mocks.js +119 -0
  12. package/dist/esm/services/agg-client/index.js +9 -73
  13. package/dist/esm/services/agg-client/utils/queries/team-containers-query.js +3 -5
  14. package/dist/types/controllers/hooks/use-team-containers/index.d.ts +2 -1
  15. package/dist/types/controllers/hooks/use-team-containers/mocks.d.ts +127 -0
  16. package/dist/types/services/agg-client/index.d.ts +1 -2
  17. package/dist/types/services/agg-client/utils/queries/team-containers-query.d.ts +0 -1
  18. package/dist/types/services/types.d.ts +2 -2
  19. package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +2 -1
  20. package/dist/types-ts4.5/controllers/hooks/use-team-containers/mocks.d.ts +127 -0
  21. package/dist/types-ts4.5/services/agg-client/index.d.ts +1 -2
  22. package/dist/types-ts4.5/services/agg-client/utils/queries/team-containers-query.d.ts +0 -1
  23. package/dist/types-ts4.5/services/types.d.ts +2 -2
  24. package/package.json +7 -10
@@ -1,57 +1,5 @@
1
1
  import { print } from 'graphql';
2
2
  import gql from 'graphql-tag';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
- export const TeamContainersQuery = print(gql`
5
- query TeamContainersQuery($cypherQuery: String!) {
6
- graphStore @optIn(to: ["GraphStore"]) {
7
- cypherQuery(query: $cypherQuery) @optIn(to: ["GraphStoreCypherQuery"]) {
8
- edges {
9
- __typename
10
- node {
11
- from {
12
- id
13
- }
14
- to {
15
- id
16
- data {
17
- __typename
18
- ... on ConfluenceSpace {
19
- id
20
- confluenceSpaceName: name
21
- type
22
- createdDate
23
- links {
24
- base
25
- webUi
26
- }
27
- icon {
28
- path
29
- }
30
- }
31
- ... on JiraProject {
32
- id
33
- jiraProjectName: name
34
- webUrl
35
- created
36
- avatar {
37
- medium
38
- }
39
- projectType
40
- projectTypeName
41
- }
42
- ... on LoomSpace {
43
- id
44
- loomSpaceName: name
45
- url
46
- }
47
- }
48
- }
49
- }
50
- }
51
- }
52
- }
53
- }
54
- `);
55
3
  export const TeamContainersQueryV2 = print(gql`
56
4
  query TeamContainersQueryV2($cypherQuery: String!, $params: JSON!) {
57
5
  graphStore @optIn(to: ["GraphStore", "GraphStoreCypherQueryV2"]) {
@@ -104,5 +52,5 @@ export const TeamContainersQueryV2 = print(gql`
104
52
  }
105
53
  `);
106
54
  export const getTeamContainersQuery = () => {
107
- return fg('teams_containers_cypher_query_v2_migration') ? TeamContainersQueryV2 : TeamContainersQuery;
55
+ return TeamContainersQueryV2;
108
56
  };
@@ -10,6 +10,7 @@ import { createHook, createStore } from 'react-sweet-state';
10
10
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
13
+ import { teamsClient as externalTeamsClient } from '@atlaskit/teams-client';
13
14
  import { AnalyticsAction, usePeopleAndTeamAnalytics } from '../../../common/utils/analytics';
14
15
  import { teamsClient } from '../../../services';
15
16
  var initialConnectedTeamsState = {
@@ -60,7 +61,7 @@ var actions = {
60
61
  });
61
62
  _context.prev = 5;
62
63
  _context.next = 8;
63
- return teamsClient.getTeamContainers(teamId);
64
+ return fg('enable_teams_public_migration_using_teams-client') ? externalTeamsClient.getTeamContainers(teamId) : teamsClient.getTeamContainers(teamId);
64
65
  case 8:
65
66
  containers = _context.sent;
66
67
  if (fg('ptc-enable-teams-public-analytics-refactor')) {
@@ -126,7 +127,7 @@ var actions = {
126
127
  case 4:
127
128
  _context2.prev = 4;
128
129
  _context2.next = 7;
129
- return teamsClient.getTeamContainers(teamId);
130
+ return fg('enable_teams_public_migration_using_teams-client') ? externalTeamsClient.getTeamContainers(teamId) : teamsClient.getTeamContainers(teamId);
130
131
  case 7:
131
132
  containers = _context2.sent;
132
133
  if (fg('ptc-enable-teams-public-analytics-refactor')) {
@@ -201,7 +202,7 @@ var actions = {
201
202
  });
202
203
  _context3.prev = 5;
203
204
  _context3.next = 8;
204
- return teamsClient.getNumberOfConnectedTeams(containerId);
205
+ return fg('enable_teams_public_migration_using_teams-client') ? externalTeamsClient.getNumberOfConnectedTeams(containerId) : teamsClient.getNumberOfConnectedTeams(containerId);
205
206
  case 8:
206
207
  numberOfTeams = _context3.sent;
207
208
  if (fg('ptc-enable-teams-public-analytics-refactor')) {
@@ -290,7 +291,7 @@ var actions = {
290
291
  });
291
292
  _context4.prev = 5;
292
293
  _context4.next = 8;
293
- return teamsClient.getConnectedTeams(containerId);
294
+ return fg('enable_teams_public_migration_using_teams-client') ? externalTeamsClient.getConnectedTeams(containerId) : teamsClient.getConnectedTeams(containerId);
294
295
  case 8:
295
296
  teams = _context4.sent;
296
297
  if (fg('ptc-enable-teams-public-analytics-refactor')) {
@@ -373,7 +374,7 @@ var actions = {
373
374
  });
374
375
  _context5.prev = 2;
375
376
  _context5.next = 5;
376
- return teamsClient.unlinkTeamContainer(teamId, containerId);
377
+ return fg('enable_teams_public_migration_using_teams-client') ? externalTeamsClient.unlinkTeamContainer(teamId, containerId) : teamsClient.unlinkTeamContainer(teamId, containerId);
377
378
  case 5:
378
379
  mutationResult = _context5.sent;
379
380
  if (mutationResult.deleteTeamConnectedToContainer.errors.length) {
@@ -0,0 +1,119 @@
1
+ // Mock data for tests
2
+ export var MOCK_TEAM_CONTAINERS = {
3
+ graphStore: {
4
+ cypherQuery: {
5
+ edges: [{
6
+ node: {
7
+ from: {
8
+ id: '1'
9
+ },
10
+ to: {
11
+ id: '2',
12
+ data: {
13
+ __typename: 'ConfluenceSpace',
14
+ confluenceSpaceName: 'Confluence Space',
15
+ type: 'confluence',
16
+ createdDate: '2021-01-01',
17
+ links: {
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 var 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 var MOCK_CONNECTED_TEAMS_RESULT = [{
98
+ id: 'ari:cloud:identity::team/8ee37950-7de7-41ec-aee2-2c02c95949f4',
99
+ displayName: 'THE SUPER TEAM',
100
+ description: "Super team's super description",
101
+ state: 'ACTIVE',
102
+ membershipSettings: 'MEMBER_INVITE',
103
+ organizationId: 'ari:cloud:platform::org/434kbc65-c30c-1a22-6933-d25085c532ca',
104
+ creatorId: 'ari:cloud:identity::user/70121:c17bdf1f-39db-4611-a700-2f8c1aff841e',
105
+ isVerified: false,
106
+ members: [{
107
+ id: '70121:c17bdf1f-39db-4611-a700-2f8c1aff841e',
108
+ fullName: 'Shrutha Kashyap',
109
+ 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',
110
+ status: 'active'
111
+ }],
112
+ includesYou: false,
113
+ memberCount: 1,
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
+ restriction: 'ORG_MEMBERS'
119
+ }];
@@ -7,7 +7,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
8
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { teamIdToAri } from '../../common/utils/team-id-to-ari';
12
11
  import { toUserId } from '../../common/utils/user-ari';
13
12
  import { DEFAULT_CONFIG } from '../constants';
@@ -15,7 +14,7 @@ import { BaseGraphQlClient } from '../graphql-client';
15
14
  import { UnlinkContainerMutation } from './utils/mutations/unlink-container-mutation';
16
15
  import { NumberOfTeamConnectedToContainerQuery } from './utils/queries/number-of-team-connected-to-container-query';
17
16
  import { TeamConnectedToContainerQuery } from './utils/queries/team-connected-to-container-query';
18
- import { TeamContainersQuery, TeamContainersQueryV2 } from './utils/queries/team-containers-query';
17
+ import { TeamContainersQueryV2 } from './utils/queries/team-containers-query';
19
18
  export var AGGClient = /*#__PURE__*/function (_BaseGraphQlClient) {
20
19
  function AGGClient(baseUrl, config) {
21
20
  _classCallCheck(this, AGGClient);
@@ -31,17 +30,13 @@ export var AGGClient = /*#__PURE__*/function (_BaseGraphQlClient) {
31
30
  key: "getTeamContainers",
32
31
  value: function () {
33
32
  var _getTeamContainers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(teamId) {
34
- var teamAri, cypherQuery, response, _response;
33
+ var teamAri, cypherQuery, response;
35
34
  return _regeneratorRuntime.wrap(function _callee$(_context) {
36
35
  while (1) switch (_context.prev = _context.next) {
37
36
  case 0:
38
37
  teamAri = teamIdToAri(teamId);
39
38
  cypherQuery = "MATCH (team:IdentityTeam {ari: '".concat(teamAri, "'})-[:team_connected_to_container]->(container) RETURN container");
40
- if (!fg('teams_containers_cypher_query_v2_migration')) {
41
- _context.next = 9;
42
- break;
43
- }
44
- _context.next = 5;
39
+ _context.next = 4;
45
40
  return this.makeGraphQLRequest({
46
41
  query: TeamContainersQueryV2,
47
42
  variables: {
@@ -53,23 +48,10 @@ export var AGGClient = /*#__PURE__*/function (_BaseGraphQlClient) {
53
48
  }, {
54
49
  operationName: 'TeamContainersQueryV2'
55
50
  });
56
- case 5:
51
+ case 4:
57
52
  response = _context.sent;
58
- return _context.abrupt("return", this.processV2Response(response));
59
- case 9:
60
- _context.next = 11;
61
- return this.makeGraphQLRequest({
62
- query: TeamContainersQuery,
63
- variables: {
64
- cypherQuery: cypherQuery
65
- }
66
- }, {
67
- operationName: 'TeamContainersQuery'
68
- });
69
- case 11:
70
- _response = _context.sent;
71
- return _context.abrupt("return", this.processV1Response(_response));
72
- case 13:
53
+ return _context.abrupt("return", this.processResponse(response));
54
+ case 6:
73
55
  case "end":
74
56
  return _context.stop();
75
57
  }
@@ -81,13 +63,13 @@ export var AGGClient = /*#__PURE__*/function (_BaseGraphQlClient) {
81
63
  return getTeamContainers;
82
64
  }()
83
65
  }, {
84
- key: "processV2Response",
85
- value: function processV2Response(response) {
66
+ key: "processResponse",
67
+ value: function processResponse(response) {
86
68
  var containersResult = response.graphStore.cypherQueryV2.edges.reduce(function (containers, edge) {
87
69
  edge.node.columns.forEach(function (column) {
88
70
  var _column$value;
89
71
  var containerData = (_column$value = column.value) === null || _column$value === void 0 ? void 0 : _column$value.data;
90
- if (!containerData && fg('enable_team_containers_null_check')) {
72
+ if (!containerData) {
91
73
  return;
92
74
  }
93
75
  if ((containerData === null || containerData === void 0 ? void 0 : containerData.__typename) === 'ConfluenceSpace') {
@@ -130,52 +112,6 @@ export var AGGClient = /*#__PURE__*/function (_BaseGraphQlClient) {
130
112
  }, []);
131
113
  return containersResult;
132
114
  }
133
- }, {
134
- key: "processV1Response",
135
- value: function processV1Response(response) {
136
- var containersResult = response.graphStore.cypherQuery.edges.reduce(function (containers, edge) {
137
- if (!edge.node.to.data && fg('enable_team_containers_null_check')) {
138
- return containers;
139
- }
140
- if (edge.node.to.data.__typename === 'ConfluenceSpace') {
141
- containers.push({
142
- id: edge.node.to.id,
143
- type: edge.node.to.data.__typename,
144
- name: edge.node.to.data.confluenceSpaceName || '',
145
- icon: "".concat(edge.node.to.data.links.base).concat(edge.node.to.data.icon.path),
146
- createdDate: new Date(edge.node.to.data.createdDate),
147
- link: "".concat(edge.node.to.data.links.base).concat(edge.node.to.data.links.webUi),
148
- containerTypeProperties: {
149
- subType: undefined,
150
- name: undefined
151
- }
152
- });
153
- } else if (edge.node.to.data.__typename === 'JiraProject') {
154
- containers.push({
155
- id: edge.node.to.id,
156
- type: edge.node.to.data.__typename,
157
- name: edge.node.to.data.jiraProjectName,
158
- icon: edge.node.to.data.avatar.medium,
159
- createdDate: new Date(edge.node.to.data.created),
160
- link: edge.node.to.data.webUrl,
161
- containerTypeProperties: {
162
- subType: edge.node.to.data.projectType || '',
163
- name: edge.node.to.data.projectTypeName || ''
164
- }
165
- });
166
- } else if (edge.node.to.data.__typename === 'LoomSpace') {
167
- containers.push({
168
- id: edge.node.to.id,
169
- type: edge.node.to.data.__typename,
170
- name: edge.node.to.data.loomSpaceName,
171
- icon: '',
172
- link: edge.node.to.data.url
173
- });
174
- }
175
- return containers;
176
- }, []);
177
- return containersResult;
178
- }
179
115
  }, {
180
116
  key: "unlinkTeamContainer",
181
117
  value: function () {
@@ -1,10 +1,8 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2;
2
+ var _templateObject;
3
3
  import { print } from 'graphql';
4
4
  import gql from 'graphql-tag';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
- export var TeamContainersQuery = print(gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tquery TeamContainersQuery($cypherQuery: String!) {\n\t\tgraphStore @optIn(to: [\"GraphStore\"]) {\n\t\t\tcypherQuery(query: $cypherQuery) @optIn(to: [\"GraphStoreCypherQuery\"]) {\n\t\t\t\tedges {\n\t\t\t\t\t__typename\n\t\t\t\t\tnode {\n\t\t\t\t\t\tfrom {\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t}\n\t\t\t\t\t\tto {\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\tdata {\n\t\t\t\t\t\t\t\t__typename\n\t\t\t\t\t\t\t\t... on ConfluenceSpace {\n\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\tconfluenceSpaceName: name\n\t\t\t\t\t\t\t\t\ttype\n\t\t\t\t\t\t\t\t\tcreatedDate\n\t\t\t\t\t\t\t\t\tlinks {\n\t\t\t\t\t\t\t\t\t\tbase\n\t\t\t\t\t\t\t\t\t\twebUi\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ticon {\n\t\t\t\t\t\t\t\t\t\tpath\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t... on JiraProject {\n\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\tjiraProjectName: name\n\t\t\t\t\t\t\t\t\twebUrl\n\t\t\t\t\t\t\t\t\tcreated\n\t\t\t\t\t\t\t\t\tavatar {\n\t\t\t\t\t\t\t\t\t\tmedium\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tprojectType\n\t\t\t\t\t\t\t\t\tprojectTypeName\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t... on LoomSpace {\n\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\tloomSpaceName: name\n\t\t\t\t\t\t\t\t\turl\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"]))));
7
- export var TeamContainersQueryV2 = print(gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tquery TeamContainersQueryV2($cypherQuery: String!, $params: JSON!) {\n\t\tgraphStore @optIn(to: [\"GraphStore\", \"GraphStoreCypherQueryV2\"]) {\n\t\t\tcypherQueryV2(query: $cypherQuery, params: $params) {\n\t\t\t\tedges {\n\t\t\t\t\tnode {\n\t\t\t\t\t\tcolumns {\n\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\tvalue {\n\t\t\t\t\t\t\t\t... on GraphStoreCypherQueryV2AriNode {\n\t\t\t\t\t\t\t\t\tdata {\n\t\t\t\t\t\t\t\t\t\t__typename\n\t\t\t\t\t\t\t\t\t\t... on ConfluenceSpace {\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t\tconfluenceSpaceName: name\n\t\t\t\t\t\t\t\t\t\t\ttype\n\t\t\t\t\t\t\t\t\t\t\tcreatedDate\n\t\t\t\t\t\t\t\t\t\t\tlinks {\n\t\t\t\t\t\t\t\t\t\t\t\tbase\n\t\t\t\t\t\t\t\t\t\t\t\twebUi\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\ticon {\n\t\t\t\t\t\t\t\t\t\t\t\tpath\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t... on JiraProject {\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t\tjiraProjectName: name\n\t\t\t\t\t\t\t\t\t\t\twebUrl\n\t\t\t\t\t\t\t\t\t\t\tcreated\n\t\t\t\t\t\t\t\t\t\t\tavatar {\n\t\t\t\t\t\t\t\t\t\t\t\tmedium\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tprojectType\n\t\t\t\t\t\t\t\t\t\t\tprojectTypeName\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t... on LoomSpace {\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t\tloomSpaceName: name\n\t\t\t\t\t\t\t\t\t\t\turl\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"]))));
5
+ export var TeamContainersQueryV2 = print(gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tquery TeamContainersQueryV2($cypherQuery: String!, $params: JSON!) {\n\t\tgraphStore @optIn(to: [\"GraphStore\", \"GraphStoreCypherQueryV2\"]) {\n\t\t\tcypherQueryV2(query: $cypherQuery, params: $params) {\n\t\t\t\tedges {\n\t\t\t\t\tnode {\n\t\t\t\t\t\tcolumns {\n\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\tvalue {\n\t\t\t\t\t\t\t\t... on GraphStoreCypherQueryV2AriNode {\n\t\t\t\t\t\t\t\t\tdata {\n\t\t\t\t\t\t\t\t\t\t__typename\n\t\t\t\t\t\t\t\t\t\t... on ConfluenceSpace {\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t\tconfluenceSpaceName: name\n\t\t\t\t\t\t\t\t\t\t\ttype\n\t\t\t\t\t\t\t\t\t\t\tcreatedDate\n\t\t\t\t\t\t\t\t\t\t\tlinks {\n\t\t\t\t\t\t\t\t\t\t\t\tbase\n\t\t\t\t\t\t\t\t\t\t\t\twebUi\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\ticon {\n\t\t\t\t\t\t\t\t\t\t\t\tpath\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t... on JiraProject {\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t\tjiraProjectName: name\n\t\t\t\t\t\t\t\t\t\t\twebUrl\n\t\t\t\t\t\t\t\t\t\t\tcreated\n\t\t\t\t\t\t\t\t\t\t\tavatar {\n\t\t\t\t\t\t\t\t\t\t\t\tmedium\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tprojectType\n\t\t\t\t\t\t\t\t\t\t\tprojectTypeName\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t... on LoomSpace {\n\t\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t\t\tloomSpaceName: name\n\t\t\t\t\t\t\t\t\t\t\turl\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n"]))));
8
6
  export var getTeamContainersQuery = function getTeamContainersQuery() {
9
- return fg('teams_containers_cypher_query_v2_migration') ? TeamContainersQueryV2 : TeamContainersQuery;
7
+ return TeamContainersQueryV2;
10
8
  };
@@ -1,7 +1,8 @@
1
1
  import { type Action } from 'react-sweet-state';
2
2
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
3
3
  import { type TeamContainer } from '../../../common/types';
4
- import { type TeamContainers, type TeamWithMemberships, type UnlinkContainerMutationError } from '../../../services/types';
4
+ import type { UnlinkContainerMutationError } from '../../../services/agg-client/utils/mutations/unlink-container-mutation';
5
+ import { type TeamContainers, type TeamWithMemberships } from '../../../services/types';
5
6
  type ConnectedTeams = {
6
7
  containerId: string | undefined;
7
8
  isLoading: boolean;
@@ -0,0 +1,127 @@
1
+ export declare const MOCK_TEAM_CONTAINERS: {
2
+ graphStore: {
3
+ cypherQuery: {
4
+ edges: ({
5
+ node: {
6
+ from: {
7
+ id: string;
8
+ };
9
+ to: {
10
+ id: string;
11
+ data: {
12
+ __typename: string;
13
+ confluenceSpaceName: string;
14
+ type: string;
15
+ createdDate: string;
16
+ links: {
17
+ webUi: string;
18
+ };
19
+ icon: {
20
+ path: string;
21
+ };
22
+ jiraProjectName?: undefined;
23
+ webUrl?: undefined;
24
+ created?: undefined;
25
+ avatar?: undefined;
26
+ };
27
+ };
28
+ };
29
+ } | {
30
+ node: {
31
+ from: {
32
+ id: string;
33
+ };
34
+ to: {
35
+ id: string;
36
+ data: {
37
+ __typename: string;
38
+ jiraProjectName: string;
39
+ webUrl: string;
40
+ created: string;
41
+ avatar: {
42
+ medium: string;
43
+ };
44
+ confluenceSpaceName?: undefined;
45
+ type?: undefined;
46
+ createdDate?: undefined;
47
+ links?: undefined;
48
+ icon?: undefined;
49
+ };
50
+ };
51
+ };
52
+ })[];
53
+ };
54
+ };
55
+ };
56
+ export declare const MOCK_TEAM_CONTAINERSV2: {
57
+ graphStore: {
58
+ cypherQueryV2: {
59
+ edges: ({
60
+ node: {
61
+ columns: {
62
+ key: string;
63
+ value: {
64
+ data: {
65
+ __typename: string;
66
+ id: string;
67
+ confluenceSpaceName: string;
68
+ type: string;
69
+ createdDate: string;
70
+ links: {
71
+ base: string;
72
+ webUi: string;
73
+ };
74
+ icon: {
75
+ path: string;
76
+ };
77
+ };
78
+ };
79
+ }[];
80
+ };
81
+ } | {
82
+ node: {
83
+ columns: {
84
+ key: string;
85
+ value: {
86
+ data: {
87
+ __typename: string;
88
+ id: string;
89
+ jiraProjectName: string;
90
+ webUrl: string;
91
+ created: string;
92
+ avatar: {
93
+ medium: string;
94
+ };
95
+ projectType: string;
96
+ projectTypeName: string;
97
+ };
98
+ };
99
+ }[];
100
+ };
101
+ })[];
102
+ };
103
+ };
104
+ };
105
+ export declare const MOCK_CONNECTED_TEAMS_RESULT: {
106
+ id: string;
107
+ displayName: string;
108
+ description: string;
109
+ state: string;
110
+ membershipSettings: string;
111
+ organizationId: string;
112
+ creatorId: string;
113
+ isVerified: boolean;
114
+ members: {
115
+ id: string;
116
+ fullName: string;
117
+ avatarUrl: string;
118
+ status: string;
119
+ }[];
120
+ includesYou: boolean;
121
+ memberCount: number;
122
+ smallAvatarImageUrl: string;
123
+ smallHeaderImageUrl: string;
124
+ largeAvatarImageUrl: string;
125
+ largeHeaderImageUrl: string;
126
+ restriction: string;
127
+ }[];
@@ -6,8 +6,7 @@ export declare class AGGClient extends BaseGraphQlClient {
6
6
  constructor(baseUrl: string, config: ClientConfig);
7
7
  setBaseUrl(baseUrl: string): void;
8
8
  getTeamContainers(teamId: string): Promise<TeamContainers>;
9
- private processV2Response;
10
- private processV1Response;
9
+ private processResponse;
11
10
  unlinkTeamContainer(teamId: string, containerId: string): Promise<UnlinkContainerMutationResponse>;
12
11
  queryNumberOfTeamConnectedToContainer(containerId: string): Promise<number>;
13
12
  queryTeamsConnectedToContainer(containerId: string): Promise<TeamWithMemberships[]>;
@@ -1,4 +1,3 @@
1
- export declare const TeamContainersQuery: string;
2
1
  export declare const TeamContainersQueryV2: string;
3
2
  export declare const getTeamContainersQuery: () => string;
4
3
  export type TeamContainersQueryVariables = {
@@ -1,4 +1,4 @@
1
- export { type UnlinkContainerMutationError } from './agg-client/utils/mutations/unlink-container-mutation';
1
+ import type { TeamRestriction } from '@atlaskit/teams-client/types';
2
2
  import type { TeamContainer, TeamMembershipSettings, TeamState, UserStatus } from '../common/types';
3
3
  export type ClientContext = {
4
4
  cloudId?: string | null;
@@ -33,5 +33,5 @@ export type TeamWithMemberships = {
33
33
  smallAvatarImageUrl: string;
34
34
  largeHeaderImageUrl: string;
35
35
  smallHeaderImageUrl: string;
36
- restriction: 'ORG_MEMBERS';
36
+ restriction: TeamRestriction;
37
37
  };
@@ -1,7 +1,8 @@
1
1
  import { type Action } from 'react-sweet-state';
2
2
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/teams-app-internal-analytics';
3
3
  import { type TeamContainer } from '../../../common/types';
4
- import { type TeamContainers, type TeamWithMemberships, type UnlinkContainerMutationError } from '../../../services/types';
4
+ import type { UnlinkContainerMutationError } from '../../../services/agg-client/utils/mutations/unlink-container-mutation';
5
+ import { type TeamContainers, type TeamWithMemberships } from '../../../services/types';
5
6
  type ConnectedTeams = {
6
7
  containerId: string | undefined;
7
8
  isLoading: boolean;