@atlaskit/teams-public 0.63.4 → 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 (44) hide show
  1. package/CHANGELOG.md +22 -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/mocks/index.js +1 -0
  6. package/dist/cjs/services/agg-client/utils/queries/team-containers-query.js +4 -6
  7. package/dist/cjs/services/agg-client/utils/query-context-headers.js +19 -0
  8. package/dist/cjs/services/graphql-client/main.js +34 -7
  9. package/dist/cjs/services/graphql-client/utils/index.js +5 -2
  10. package/dist/es2019/controllers/hooks/use-team-containers/index.js +6 -5
  11. package/dist/es2019/controllers/hooks/use-team-containers/mocks.js +119 -0
  12. package/dist/es2019/services/agg-client/index.js +14 -71
  13. package/dist/es2019/services/agg-client/mocks/index.js +1 -0
  14. package/dist/es2019/services/agg-client/utils/queries/team-containers-query.js +1 -53
  15. package/dist/es2019/services/agg-client/utils/query-context-headers.js +14 -0
  16. package/dist/es2019/services/graphql-client/main.js +26 -1
  17. package/dist/es2019/services/graphql-client/utils/index.js +2 -1
  18. package/dist/esm/controllers/hooks/use-team-containers/index.js +6 -5
  19. package/dist/esm/controllers/hooks/use-team-containers/mocks.js +119 -0
  20. package/dist/esm/services/agg-client/index.js +9 -73
  21. package/dist/esm/services/agg-client/mocks/index.js +1 -0
  22. package/dist/esm/services/agg-client/utils/queries/team-containers-query.js +3 -5
  23. package/dist/esm/services/agg-client/utils/query-context-headers.js +14 -0
  24. package/dist/esm/services/graphql-client/main.js +34 -7
  25. package/dist/esm/services/graphql-client/utils/index.js +5 -2
  26. package/dist/types/controllers/hooks/use-team-containers/index.d.ts +2 -1
  27. package/dist/types/controllers/hooks/use-team-containers/mocks.d.ts +127 -0
  28. package/dist/types/services/agg-client/index.d.ts +1 -2
  29. package/dist/types/services/agg-client/mocks/index.d.ts +1 -0
  30. package/dist/types/services/agg-client/utils/queries/team-containers-query.d.ts +0 -1
  31. package/dist/types/services/agg-client/utils/query-context-headers.d.ts +5 -0
  32. package/dist/types/services/graphql-client/main.d.ts +4 -0
  33. package/dist/types/services/graphql-client/types.d.ts +1 -0
  34. package/dist/types/services/types.d.ts +2 -2
  35. package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +2 -1
  36. package/dist/types-ts4.5/controllers/hooks/use-team-containers/mocks.d.ts +127 -0
  37. package/dist/types-ts4.5/services/agg-client/index.d.ts +1 -2
  38. package/dist/types-ts4.5/services/agg-client/mocks/index.d.ts +1 -0
  39. package/dist/types-ts4.5/services/agg-client/utils/queries/team-containers-query.d.ts +0 -1
  40. package/dist/types-ts4.5/services/agg-client/utils/query-context-headers.d.ts +5 -0
  41. package/dist/types-ts4.5/services/graphql-client/main.d.ts +4 -0
  42. package/dist/types-ts4.5/services/graphql-client/types.d.ts +1 -0
  43. package/dist/types-ts4.5/services/types.d.ts +2 -2
  44. package/package.json +10 -12
@@ -14,6 +14,7 @@ export var MOCK_TEAM_CONTAINERS = {
14
14
  type: 'confluence',
15
15
  createdDate: '2021-01-01',
16
16
  links: {
17
+ base: 'https://example.com',
17
18
  webUi: 'web-link'
18
19
  },
19
20
  icon: {
@@ -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
  };
@@ -0,0 +1,14 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
2
+
3
+ /**
4
+ * Creates headers object with X-Query-Context header if cloudId is provided and feature flag is enabled.
5
+ * Use this for AGG client makeGraphQLRequest calls.
6
+ */
7
+ export function createQueryContextHeaders(cloudId) {
8
+ if (!cloudId || !fg('enable_x_query_context_header')) {
9
+ return undefined;
10
+ }
11
+ return {
12
+ 'X-Query-Context': "ari:cloud:platform::site/".concat(cloudId)
13
+ };
14
+ }
@@ -1,3 +1,4 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -5,8 +6,11 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
5
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
7
  import _inherits from "@babel/runtime/helpers/inherits";
7
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
+ 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; }
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; }
8
11
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
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';
10
14
  import { DefaultError, GraphQLError } from '../../common/utils/error';
11
15
  import { BaseClient } from '../base-client';
12
16
  import { handleGraphQLRequest } from './utils';
@@ -24,34 +28,57 @@ export var BaseGraphQlClient = /*#__PURE__*/function (_BaseClient) {
24
28
  value: function setServiceUrl(serviceUrl) {
25
29
  this.serviceUrl = serviceUrl;
26
30
  }
31
+
32
+ /**
33
+ * Creates query context headers if cloudId is available and feature flag is enabled.
34
+ */
35
+ }, {
36
+ key: "createQueryContextHeaders",
37
+ value: function createQueryContextHeaders(cloudId) {
38
+ if (!cloudId || !fg('enable_x_query_context_header')) {
39
+ return undefined;
40
+ }
41
+ return {
42
+ 'X-Query-Context': "ari:cloud:platform::site/".concat(cloudId)
43
+ };
44
+ }
27
45
  }, {
28
46
  key: "makeGraphQLRequest",
29
47
  value: function () {
30
48
  var _makeGraphQLRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(body) {
31
49
  var options,
50
+ cloudId,
51
+ queryContextHeaders,
52
+ mergedOptions,
32
53
  _args = arguments;
33
54
  return _regeneratorRuntime.wrap(function _callee$(_context) {
34
55
  while (1) switch (_context.prev = _context.next) {
35
56
  case 0:
36
57
  options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
37
58
  _context.prev = 1;
38
- return _context.abrupt("return", handleGraphQLRequest(this.serviceUrl, body, options));
39
- case 5:
40
- _context.prev = 5;
59
+ // Automatically add X-Query-Context header if cloudId is available in context
60
+ cloudId = this.getCloudId();
61
+ queryContextHeaders = this.createQueryContextHeaders(cloudId); // Merge headers: query context headers first, then provided headers (provided headers take precedence)
62
+ mergedOptions = _objectSpread(_objectSpread({}, options), {}, {
63
+ headers: _objectSpread(_objectSpread({}, queryContextHeaders), options.headers)
64
+ });
65
+ return _context.abrupt("return", handleGraphQLRequest(this.serviceUrl, body, mergedOptions));
66
+ case 8:
67
+ _context.prev = 8;
41
68
  _context.t0 = _context["catch"](1);
42
69
  if (!(_context.t0 instanceof GraphQLError)) {
43
- _context.next = 9;
70
+ _context.next = 12;
44
71
  break;
45
72
  }
46
73
  throw _context.t0;
47
- case 9:
74
+ case 12:
48
75
  this.logException(_context.t0, 'UnknownError in GraphQLClient.makeGraphQLRequestWithoutRetries');
49
76
  throw new DefaultError({});
50
- case 11:
77
+ case 14:
51
78
  case "end":
52
79
  return _context.stop();
53
80
  }
54
- }, _callee, this, [[1, 5]]);
81
+ }, _callee, this, [[1, 8]]);
55
82
  }));
56
83
  function makeGraphQLRequest(_x) {
57
84
  return _makeGraphQLRequest.apply(this, arguments);
@@ -1,5 +1,8 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+ 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; }
5
+ 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; }
3
6
  import { GraphQLError, HttpError } from '../../../common/utils/error';
4
7
  import { EXPONENTIAL_BACKOFF_RETRY_POLICY, is5xx, isFetchResponse, withExponentialBackoff } from '../../../common/utils/http';
5
8
  import { handleResponse } from '../../../common/utils/status-code-handlers-provider';
@@ -25,9 +28,9 @@ function _makeGraphQLRequestWithoutRetries() {
25
28
  url = serviceUrl + operationNameQuery;
26
29
  request = fetch(url, {
27
30
  method: 'POST',
28
- headers: new Headers({
31
+ headers: new Headers(_objectSpread({
29
32
  'Content-Type': 'application/json'
30
- }),
33
+ }, options.headers || {})),
31
34
  credentials: 'include',
32
35
  body: JSON.stringify(body)
33
36
  }).then(function (res) {
@@ -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[]>;
@@ -14,6 +14,7 @@ export declare const MOCK_TEAM_CONTAINERS: {
14
14
  type: string;
15
15
  createdDate: string;
16
16
  links: {
17
+ base: string;
17
18
  webUi: string;
18
19
  };
19
20
  icon: {
@@ -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 = {
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Creates headers object with X-Query-Context header if cloudId is provided and feature flag is enabled.
3
+ * Use this for AGG client makeGraphQLRequest calls.
4
+ */
5
+ export declare function createQueryContextHeaders(cloudId?: string): Record<string, string> | undefined;
@@ -4,5 +4,9 @@ export declare class BaseGraphQlClient extends BaseClient {
4
4
  private serviceUrl;
5
5
  constructor(serviceUrl: string, config: ClientConfig);
6
6
  setServiceUrl(serviceUrl: string): void;
7
+ /**
8
+ * Creates query context headers if cloudId is available and feature flag is enabled.
9
+ */
10
+ private createQueryContextHeaders;
7
11
  makeGraphQLRequest<Key extends string, Data = unknown, Variables = unknown>(body: Body<Variables>, options?: Options): Promise<ResultResponse<Key, Data>>;
8
12
  }
@@ -2,6 +2,7 @@ import { type ErrorData } from '../../common/utils/error';
2
2
  export interface Options {
3
3
  operationName?: string;
4
4
  errorPolicy?: 'none' | 'all' | 'ignore';
5
+ headers?: Record<string, string>;
5
6
  }
6
7
  export type InnerResponse<T> = {
7
8
  data: T;
@@ -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;
@@ -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[]>;
@@ -14,6 +14,7 @@ export declare const MOCK_TEAM_CONTAINERS: {
14
14
  type: string;
15
15
  createdDate: string;
16
16
  links: {
17
+ base: string;
17
18
  webUi: string;
18
19
  };
19
20
  icon: {
@@ -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 = {
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Creates headers object with X-Query-Context header if cloudId is provided and feature flag is enabled.
3
+ * Use this for AGG client makeGraphQLRequest calls.
4
+ */
5
+ export declare function createQueryContextHeaders(cloudId?: string): Record<string, string> | undefined;
@@ -4,5 +4,9 @@ export declare class BaseGraphQlClient extends BaseClient {
4
4
  private serviceUrl;
5
5
  constructor(serviceUrl: string, config: ClientConfig);
6
6
  setServiceUrl(serviceUrl: string): void;
7
+ /**
8
+ * Creates query context headers if cloudId is available and feature flag is enabled.
9
+ */
10
+ private createQueryContextHeaders;
7
11
  makeGraphQLRequest<Key extends string, Data = unknown, Variables = unknown>(body: Body<Variables>, options?: Options): Promise<ResultResponse<Key, Data>>;
8
12
  }
@@ -2,6 +2,7 @@ import { type ErrorData } from '../../common/utils/error';
2
2
  export interface Options {
3
3
  operationName?: string;
4
4
  errorPolicy?: 'none' | 'all' | 'ignore';
5
+ headers?: Record<string, string>;
5
6
  }
6
7
  export type InnerResponse<T> = {
7
8
  data: T;
@@ -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
  };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "category": "Layout and structure"
7
7
  }
8
8
  },
9
- "repository": "https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo",
9
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-monorepo",
10
10
  "main": "dist/cjs/index.js",
11
11
  "module": "dist/esm/index.js",
12
12
  "module:es2019": "dist/es2019/index.js",
@@ -35,10 +35,8 @@
35
35
  "@atlaskit/frontend-utilities": "^3.2.0",
36
36
  "@atlaskit/heading": "^5.2.0",
37
37
  "@atlaskit/icon": "^29.0.0",
38
- "@atlaskit/icon-lab": "^5.12.0",
39
38
  "@atlaskit/image": "^3.0.0",
40
39
  "@atlaskit/link": "^3.2.0",
41
- "@atlaskit/logo": "^19.9.0",
42
40
  "@atlaskit/modal-dialog": "^14.7.0",
43
41
  "@atlaskit/people-teams-ui-public": "^3.7.0",
44
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -46,10 +44,10 @@
46
44
  "@atlaskit/skeleton": "^2.1.0",
47
45
  "@atlaskit/teams-app-internal-analytics": "^1.20.0",
48
46
  "@atlaskit/teams-app-internal-product-permissions": "^1.2.0",
49
- "@atlaskit/teams-client": "^4.24.0",
47
+ "@atlaskit/teams-client": "^4.29.0",
50
48
  "@atlaskit/theme": "^21.0.0",
51
49
  "@atlaskit/tokens": "^8.4.0",
52
- "@atlaskit/tooltip": "^20.10.0",
50
+ "@atlaskit/tooltip": "^20.11.0",
53
51
  "@babel/runtime": "^7.0.0",
54
52
  "@compiled/react": "^0.18.6",
55
53
  "@types/string-hash": "^1.1.3",
@@ -111,7 +109,7 @@
111
109
  }
112
110
  },
113
111
  "name": "@atlaskit/teams-public",
114
- "version": "0.63.4",
112
+ "version": "0.65.0",
115
113
  "description": "Public components related to teams",
116
114
  "author": "Atlassian Pty Ltd",
117
115
  "license": "Apache-2.0",
@@ -126,15 +124,9 @@
126
124
  "enable_medium_size_icons_for_team_link_cards": {
127
125
  "type": "boolean"
128
126
  },
129
- "enable_team_containers_null_check": {
130
- "type": "boolean"
131
- },
132
127
  "fix_team_link_card_a11y": {
133
128
  "type": "boolean"
134
129
  },
135
- "teams_containers_cypher_query_v2_migration": {
136
- "type": "boolean"
137
- },
138
130
  "migrate-product-permissions": {
139
131
  "type": "boolean"
140
132
  },
@@ -143,6 +135,12 @@
143
135
  },
144
136
  "ptc-enable-teams-public-analytics-refactor": {
145
137
  "type": "boolean"
138
+ },
139
+ "enable_x_query_context_header": {
140
+ "type": "boolean"
141
+ },
142
+ "enable_teams_public_migration_using_teams-client": {
143
+ "type": "boolean"
146
144
  }
147
145
  }
148
146
  }