@atlaskit/link-datasource 6.13.0 → 6.13.3

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 (81) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/analytics/xpc/useDatasourceCrossProductAttribution.js +2 -2
  3. package/dist/cjs/hooks/useErrorLogger.js +2 -2
  4. package/dist/cjs/hooks/useIsInPDFRender.js +2 -2
  5. package/dist/cjs/index.js +13 -13
  6. package/dist/cjs/services/__clearUnitsRolloutSettingsCacheForTests.js +13 -0
  7. package/dist/cjs/services/fetchObjectSchema.js +2 -2
  8. package/dist/cjs/services/fetchObjectSchemas.js +2 -2
  9. package/dist/cjs/services/getAvailableSites.js +32 -19
  10. package/dist/cjs/services/getUnitsRolloutSettings.js +199 -0
  11. package/dist/cjs/services/getWorkspaceId.js +2 -2
  12. package/dist/cjs/services/isUnitsIsolationEnabled.js +63 -0
  13. package/dist/cjs/services/resolvePrimaryWorkspace.js +2 -2
  14. package/dist/cjs/services/useBasicFilterAGG.js +2 -2
  15. package/dist/cjs/services/validateAql.js +2 -2
  16. package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +3 -2
  17. package/dist/cjs/ui/assets-modal/search-container/aql-search-input/loading-state.js +2 -2
  18. package/dist/cjs/ui/assets-modal/search-container/object-schema-select/loading-state.js +2 -2
  19. package/dist/cjs/ui/common/modal/popup-select/index.js +2 -2
  20. package/dist/cjs/ui/confluence-search-modal/modal/PlainConfluenceSearchConfigModal.js +2 -2
  21. package/dist/cjs/ui/issue-like-table/empty-state/index.js +3 -3
  22. package/dist/cjs/ui/issue-like-table/issue-like-data-table-view.js +2 -2
  23. package/dist/cjs/ui/jira-issues-modal/modal/index.js +2 -2
  24. package/dist/es2019/analytics/xpc/useDatasourceCrossProductAttribution.js +1 -1
  25. package/dist/es2019/hooks/useErrorLogger.js +1 -1
  26. package/dist/es2019/hooks/useIsInPDFRender.js +1 -1
  27. package/dist/es2019/index.js +5 -5
  28. package/dist/es2019/services/__clearUnitsRolloutSettingsCacheForTests.js +8 -0
  29. package/dist/es2019/services/fetchObjectSchema.js +1 -1
  30. package/dist/es2019/services/fetchObjectSchemas.js +1 -1
  31. package/dist/es2019/services/getAvailableSites.js +2 -2
  32. package/dist/es2019/services/getUnitsRolloutSettings.js +112 -0
  33. package/dist/es2019/services/getWorkspaceId.js +1 -1
  34. package/dist/es2019/services/isUnitsIsolationEnabled.js +34 -0
  35. package/dist/es2019/services/resolvePrimaryWorkspace.js +1 -1
  36. package/dist/es2019/services/useBasicFilterAGG.js +1 -1
  37. package/dist/es2019/services/validateAql.js +1 -1
  38. package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +1 -1
  39. package/dist/es2019/ui/assets-modal/search-container/aql-search-input/loading-state.js +1 -1
  40. package/dist/es2019/ui/assets-modal/search-container/object-schema-select/loading-state.js +1 -1
  41. package/dist/es2019/ui/common/modal/popup-select/index.js +1 -1
  42. package/dist/es2019/ui/confluence-search-modal/modal/PlainConfluenceSearchConfigModal.js +1 -1
  43. package/dist/es2019/ui/issue-like-table/empty-state/index.js +1 -1
  44. package/dist/es2019/ui/issue-like-table/issue-like-data-table-view.js +1 -1
  45. package/dist/es2019/ui/jira-issues-modal/modal/index.js +1 -1
  46. package/dist/esm/analytics/xpc/useDatasourceCrossProductAttribution.js +1 -1
  47. package/dist/esm/hooks/useErrorLogger.js +1 -1
  48. package/dist/esm/hooks/useIsInPDFRender.js +1 -1
  49. package/dist/esm/index.js +5 -5
  50. package/dist/esm/services/__clearUnitsRolloutSettingsCacheForTests.js +8 -0
  51. package/dist/esm/services/fetchObjectSchema.js +1 -1
  52. package/dist/esm/services/fetchObjectSchemas.js +1 -1
  53. package/dist/esm/services/getAvailableSites.js +32 -19
  54. package/dist/esm/services/getUnitsRolloutSettings.js +192 -0
  55. package/dist/esm/services/getWorkspaceId.js +1 -1
  56. package/dist/esm/services/isUnitsIsolationEnabled.js +57 -0
  57. package/dist/esm/services/resolvePrimaryWorkspace.js +1 -1
  58. package/dist/esm/services/useBasicFilterAGG.js +1 -1
  59. package/dist/esm/services/validateAql.js +1 -1
  60. package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +1 -1
  61. package/dist/esm/ui/assets-modal/search-container/aql-search-input/loading-state.js +1 -1
  62. package/dist/esm/ui/assets-modal/search-container/object-schema-select/loading-state.js +1 -1
  63. package/dist/esm/ui/common/modal/popup-select/index.js +1 -1
  64. package/dist/esm/ui/confluence-search-modal/modal/PlainConfluenceSearchConfigModal.js +1 -1
  65. package/dist/esm/ui/issue-like-table/empty-state/index.js +1 -1
  66. package/dist/esm/ui/issue-like-table/issue-like-data-table-view.js +1 -1
  67. package/dist/esm/ui/jira-issues-modal/modal/index.js +1 -1
  68. package/dist/types/common/utils/locale/fetch-messages-for-locale.d.ts +1 -1
  69. package/dist/types/index.d.ts +5 -5
  70. package/dist/types/services/__clearUnitsRolloutSettingsCacheForTests.d.ts +4 -0
  71. package/dist/types/services/getUnitsRolloutSettings.d.ts +29 -0
  72. package/dist/types/services/isUnitsIsolationEnabled.d.ts +15 -0
  73. package/dist/types/ui/common/modal/datasource-context/DatasourceContextProviderProps.d.ts +1 -1
  74. package/dist/types/ui/common/modal/datasource-modal/createDatasourceModal.d.ts +1 -1
  75. package/examples-helpers/buildAssetsIssuesTable.tsx +1 -1
  76. package/examples-helpers/buildConfluenceSearchTable.tsx +2 -2
  77. package/examples-helpers/buildIssueLikeTable.tsx +1 -1
  78. package/examples-helpers/buildIssueLikeTableLoadingError.tsx +1 -1
  79. package/examples-helpers/buildJiraIssuesTable.tsx +3 -2
  80. package/examples-helpers/smartLinkCustomClient.ts +1 -1
  81. package/package.json +14 -6
@@ -1,10 +1,10 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { mapAccessibleProductsToAvailableSites } from '@atlaskit/linking-common/hooks';
4
- import { fg } from '@atlaskit/platform-feature-flags/fg';
4
+ import { isUnitsIsolationEnabled } from './isUnitsIsolationEnabled';
5
5
  export var getAccessibleProducts = /*#__PURE__*/function () {
6
6
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(product) {
7
- var requestConfig, endpoint, response, res, _t, _t2, _t3;
7
+ var requestConfig, endpoint, response, res, _t, _t2, _t3, _t4;
8
8
  return _regeneratorRuntime.wrap(function (_context) {
9
9
  while (1) switch (_context.prev = _context.next) {
10
10
  case 0:
@@ -20,35 +20,48 @@ export var getAccessibleProducts = /*#__PURE__*/function () {
20
20
  productIds: product === 'confluence' ? ['confluence.ondemand'] : ['jira-software.ondemand', 'jira-core.ondemand', 'jira-incident-manager.ondemand', 'jira-product-discovery', 'jira-servicedesk.ondemand']
21
21
  })
22
22
  };
23
- endpoint = fg('linking_platform_link_datasource_unit_compliant') ? '/gateway/api/experimental/v2/accessible-products' : '/gateway/api/v2/accessible-products';
24
23
  _context.next = 1;
25
- return fetch(endpoint, requestConfig);
24
+ return isUnitsIsolationEnabled();
26
25
  case 1:
27
- response = _context.sent;
28
- if (!response.ok) {
29
- _context.next = 3;
26
+ if (!_context.sent) {
27
+ _context.next = 2;
30
28
  break;
31
29
  }
32
- _context.next = 2;
33
- return response.json();
30
+ _t = '/gateway/api/experimental/v2/accessible-products';
31
+ _context.next = 3;
32
+ break;
34
33
  case 2:
35
- res = _context.sent;
36
- return _context.abrupt("return", mapAccessibleProductsToAvailableSites(res.data));
34
+ _t = '/gateway/api/v2/accessible-products';
37
35
  case 3:
38
- _t = Error;
36
+ endpoint = _t;
39
37
  _context.next = 4;
40
- return response.text();
38
+ return fetch(endpoint, requestConfig);
41
39
  case 4:
42
- _t2 = _context.sent;
43
- if (_t2) {
44
- _context.next = 5;
40
+ response = _context.sent;
41
+ if (!response.ok) {
42
+ _context.next = 6;
45
43
  break;
46
44
  }
47
- _t2 = 'Something went wrong';
45
+ _context.next = 5;
46
+ return response.json();
48
47
  case 5:
49
- _t3 = _t2;
50
- throw new _t(_t3);
48
+ res = _context.sent;
49
+ return _context.abrupt("return", mapAccessibleProductsToAvailableSites(res.data));
51
50
  case 6:
51
+ _t2 = Error;
52
+ _context.next = 7;
53
+ return response.text();
54
+ case 7:
55
+ _t3 = _context.sent;
56
+ if (_t3) {
57
+ _context.next = 8;
58
+ break;
59
+ }
60
+ _t3 = 'Something went wrong';
61
+ case 8:
62
+ _t4 = _t3;
63
+ throw new _t2(_t4);
64
+ case 9:
52
65
  case "end":
53
66
  return _context.stop();
54
67
  }
@@ -0,0 +1,192 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
+ import { request } from '@atlaskit/linking-common';
7
+ var AGG_URL = '/gateway/api/graphql';
8
+ var TENANT_CONTEXT_OPERATION_NAME = 'link_datasource_tenantContext';
9
+ var UNITS_ROLLOUT_SETTINGS_OPERATION_NAME = 'link_datasource_unitSettings';
10
+
11
+ /**
12
+ * `Query.admin_unitSettings` is keyed by org id, which the browser does not know, so the org id
13
+ * is resolved from the host the product is currently served from.
14
+ */
15
+ export var tenantContextQuery = "\n\tquery ".concat(TENANT_CONTEXT_OPERATION_NAME, "($hostNames: [String!]) {\n\t\ttenantContexts(hostNames: $hostNames) {\n\t\t\torgId\n\t\t}\n\t}\n");
16
+
17
+ /**
18
+ * `admin_unitSettings` exposes both flags of the rollout and is callable with the session of the
19
+ * end user, so no opt-in directive or admin OAuth scope is needed from the browser.
20
+ */
21
+ export var unitsRolloutSettingsQuery = "\n\tquery ".concat(UNITS_ROLLOUT_SETTINGS_OPERATION_NAME, "($orgId: ID!) {\n\t\tadmin_unitSettings(orgId: $orgId) {\n\t\t\tboundaryEnforced\n\t\t\tendUsersLaunched\n\t\t}\n\t}\n");
22
+ /**
23
+ * When the rollout settings cannot be resolved we keep the pre-isolation behaviour, which is
24
+ * what every org gets today while the unit settings are unset. The settings are only
25
+ * written when an org is activated - they are not backfilled - so `null` is expected for orgs
26
+ * that have not been activated yet and must be read as `false`.
27
+ */
28
+ var DEFAULT_SETTINGS = {
29
+ boundaryEnforced: false,
30
+ endUsersLaunched: false
31
+ };
32
+
33
+ /**
34
+ * Holds the in-flight/resolved request so that the settings are only fetched once per page load.
35
+ */
36
+ export var cache = {};
37
+
38
+ /**
39
+ * AGG answers with a 200 and an `errors` array for query level failures, so those have to be
40
+ * turned into a rejection explicitly rather than being read as an empty response.
41
+ */
42
+ var requestGraphQL = /*#__PURE__*/function () {
43
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(operationName, query, variables) {
44
+ var _response$errors, _response$data;
45
+ var response, messages;
46
+ return _regeneratorRuntime.wrap(function (_context) {
47
+ while (1) switch (_context.prev = _context.next) {
48
+ case 0:
49
+ _context.next = 1;
50
+ return request('post', AGG_URL, {
51
+ operationName: operationName,
52
+ query: query,
53
+ variables: variables
54
+ });
55
+ case 1:
56
+ response = _context.sent;
57
+ if (!(response !== null && response !== void 0 && (_response$errors = response.errors) !== null && _response$errors !== void 0 && _response$errors.length)) {
58
+ _context.next = 2;
59
+ break;
60
+ }
61
+ messages = response.errors.map(function (error) {
62
+ return error === null || error === void 0 ? void 0 : error.message;
63
+ }).filter(Boolean).join(', ');
64
+ throw new Error("".concat(operationName, " failed: ").concat(messages || 'unknown error'));
65
+ case 2:
66
+ return _context.abrupt("return", (_response$data = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data !== void 0 ? _response$data : undefined);
67
+ case 3:
68
+ case "end":
69
+ return _context.stop();
70
+ }
71
+ }, _callee);
72
+ }));
73
+ return function requestGraphQL(_x, _x2, _x3) {
74
+ return _ref.apply(this, arguments);
75
+ };
76
+ }();
77
+ var fetchOrgId = /*#__PURE__*/function () {
78
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
79
+ var _window$location, _data$tenantContexts;
80
+ var hostName, data, _iterator, _step, tenantContext, _t;
81
+ return _regeneratorRuntime.wrap(function (_context2) {
82
+ while (1) switch (_context2.prev = _context2.next) {
83
+ case 0:
84
+ hostName = typeof window !== 'undefined' ? (_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname : undefined;
85
+ if (hostName) {
86
+ _context2.next = 1;
87
+ break;
88
+ }
89
+ return _context2.abrupt("return", undefined);
90
+ case 1:
91
+ _context2.next = 2;
92
+ return requestGraphQL(TENANT_CONTEXT_OPERATION_NAME, tenantContextQuery, {
93
+ hostNames: [hostName]
94
+ });
95
+ case 2:
96
+ data = _context2.sent;
97
+ _iterator = _createForOfIteratorHelper((_data$tenantContexts = data === null || data === void 0 ? void 0 : data.tenantContexts) !== null && _data$tenantContexts !== void 0 ? _data$tenantContexts : []);
98
+ _context2.prev = 3;
99
+ _iterator.s();
100
+ case 4:
101
+ if ((_step = _iterator.n()).done) {
102
+ _context2.next = 6;
103
+ break;
104
+ }
105
+ tenantContext = _step.value;
106
+ if (!(tenantContext !== null && tenantContext !== void 0 && tenantContext.orgId)) {
107
+ _context2.next = 5;
108
+ break;
109
+ }
110
+ return _context2.abrupt("return", tenantContext.orgId);
111
+ case 5:
112
+ _context2.next = 4;
113
+ break;
114
+ case 6:
115
+ _context2.next = 8;
116
+ break;
117
+ case 7:
118
+ _context2.prev = 7;
119
+ _t = _context2["catch"](3);
120
+ _iterator.e(_t);
121
+ case 8:
122
+ _context2.prev = 8;
123
+ _iterator.f();
124
+ return _context2.finish(8);
125
+ case 9:
126
+ return _context2.abrupt("return", undefined);
127
+ case 10:
128
+ case "end":
129
+ return _context2.stop();
130
+ }
131
+ }, _callee2, null, [[3, 7, 8, 9]]);
132
+ }));
133
+ return function fetchOrgId() {
134
+ return _ref2.apply(this, arguments);
135
+ };
136
+ }();
137
+ var fetchUnitsRolloutSettings = /*#__PURE__*/function () {
138
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
139
+ var _settings$boundaryEnf, _settings$endUsersLau;
140
+ var orgId, data, settings;
141
+ return _regeneratorRuntime.wrap(function (_context3) {
142
+ while (1) switch (_context3.prev = _context3.next) {
143
+ case 0:
144
+ _context3.next = 1;
145
+ return fetchOrgId();
146
+ case 1:
147
+ orgId = _context3.sent;
148
+ if (orgId) {
149
+ _context3.next = 2;
150
+ break;
151
+ }
152
+ return _context3.abrupt("return", DEFAULT_SETTINGS);
153
+ case 2:
154
+ _context3.next = 3;
155
+ return requestGraphQL(UNITS_ROLLOUT_SETTINGS_OPERATION_NAME, unitsRolloutSettingsQuery, {
156
+ orgId: orgId
157
+ });
158
+ case 3:
159
+ data = _context3.sent;
160
+ settings = data === null || data === void 0 ? void 0 : data.admin_unitSettings;
161
+ return _context3.abrupt("return", {
162
+ boundaryEnforced: (_settings$boundaryEnf = settings === null || settings === void 0 ? void 0 : settings.boundaryEnforced) !== null && _settings$boundaryEnf !== void 0 ? _settings$boundaryEnf : false,
163
+ endUsersLaunched: (_settings$endUsersLau = settings === null || settings === void 0 ? void 0 : settings.endUsersLaunched) !== null && _settings$endUsersLau !== void 0 ? _settings$endUsersLau : false
164
+ });
165
+ case 4:
166
+ case "end":
167
+ return _context3.stop();
168
+ }
169
+ }, _callee3);
170
+ }));
171
+ return function fetchUnitsRolloutSettings() {
172
+ return _ref3.apply(this, arguments);
173
+ };
174
+ }();
175
+
176
+ /**
177
+ * Reads the org's units rollout settings (`boundaryEnforced` and `endUsersLaunched`) from the
178
+ * TCS key exposed by AGG's `Query.admin_unitSettings`.
179
+ *
180
+ * The result is cached for the lifetime of the page because the settings only change when an
181
+ * admin activates or launches units, which requires a reload to be picked up anyway. A failed
182
+ * request is not cached so that a later call can retry.
183
+ */
184
+ export var getUnitsRolloutSettings = function getUnitsRolloutSettings() {
185
+ if (!cache.promise) {
186
+ cache.promise = fetchUnitsRolloutSettings().catch(function () {
187
+ cache.promise = undefined;
188
+ return DEFAULT_SETTINGS;
189
+ });
190
+ }
191
+ return cache.promise;
192
+ };
@@ -1,6 +1,6 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { request } from '@atlaskit/linking-common';
3
+ import { request } from '@atlaskit/linking-common/api';
4
4
  import { FetchError } from './FetchError';
5
5
  import { PermissionError } from './PermissionError';
6
6
  import { getStatusCodeGroup } from './getStatusCodeGroup';
@@ -0,0 +1,57 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
4
+ import { getUnitsRolloutSettings } from './getUnitsRolloutSettings';
5
+
6
+ /**
7
+ * Whether unit isolation behaviour should be applied for the current org.
8
+ *
9
+ * An org is isolated when units GA is on, the org has been opted in to the rollout - either by
10
+ * org id or by cloud id - *and* the org has actually launched units with boundary enforcement
11
+ * turned on:
12
+ *
13
+ * `cc-units-ga on -> (orgId gate on || cloudId gate on) -> endUsersLaunched && boundaryEnforced -> isolate`
14
+ *
15
+ * `cc-units-ga` is the units GA master gate and acts as the killswitch: while it is off nothing
16
+ * else is evaluated and the current, non-isolated behaviour is kept. The AGG call is only made
17
+ * when one of the rollout gates passes, so orgs outside of the rollout do not pay for an extra
18
+ * request.
19
+ */
20
+ export var isUnitsIsolationEnabled = /*#__PURE__*/function () {
21
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
22
+ var isOrgInRollout, isCloudInRollout, _yield$getUnitsRollou, boundaryEnforced, endUsersLaunched;
23
+ return _regeneratorRuntime.wrap(function (_context) {
24
+ while (1) switch (_context.prev = _context.next) {
25
+ case 0:
26
+ if (fg('cc-units-ga')) {
27
+ _context.next = 1;
28
+ break;
29
+ }
30
+ return _context.abrupt("return", false);
31
+ case 1:
32
+ // Both rollout gates are always evaluated so that exposure is recorded consistently.
33
+ isOrgInRollout = fg('linking_platform_link_datasource_unit_compliant');
34
+ isCloudInRollout = fg('linking_platform_link_datasource_unit_compliant_cloud_id');
35
+ if (!(!isOrgInRollout && !isCloudInRollout)) {
36
+ _context.next = 2;
37
+ break;
38
+ }
39
+ return _context.abrupt("return", false);
40
+ case 2:
41
+ _context.next = 3;
42
+ return getUnitsRolloutSettings();
43
+ case 3:
44
+ _yield$getUnitsRollou = _context.sent;
45
+ boundaryEnforced = _yield$getUnitsRollou.boundaryEnforced;
46
+ endUsersLaunched = _yield$getUnitsRollou.endUsersLaunched;
47
+ return _context.abrupt("return", boundaryEnforced && endUsersLaunched);
48
+ case 4:
49
+ case "end":
50
+ return _context.stop();
51
+ }
52
+ }, _callee);
53
+ }));
54
+ return function isUnitsIsolationEnabled() {
55
+ return _ref.apply(this, arguments);
56
+ };
57
+ }();
@@ -1,6 +1,6 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { request } from '@atlaskit/linking-common';
3
+ import { request } from '@atlaskit/linking-common/api';
4
4
  // Resolves the primary Unit workspace via the unit-aware resolver, keyed by the
5
5
  // current-site cloudId. Gated at the call-site behind
6
6
  // `astral_units_workspace_host_resolver`.
@@ -1,7 +1,7 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { useCallback, useMemo } from 'react';
4
- import { request } from '@atlaskit/linking-common';
4
+ import { request } from '@atlaskit/linking-common/api';
5
5
  import { fieldValuesQuery, hydrateJQLQuery, userHydration, userQuery } from './utils';
6
6
  var AGG_BASE_URL = '/gateway/api/graphql';
7
7
  export var useBasicFilterAGG = function useBasicFilterAGG() {
@@ -1,6 +1,6 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { request } from '@atlaskit/linking-common';
3
+ import { request } from '@atlaskit/linking-common/api';
4
4
  import { FetchError } from './FetchError';
5
5
  import { PermissionError } from './PermissionError';
6
6
  import { getStatusCodeGroup } from './getStatusCodeGroup';
@@ -7,7 +7,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
7
7
  import { AccessRequired } from '../../../common/error-state/access-required';
8
8
  import { ModalLoadingError } from '../../../common/error-state/modal-loading-error';
9
9
  import { NoResults } from '../../../common/error-state/no-results';
10
- import { EmptyState } from '../../../issue-like-table';
10
+ import EmptyState from '../../../issue-like-table/empty-state';
11
11
  import { IssueLikeDataTableView } from '../../../issue-like-table/issue-like-data-table-view';
12
12
  import { InitialStateView } from './initial-state-view';
13
13
  export var MODAL_HEIGHT = 420;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Skeleton } from '@atlaskit/linking-common';
2
+ import { Skeleton } from '@atlaskit/linking-common/skeleton';
3
3
  export var AssetsAqlSearchInputSkeleton = function AssetsAqlSearchInputSkeleton() {
4
4
  return /*#__PURE__*/React.createElement(Skeleton, {
5
5
  width: "100%",
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Skeleton } from '@atlaskit/linking-common';
2
+ import { Skeleton } from '@atlaskit/linking-common/skeleton';
3
3
  export var AssetsObjectSchemaSelectSkeleton = function AssetsObjectSchemaSelectSkeleton() {
4
4
  return /*#__PURE__*/React.createElement(Skeleton, {
5
5
  width: "100%",
@@ -13,7 +13,7 @@ import isEqual from 'lodash/isEqual';
13
13
  import { useIntl } from 'react-intl';
14
14
  import { PopupSelect } from '@atlaskit/select/popup-select';
15
15
  import { useDatasourceAnalyticsEvents } from '../../../../analytics';
16
- import CustomControl from './control';
16
+ import { CustomControl } from './CustomControl';
17
17
  import { CustomCheckboxOption } from './custom-checkbox-option';
18
18
  import CustomDropdownIndicator from './dropdownIndicator';
19
19
  import PopupFooter from './footer';
@@ -41,7 +41,7 @@ import { DatasourceViewModeDropDown } from '../../common/modal/mode-switcher/Dat
41
41
  import { useViewModeContext } from '../../common/modal/mode-switcher/useViewModeContext';
42
42
  import TableSearchCount from '../../common/modal/search-count';
43
43
  import { SiteSelector } from '../../common/modal/site-selector';
44
- import { EmptyState } from '../../issue-like-table';
44
+ import EmptyState from '../../issue-like-table/empty-state';
45
45
  import ConfluenceSearchContainer from '../confluence-search-container';
46
46
  import { confluenceSearchModalMessages } from './messages';
47
47
  var styles = {
@@ -8,7 +8,7 @@ import * as React from 'react';
8
8
  import { ax, ix } from "@compiled/react/runtime";
9
9
  /* eslint-disable @atlaskit/design-system/use-tokens-typography */
10
10
 
11
- import { Skeleton } from '@atlaskit/linking-common';
11
+ import { Skeleton } from '@atlaskit/linking-common/skeleton';
12
12
  var SkeletonComponent = function SkeletonComponent(_ref) {
13
13
  var width = _ref.width,
14
14
  itemName = _ref.itemName;
@@ -27,7 +27,7 @@ import Button from '@atlaskit/button/default/button';
27
27
  import { FlagsProvider } from '@atlaskit/flag/flags-provider';
28
28
  import SortAscendingIcon from '@atlaskit/icon/core/sort-ascending';
29
29
  import SortDescendingIcon from '@atlaskit/icon/core/sort-descending';
30
- import { Skeleton } from '@atlaskit/linking-common';
30
+ import { Skeleton } from '@atlaskit/linking-common/skeleton';
31
31
  import { fg } from '@atlaskit/platform-feature-flags/fg';
32
32
  import { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge/extract-closest-edge';
33
33
  import { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';
@@ -56,7 +56,7 @@ import { DatasourceViewModeDropDown } from '../../common/modal/mode-switcher/Dat
56
56
  import { useViewModeContext } from '../../common/modal/mode-switcher/useViewModeContext';
57
57
  import TableSearchCount from '../../common/modal/search-count';
58
58
  import { SiteSelector } from '../../common/modal/site-selector';
59
- import { EmptyState } from '../../issue-like-table';
59
+ import EmptyState from '../../issue-like-table/empty-state';
60
60
  import { availableBasicFilterTypes } from '../basic-filters/ui';
61
61
  import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
62
62
  import { JiraSearchContainer } from '../jira-search-container';
@@ -1,2 +1,2 @@
1
- import type { I18NMessages } from '@atlaskit/intl-messages-provider/types';
1
+ import type { I18NMessages } from '@atlaskit/intl-messages-provider/common/types';
2
2
  export declare const fetchMessagesForLocale: (locale: string) => Promise<I18NMessages | undefined>;
@@ -1,13 +1,13 @@
1
1
  /** @deprecated Use @atlaskit/link-datasource/confluence-search-modal */
2
- export { default as ConfluenceSearchConfigModal } from './ui/confluence-search-modal';
2
+ export { ConfluenceSearchConfigModalWithWrappers as ConfluenceSearchConfigModal } from './ui/confluence-search-modal/ConfluenceSearchConfigModalWithWrappers';
3
3
  /** @deprecated Use @atlaskit/link-datasource/jira-issues-modal */
4
- export { default as JiraIssuesConfigModal } from './ui/jira-issues-modal';
4
+ export { JiraIssuesConfigModalWithWrappers as JiraIssuesConfigModal } from './ui/jira-issues-modal/JiraIssuesConfigModalWithWrappers';
5
5
  /** @deprecated Use @atlaskit/link-datasource/assets-modal */
6
- export { default as AssetsConfigModal } from './ui/assets-modal';
6
+ export { AssetsConfigModalWithWrappers as AssetsConfigModal } from './ui/assets-modal/AssetsConfigModalWithWrappers';
7
7
  /** @deprecated Use @atlaskit/link-datasource/datasource-table-view */
8
- export { default as DatasourceTableView } from './ui/datasource-table-view';
8
+ export { DatasourceTableViewWithWrappers as DatasourceTableView } from './ui/datasource-table-view/DatasourceTableViewWithWrappers';
9
9
  /** @deprecated Use @atlaskit/link-datasource/assets-modal (AssetsConfigModal) */
10
- export { default as JSMAssetsConfigModal } from './ui/assets-modal';
10
+ export { AssetsConfigModalWithWrappers as JSMAssetsConfigModal } from './ui/assets-modal/AssetsConfigModalWithWrappers';
11
11
  /** @deprecated Use @atlaskit/link-datasource/utils/schema */
12
12
  export { buildDatasourceAdf } from './common/utils/schema-utils';
13
13
  /** @deprecated Use @atlaskit/link-datasource/jira-issues-modal/types */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Test-only: clear the cached units rollout settings so each test starts with a clean slate.
3
+ */
4
+ export declare const __clearUnitsRolloutSettingsCacheForTests: () => void;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * `Query.admin_unitSettings` is keyed by org id, which the browser does not know, so the org id
3
+ * is resolved from the host the product is currently served from.
4
+ */
5
+ export declare const tenantContextQuery: string;
6
+ /**
7
+ * `admin_unitSettings` exposes both flags of the rollout and is callable with the session of the
8
+ * end user, so no opt-in directive or admin OAuth scope is needed from the browser.
9
+ */
10
+ export declare const unitsRolloutSettingsQuery: string;
11
+ export interface UnitsRolloutSettings {
12
+ boundaryEnforced: boolean;
13
+ endUsersLaunched: boolean;
14
+ }
15
+ /**
16
+ * Holds the in-flight/resolved request so that the settings are only fetched once per page load.
17
+ */
18
+ export declare const cache: {
19
+ promise?: Promise<UnitsRolloutSettings>;
20
+ };
21
+ /**
22
+ * Reads the org's units rollout settings (`boundaryEnforced` and `endUsersLaunched`) from the
23
+ * TCS key exposed by AGG's `Query.admin_unitSettings`.
24
+ *
25
+ * The result is cached for the lifetime of the page because the settings only change when an
26
+ * admin activates or launches units, which requires a reload to be picked up anyway. A failed
27
+ * request is not cached so that a later call can retry.
28
+ */
29
+ export declare const getUnitsRolloutSettings: () => Promise<UnitsRolloutSettings>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Whether unit isolation behaviour should be applied for the current org.
3
+ *
4
+ * An org is isolated when units GA is on, the org has been opted in to the rollout - either by
5
+ * org id or by cloud id - *and* the org has actually launched units with boundary enforcement
6
+ * turned on:
7
+ *
8
+ * `cc-units-ga on -> (orgId gate on || cloudId gate on) -> endUsersLaunched && boundaryEnforced -> isolate`
9
+ *
10
+ * `cc-units-ga` is the units GA master gate and acts as the killswitch: while it is off nothing
11
+ * else is evaluated and the current, non-isolated behaviour is kept. The AGG call is only made
12
+ * when one of the rollout gates passes, so orgs outside of the rollout do not pay for an extra
13
+ * request.
14
+ */
15
+ export declare const isUnitsIsolationEnabled: () => Promise<boolean>;
@@ -1,5 +1,5 @@
1
1
  import { type PropsWithChildren } from 'react';
2
- import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common';
2
+ import type { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
3
3
  import type { DatasourceParameters } from '@atlaskit/linking-types/datasource';
4
4
  import { type OnInsertFunction } from '../../../../common/types';
5
5
  import type { ColumnSizesMap } from '../../../issue-like-table/types';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common';
2
+ import type { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
3
3
  import type { DatasourceParameters } from '@atlaskit/linking-types/datasource';
4
4
  import { type ConfigModalProps } from '../../../../common/types';
5
5
  export type ConnectedConfigModalProps<Parameters extends DatasourceParameters> = Omit<ConfigModalProps<DatasourceAdf<Parameters> | InlineCardAdf, Parameters>, 'onInsert' | 'parameters'>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import IntlMessagesProvider from '@atlaskit/intl-messages-provider/main';
4
4
  import type { DatasourceTableViewWithWrappers as DatasourceTableView } from '@atlaskit/link-datasource/datasource-table-view-with-wrappers';
5
- import { SmartCardProvider } from '@atlaskit/link-provider';
5
+ import { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';
6
6
  import type { DatasourceParameters } from '@atlaskit/linking-types/datasource';
7
7
 
8
8
  import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
@@ -1,11 +1,11 @@
1
1
  import React, { useEffect, useMemo } from 'react';
2
2
 
3
3
  import IntlMessagesProvider from '@atlaskit/intl-messages-provider/main';
4
- import { SmartCardProvider } from '@atlaskit/link-provider';
4
+ import { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';
5
5
  import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
6
6
  import type { DatasourceParameters } from '@atlaskit/linking-types/datasource';
7
7
 
8
- import DatasourceTableView from '../src/ui/datasource-table-view';
8
+ import { DatasourceTableViewWithWrappers as DatasourceTableView } from '../src/ui/datasource-table-view/DatasourceTableViewWithWrappers';
9
9
  import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
10
10
  import { type ConfluenceSearchDatasourceParameters } from '../src/ui/confluence-search-modal/types';
11
11
 
@@ -8,7 +8,7 @@ import { useEffect, useMemo } from 'react';
8
8
  import { jsx, styled } from '@compiled/react';
9
9
 
10
10
  import IntlMessagesProvider from '@atlaskit/intl-messages-provider/main';
11
- import { SmartCardProvider } from '@atlaskit/link-provider';
11
+ import { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';
12
12
  import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
13
13
  import { Text } from '@atlaskit/primitives/compiled';
14
14
 
@@ -5,7 +5,7 @@
5
5
  import { jsx, styled } from '@compiled/react';
6
6
 
7
7
  import IntlMessagesProvider from '@atlaskit/intl-messages-provider/main';
8
- import { SmartCardProvider } from '@atlaskit/link-provider';
8
+ import { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';
9
9
  import { token } from '@atlaskit/tokens';
10
10
 
11
11
  import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
@@ -1,10 +1,11 @@
1
1
  import React, { useMemo } from 'react';
2
2
 
3
3
  import IntlMessagesProvider from '@atlaskit/intl-messages-provider/main';
4
- import { type ProviderProps, SmartCardProvider } from '@atlaskit/link-provider';
4
+ import type { CardProviderProps as ProviderProps } from '@atlaskit/link-provider/types';
5
+ import { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';
5
6
  import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
6
7
 
7
- import { type DatasourceTableView } from '../src';
8
+ import { type DatasourceTableViewWithWrappers as DatasourceTableView } from '../src/ui/datasource-table-view/DatasourceTableViewWithWrappers';
8
9
  import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
9
10
  import { DatasourceExperienceIdProvider } from '../src/contexts/datasource-experience-id/datasource-experience-id-provider';
10
11
  import { DataSourceTableViewNoSuspense } from '../src/ui/datasource-table-view/datasourceTableView';
@@ -1,5 +1,5 @@
1
1
  import type { JsonLd } from '@atlaskit/json-ld-types/jsonld';
2
- import { CardClient } from '@atlaskit/link-provider';
2
+ import CardClient from '@atlaskit/link-provider/client';
3
3
  import { APIError } from '@atlaskit/linking-common';
4
4
 
5
5
  import { mockJqlSmartLinkData } from './mockJqlSmartLinkData';