@atlaskit/smart-card 26.52.4 → 26.52.5

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 (31) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/constants.js +1 -1
  3. package/dist/cjs/messages.js +2 -2
  4. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +6 -10
  5. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/readStream.js +125 -0
  6. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/utils.js +0 -119
  7. package/dist/cjs/utils/analytics/analytics.js +1 -1
  8. package/dist/cjs/view/LinkUrl/index.js +1 -1
  9. package/dist/es2019/constants.js +1 -1
  10. package/dist/es2019/messages.js +2 -2
  11. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +6 -11
  12. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/readStream.js +48 -0
  13. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/utils.js +0 -47
  14. package/dist/es2019/utils/analytics/analytics.js +1 -1
  15. package/dist/es2019/view/LinkUrl/index.js +1 -1
  16. package/dist/esm/constants.js +1 -1
  17. package/dist/esm/messages.js +2 -2
  18. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +6 -10
  19. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/readStream.js +118 -0
  20. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/utils.js +0 -117
  21. package/dist/esm/utils/analytics/analytics.js +1 -1
  22. package/dist/esm/view/LinkUrl/index.js +1 -1
  23. package/dist/types/constants.d.ts +1 -1
  24. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/readStream.d.ts +1 -0
  25. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +6 -1
  26. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/utils.d.ts +0 -1
  27. package/dist/types-ts4.5/constants.d.ts +1 -1
  28. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/readStream.d.ts +1 -0
  29. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +6 -1
  30. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/utils.d.ts +0 -1
  31. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.52.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#89065](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89065) [`9276d00960ff`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9276d00960ff) - [ux] AI Link Summary Generic Error text has been updated.
8
+ - [#87848](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87848) [`b7121232bf12`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b7121232bf12) - Tests for link AI Summary Service added.
9
+
3
10
  ## 26.52.4
4
11
 
5
12
  ### Patch Changes
@@ -7,7 +7,7 @@ exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = expo
7
7
  var CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links';
8
8
  var CONTENT_URL_3P_ACCOUNT_AUTH = exports.CONTENT_URL_3P_ACCOUNT_AUTH = 'https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/';
9
9
  var CONTENT_URL_AI = exports.CONTENT_URL_AI = 'https://www.atlassian.com/trust/atlassian-intelligence';
10
- var CONTENT_URL_AI_TROUBLESHOOTING = exports.CONTENT_URL_AI_TROUBLESHOOTING = 'https://support.atlassian.com/organization-administration/docs/troubleshooting-for-atlassian-intelligence/';
10
+ var CONTENT_URL_AI_TROUBLESHOOTING = exports.CONTENT_URL_AI_TROUBLESHOOTING = 'https://status.atlassian.com/';
11
11
  var CONTENT_URL_ACCEPTABLE_USE_POLICY = exports.CONTENT_URL_ACCEPTABLE_USE_POLICY = 'https://www.atlassian.com/legal/acceptable-use-policy';
12
12
 
13
13
  /**
@@ -43,8 +43,8 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
43
43
  },
44
44
  ai_summary_error_generic: {
45
45
  id: 'fabric.linking.ai_summary_error_generic',
46
- defaultMessage: "Atlassian Intelligence can't provide a response right now. Read more <a>in our support documentation</a>.",
47
- description: 'Shown when AI summary is summarising the link resource content.'
46
+ defaultMessage: 'Atlassian Intelligence (AI) isn’t responding. Try again later or <a>check the status of AI</a>.',
47
+ description: 'Shown when AI Summary encountered an unexpected error while summarizing the linked resource content.'
48
48
  },
49
49
  ai_summary_error_acceptable_use_violation: {
50
50
  id: 'fabric.linking.ai_summary_error_acceptable_use_violation',
@@ -13,6 +13,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
13
13
  var _uuid = _interopRequireDefault(require("uuid"));
14
14
  var _types = require("./types");
15
15
  var _utils = require("./utils");
16
+ var _readStream = require("./readStream");
16
17
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
17
18
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
19
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -60,25 +61,20 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
60
61
  }
61
62
  throw new Error("Status: ".concat(response.status, "\n URL: ").concat(_this.url, "\n StatusText ").concat(response.statusText));
62
63
  case 11:
63
- return _context.abrupt("return", (0, _utils.readStream)(response));
64
+ return _context.abrupt("return", (0, _readStream.readStream)(response));
64
65
  case 12:
65
66
  case "end":
66
67
  return _context.stop();
67
68
  }
68
69
  }, _callee);
69
70
  })));
70
- var defaultConfig = {
71
- baseUrl: '/gateway/api/assist',
72
- headers: {
71
+ this.config = {
72
+ baseUrl: props.baseUrl || '/gateway/api/assist',
73
+ headers: _objectSpread({
73
74
  'Content-Type': 'application/json;charset=UTF-8',
74
75
  'x-experience-id': 'smart-link',
75
- //TODO: EDM-9337 - Remove the hardcoded Confluence product name and find a way to populate the product name here
76
76
  'x-product': props.product || 'confluence'
77
- }
78
- };
79
- this.config = {
80
- baseUrl: props.baseUrl || defaultConfig.baseUrl,
81
- headers: _objectSpread({}, props.headers || defaultConfig.headers)
77
+ }, props.headers)
82
78
  };
83
79
  this.url = props.url;
84
80
  this.ari = props.ari;
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.readStream = readStream;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _awaitAsyncGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/awaitAsyncGenerator"));
10
+ var _wrapAsyncGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapAsyncGenerator"));
11
+ var _utils = require("./utils");
12
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
+ function readStream(_x) {
16
+ return _readStream.apply(this, arguments);
17
+ }
18
+ function _readStream() {
19
+ _readStream = (0, _wrapAsyncGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response) {
20
+ var reader, doneStreaming, chunkBuffer, chunkTypeErrorMessage, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
21
+ return _regenerator.default.wrap(function _callee$(_context) {
22
+ while (1) switch (_context.prev = _context.next) {
23
+ case 0:
24
+ reader = (0, _utils.getBufferReader)(response);
25
+ doneStreaming = false;
26
+ chunkBuffer = '';
27
+ chunkTypeErrorMessage = 'jsonChunkType error';
28
+ case 4:
29
+ _context.prev = 4;
30
+ _context.next = 7;
31
+ return (0, _awaitAsyncGenerator2.default)(reader.read());
32
+ case 7:
33
+ _yield$_awaitAsyncGen = _context.sent;
34
+ value = _yield$_awaitAsyncGen.value;
35
+ done = _yield$_awaitAsyncGen.done;
36
+ doneStreaming = done;
37
+ if (!value) {
38
+ _context.next = 42;
39
+ break;
40
+ }
41
+ processedChunks = "".concat(chunkBuffer).concat(value).split('\n'); // assumes that all JSON chunks are separated by a new-line;
42
+ chunkBuffer = '';
43
+ _iterator = _createForOfIteratorHelper(processedChunks);
44
+ _context.prev = 15;
45
+ _iterator.s();
46
+ case 17:
47
+ if ((_step = _iterator.n()).done) {
48
+ _context.next = 34;
49
+ break;
50
+ }
51
+ chunk = _step.value;
52
+ _context.prev = 19;
53
+ jsonChunk = JSON.parse(chunk);
54
+ if (!(jsonChunk.type === 'ERROR')) {
55
+ _context.next = 23;
56
+ break;
57
+ }
58
+ throw new Error(chunkTypeErrorMessage);
59
+ case 23:
60
+ _context.next = 25;
61
+ return jsonChunk;
62
+ case 25:
63
+ _context.next = 32;
64
+ break;
65
+ case 27:
66
+ _context.prev = 27;
67
+ _context.t0 = _context["catch"](19);
68
+ if (!(_context.t0 instanceof Error && _context.t0.message === chunkTypeErrorMessage)) {
69
+ _context.next = 31;
70
+ break;
71
+ }
72
+ throw _context.t0;
73
+ case 31:
74
+ // the chunk may be incomplete, so we'll save it for the next iteration.
75
+ chunkBuffer = chunk;
76
+ case 32:
77
+ _context.next = 17;
78
+ break;
79
+ case 34:
80
+ _context.next = 39;
81
+ break;
82
+ case 36:
83
+ _context.prev = 36;
84
+ _context.t1 = _context["catch"](15);
85
+ _iterator.e(_context.t1);
86
+ case 39:
87
+ _context.prev = 39;
88
+ _iterator.f();
89
+ return _context.finish(39);
90
+ case 42:
91
+ _context.next = 52;
92
+ break;
93
+ case 44:
94
+ _context.prev = 44;
95
+ _context.t2 = _context["catch"](4);
96
+ if (!(_context.t2 instanceof DOMException && _context.t2.name === 'AbortError')) {
97
+ _context.next = 50;
98
+ break;
99
+ }
100
+ doneStreaming = true;
101
+ _context.next = 52;
102
+ break;
103
+ case 50:
104
+ reader.cancel();
105
+ throw _context.t2;
106
+ case 52:
107
+ if (!doneStreaming) {
108
+ _context.next = 4;
109
+ break;
110
+ }
111
+ case 53:
112
+ if (!chunkBuffer) {
113
+ _context.next = 56;
114
+ break;
115
+ }
116
+ error = new Error("Not all the data was processed: ".concat(chunkBuffer));
117
+ throw error;
118
+ case 56:
119
+ case "end":
120
+ return _context.stop();
121
+ }
122
+ }, _callee, null, [[4, 44], [15, 36, 39, 42], [19, 27]]);
123
+ }));
124
+ return _readStream.apply(this, arguments);
125
+ }
@@ -1,128 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.getBufferReader = exports.addPath = void 0;
8
- exports.readStream = readStream;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _awaitAsyncGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/awaitAsyncGenerator"));
11
- var _wrapAsyncGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapAsyncGenerator"));
12
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
13
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
- function readStream(_x) {
16
- return _readStream.apply(this, arguments);
17
- }
18
- function _readStream() {
19
- _readStream = (0, _wrapAsyncGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(response) {
20
- var reader, doneStreaming, chunkBuffer, chunkTypeErrorMessage, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
21
- return _regenerator.default.wrap(function _callee$(_context) {
22
- while (1) switch (_context.prev = _context.next) {
23
- case 0:
24
- reader = getBufferReader(response);
25
- doneStreaming = false;
26
- chunkBuffer = '';
27
- chunkTypeErrorMessage = 'jsonChunkType error';
28
- case 4:
29
- _context.prev = 4;
30
- _context.next = 7;
31
- return (0, _awaitAsyncGenerator2.default)(reader.read());
32
- case 7:
33
- _yield$_awaitAsyncGen = _context.sent;
34
- value = _yield$_awaitAsyncGen.value;
35
- done = _yield$_awaitAsyncGen.done;
36
- doneStreaming = done;
37
- if (!value) {
38
- _context.next = 42;
39
- break;
40
- }
41
- processedChunks = "".concat(chunkBuffer).concat(value).split('\n'); // assumes that all JSON chunks are separated by a new-line;
42
- chunkBuffer = '';
43
- _iterator = _createForOfIteratorHelper(processedChunks);
44
- _context.prev = 15;
45
- _iterator.s();
46
- case 17:
47
- if ((_step = _iterator.n()).done) {
48
- _context.next = 34;
49
- break;
50
- }
51
- chunk = _step.value;
52
- _context.prev = 19;
53
- jsonChunk = JSON.parse(chunk);
54
- if (!(jsonChunk.type === 'ERROR')) {
55
- _context.next = 23;
56
- break;
57
- }
58
- throw new Error(chunkTypeErrorMessage);
59
- case 23:
60
- _context.next = 25;
61
- return jsonChunk;
62
- case 25:
63
- _context.next = 32;
64
- break;
65
- case 27:
66
- _context.prev = 27;
67
- _context.t0 = _context["catch"](19);
68
- if (!(_context.t0 instanceof Error && _context.t0.message === chunkTypeErrorMessage)) {
69
- _context.next = 31;
70
- break;
71
- }
72
- throw _context.t0;
73
- case 31:
74
- // the chunk may be incomplete, so we'll save it for the next iteration.
75
- chunkBuffer = chunk;
76
- case 32:
77
- _context.next = 17;
78
- break;
79
- case 34:
80
- _context.next = 39;
81
- break;
82
- case 36:
83
- _context.prev = 36;
84
- _context.t1 = _context["catch"](15);
85
- _iterator.e(_context.t1);
86
- case 39:
87
- _context.prev = 39;
88
- _iterator.f();
89
- return _context.finish(39);
90
- case 42:
91
- _context.next = 52;
92
- break;
93
- case 44:
94
- _context.prev = 44;
95
- _context.t2 = _context["catch"](4);
96
- if (!(_context.t2 instanceof DOMException && _context.t2.name === 'AbortError')) {
97
- _context.next = 50;
98
- break;
99
- }
100
- doneStreaming = true;
101
- _context.next = 52;
102
- break;
103
- case 50:
104
- reader.cancel();
105
- throw _context.t2;
106
- case 52:
107
- if (!doneStreaming) {
108
- _context.next = 4;
109
- break;
110
- }
111
- case 53:
112
- if (!chunkBuffer) {
113
- _context.next = 56;
114
- break;
115
- }
116
- error = new Error("Not all the data was processed: ".concat(chunkBuffer));
117
- throw error;
118
- case 56:
119
- case "end":
120
- return _context.stop();
121
- }
122
- }, _callee, null, [[4, 44], [15, 36, 39, 42], [19, 27]]);
123
- }));
124
- return _readStream.apply(this, arguments);
125
- }
126
7
  var getBufferReader = exports.getBufferReader = function getBufferReader(response) {
127
8
  if (!response.body) {
128
9
  throw new Error('Response body is empty');
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
22
22
  var context = exports.context = {
23
23
  componentName: 'smart-cards',
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "26.52.4"
25
+ packageVersion: "26.52.5"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
17
17
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
18
18
  var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/smart-card",
20
- packageVersion: "26.52.4",
20
+ packageVersion: "26.52.5",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -1,7 +1,7 @@
1
1
  export const CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links';
2
2
  export const CONTENT_URL_3P_ACCOUNT_AUTH = 'https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/';
3
3
  export const CONTENT_URL_AI = 'https://www.atlassian.com/trust/atlassian-intelligence';
4
- export const CONTENT_URL_AI_TROUBLESHOOTING = 'https://support.atlassian.com/organization-administration/docs/troubleshooting-for-atlassian-intelligence/';
4
+ export const CONTENT_URL_AI_TROUBLESHOOTING = 'https://status.atlassian.com/';
5
5
  export const CONTENT_URL_ACCEPTABLE_USE_POLICY = 'https://www.atlassian.com/legal/acceptable-use-policy';
6
6
 
7
7
  /**
@@ -37,8 +37,8 @@ export const messages = defineMessages({
37
37
  },
38
38
  ai_summary_error_generic: {
39
39
  id: 'fabric.linking.ai_summary_error_generic',
40
- defaultMessage: "Atlassian Intelligence can't provide a response right now. Read more <a>in our support documentation</a>.",
41
- description: 'Shown when AI summary is summarising the link resource content.'
40
+ defaultMessage: 'Atlassian Intelligence (AI) isn’t responding. Try again later or <a>check the status of AI</a>.',
41
+ description: 'Shown when AI Summary encountered an unexpected error while summarizing the linked resource content.'
42
42
  },
43
43
  ai_summary_error_acceptable_use_violation: {
44
44
  id: 'fabric.linking.ai_summary_error_acceptable_use_violation',
@@ -1,7 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import uuid from 'uuid';
3
3
  import { errorMessages } from './types';
4
- import { readStream, addPath } from './utils';
4
+ import { addPath } from './utils';
5
+ import { readStream } from './readStream';
5
6
  export class AISummaryService {
6
7
  constructor(props) {
7
8
  _defineProperty(this, "state", {
@@ -33,19 +34,13 @@ export class AISummaryService {
33
34
  return readStream(response);
34
35
  }
35
36
  });
36
- const defaultConfig = {
37
- baseUrl: '/gateway/api/assist',
37
+ this.config = {
38
+ baseUrl: props.baseUrl || '/gateway/api/assist',
38
39
  headers: {
39
40
  'Content-Type': 'application/json;charset=UTF-8',
40
41
  'x-experience-id': 'smart-link',
41
- //TODO: EDM-9337 - Remove the hardcoded Confluence product name and find a way to populate the product name here
42
- 'x-product': props.product || 'confluence'
43
- }
44
- };
45
- this.config = {
46
- baseUrl: props.baseUrl || defaultConfig.baseUrl,
47
- headers: {
48
- ...(props.headers || defaultConfig.headers)
42
+ 'x-product': props.product || 'confluence',
43
+ ...props.headers
49
44
  }
50
45
  };
51
46
  this.url = props.url;
@@ -0,0 +1,48 @@
1
+ import { getBufferReader } from './utils';
2
+ export async function* readStream(response) {
3
+ const reader = getBufferReader(response);
4
+ let doneStreaming = false;
5
+ let chunkBuffer = '';
6
+ const chunkTypeErrorMessage = 'jsonChunkType error';
7
+ do {
8
+ try {
9
+ const {
10
+ value,
11
+ done
12
+ } = await reader.read();
13
+ doneStreaming = done;
14
+ if (value) {
15
+ const processedChunks = `${chunkBuffer}${value}`.split('\n'); // assumes that all JSON chunks are separated by a new-line;
16
+
17
+ chunkBuffer = '';
18
+ for (let chunk of processedChunks) {
19
+ try {
20
+ const jsonChunk = JSON.parse(chunk);
21
+ if (jsonChunk.type === 'ERROR') {
22
+ throw new Error(chunkTypeErrorMessage);
23
+ }
24
+ yield jsonChunk;
25
+ } catch (e) {
26
+ if (e instanceof Error && e.message === chunkTypeErrorMessage) {
27
+ throw e;
28
+ }
29
+ // the chunk may be incomplete, so we'll save it for the next iteration.
30
+ chunkBuffer = chunk;
31
+ }
32
+ }
33
+ }
34
+ } catch (e) {
35
+ // If we abort the call, this exception bubbles up, so we want to catch it and exit gracefully
36
+ if (e instanceof DOMException && e.name === 'AbortError') {
37
+ doneStreaming = true;
38
+ } else {
39
+ reader.cancel();
40
+ throw e;
41
+ }
42
+ }
43
+ } while (!doneStreaming);
44
+ if (chunkBuffer) {
45
+ const error = new Error(`Not all the data was processed: ${chunkBuffer}`);
46
+ throw error;
47
+ }
48
+ }
@@ -1,50 +1,3 @@
1
- export async function* readStream(response) {
2
- const reader = getBufferReader(response);
3
- let doneStreaming = false;
4
- let chunkBuffer = '';
5
- const chunkTypeErrorMessage = 'jsonChunkType error';
6
- do {
7
- try {
8
- const {
9
- value,
10
- done
11
- } = await reader.read();
12
- doneStreaming = done;
13
- if (value) {
14
- const processedChunks = `${chunkBuffer}${value}`.split('\n'); // assumes that all JSON chunks are separated by a new-line;
15
-
16
- chunkBuffer = '';
17
- for (let chunk of processedChunks) {
18
- try {
19
- const jsonChunk = JSON.parse(chunk);
20
- if (jsonChunk.type === 'ERROR') {
21
- throw new Error(chunkTypeErrorMessage);
22
- }
23
- yield jsonChunk;
24
- } catch (e) {
25
- if (e instanceof Error && e.message === chunkTypeErrorMessage) {
26
- throw e;
27
- }
28
- // the chunk may be incomplete, so we'll save it for the next iteration.
29
- chunkBuffer = chunk;
30
- }
31
- }
32
- }
33
- } catch (e) {
34
- // If we abort the call, this exception bubbles up, so we want to catch it and exit gracefully
35
- if (e instanceof DOMException && e.name === 'AbortError') {
36
- doneStreaming = true;
37
- } else {
38
- reader.cancel();
39
- throw e;
40
- }
41
- }
42
- } while (!doneStreaming);
43
- if (chunkBuffer) {
44
- const error = new Error(`Not all the data was processed: ${chunkBuffer}`);
45
- throw error;
46
- }
47
- }
48
1
  export const getBufferReader = response => {
49
2
  if (!response.body) {
50
3
  throw new Error('Response body is empty');
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "26.52.4"
7
+ packageVersion: "26.52.5"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
7
7
  import LinkWarningModal from './LinkWarningModal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "26.52.4",
10
+ packageVersion: "26.52.5",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -1,7 +1,7 @@
1
1
  export var CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links';
2
2
  export var CONTENT_URL_3P_ACCOUNT_AUTH = 'https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/';
3
3
  export var CONTENT_URL_AI = 'https://www.atlassian.com/trust/atlassian-intelligence';
4
- export var CONTENT_URL_AI_TROUBLESHOOTING = 'https://support.atlassian.com/organization-administration/docs/troubleshooting-for-atlassian-intelligence/';
4
+ export var CONTENT_URL_AI_TROUBLESHOOTING = 'https://status.atlassian.com/';
5
5
  export var CONTENT_URL_ACCEPTABLE_USE_POLICY = 'https://www.atlassian.com/legal/acceptable-use-policy';
6
6
 
7
7
  /**
@@ -37,8 +37,8 @@ export var messages = defineMessages({
37
37
  },
38
38
  ai_summary_error_generic: {
39
39
  id: 'fabric.linking.ai_summary_error_generic',
40
- defaultMessage: "Atlassian Intelligence can't provide a response right now. Read more <a>in our support documentation</a>.",
41
- description: 'Shown when AI summary is summarising the link resource content.'
40
+ defaultMessage: 'Atlassian Intelligence (AI) isn’t responding. Try again later or <a>check the status of AI</a>.',
41
+ description: 'Shown when AI Summary encountered an unexpected error while summarizing the linked resource content.'
42
42
  },
43
43
  ai_summary_error_acceptable_use_violation: {
44
44
  id: 'fabric.linking.ai_summary_error_acceptable_use_violation',
@@ -12,7 +12,8 @@ function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symb
12
12
  function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function _throw(r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
13
13
  import uuid from 'uuid';
14
14
  import { errorMessages } from './types';
15
- import { readStream, addPath } from './utils';
15
+ import { addPath } from './utils';
16
+ import { readStream } from './readStream';
16
17
  export var AISummaryService = /*#__PURE__*/function () {
17
18
  function AISummaryService(props) {
18
19
  var _this = this;
@@ -60,18 +61,13 @@ export var AISummaryService = /*#__PURE__*/function () {
60
61
  }
61
62
  }, _callee);
62
63
  })));
63
- var defaultConfig = {
64
- baseUrl: '/gateway/api/assist',
65
- headers: {
64
+ this.config = {
65
+ baseUrl: props.baseUrl || '/gateway/api/assist',
66
+ headers: _objectSpread({
66
67
  'Content-Type': 'application/json;charset=UTF-8',
67
68
  'x-experience-id': 'smart-link',
68
- //TODO: EDM-9337 - Remove the hardcoded Confluence product name and find a way to populate the product name here
69
69
  'x-product': props.product || 'confluence'
70
- }
71
- };
72
- this.config = {
73
- baseUrl: props.baseUrl || defaultConfig.baseUrl,
74
- headers: _objectSpread({}, props.headers || defaultConfig.headers)
70
+ }, props.headers)
75
71
  };
76
72
  this.url = props.url;
77
73
  this.ari = props.ari;
@@ -0,0 +1,118 @@
1
+ import _awaitAsyncGenerator from "@babel/runtime/helpers/awaitAsyncGenerator";
2
+ import _wrapAsyncGenerator from "@babel/runtime/helpers/wrapAsyncGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ import { getBufferReader } from './utils';
8
+ export function readStream(_x) {
9
+ return _readStream.apply(this, arguments);
10
+ }
11
+ function _readStream() {
12
+ _readStream = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
13
+ var reader, doneStreaming, chunkBuffer, chunkTypeErrorMessage, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
14
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
15
+ while (1) switch (_context.prev = _context.next) {
16
+ case 0:
17
+ reader = getBufferReader(response);
18
+ doneStreaming = false;
19
+ chunkBuffer = '';
20
+ chunkTypeErrorMessage = 'jsonChunkType error';
21
+ case 4:
22
+ _context.prev = 4;
23
+ _context.next = 7;
24
+ return _awaitAsyncGenerator(reader.read());
25
+ case 7:
26
+ _yield$_awaitAsyncGen = _context.sent;
27
+ value = _yield$_awaitAsyncGen.value;
28
+ done = _yield$_awaitAsyncGen.done;
29
+ doneStreaming = done;
30
+ if (!value) {
31
+ _context.next = 42;
32
+ break;
33
+ }
34
+ processedChunks = "".concat(chunkBuffer).concat(value).split('\n'); // assumes that all JSON chunks are separated by a new-line;
35
+ chunkBuffer = '';
36
+ _iterator = _createForOfIteratorHelper(processedChunks);
37
+ _context.prev = 15;
38
+ _iterator.s();
39
+ case 17:
40
+ if ((_step = _iterator.n()).done) {
41
+ _context.next = 34;
42
+ break;
43
+ }
44
+ chunk = _step.value;
45
+ _context.prev = 19;
46
+ jsonChunk = JSON.parse(chunk);
47
+ if (!(jsonChunk.type === 'ERROR')) {
48
+ _context.next = 23;
49
+ break;
50
+ }
51
+ throw new Error(chunkTypeErrorMessage);
52
+ case 23:
53
+ _context.next = 25;
54
+ return jsonChunk;
55
+ case 25:
56
+ _context.next = 32;
57
+ break;
58
+ case 27:
59
+ _context.prev = 27;
60
+ _context.t0 = _context["catch"](19);
61
+ if (!(_context.t0 instanceof Error && _context.t0.message === chunkTypeErrorMessage)) {
62
+ _context.next = 31;
63
+ break;
64
+ }
65
+ throw _context.t0;
66
+ case 31:
67
+ // the chunk may be incomplete, so we'll save it for the next iteration.
68
+ chunkBuffer = chunk;
69
+ case 32:
70
+ _context.next = 17;
71
+ break;
72
+ case 34:
73
+ _context.next = 39;
74
+ break;
75
+ case 36:
76
+ _context.prev = 36;
77
+ _context.t1 = _context["catch"](15);
78
+ _iterator.e(_context.t1);
79
+ case 39:
80
+ _context.prev = 39;
81
+ _iterator.f();
82
+ return _context.finish(39);
83
+ case 42:
84
+ _context.next = 52;
85
+ break;
86
+ case 44:
87
+ _context.prev = 44;
88
+ _context.t2 = _context["catch"](4);
89
+ if (!(_context.t2 instanceof DOMException && _context.t2.name === 'AbortError')) {
90
+ _context.next = 50;
91
+ break;
92
+ }
93
+ doneStreaming = true;
94
+ _context.next = 52;
95
+ break;
96
+ case 50:
97
+ reader.cancel();
98
+ throw _context.t2;
99
+ case 52:
100
+ if (!doneStreaming) {
101
+ _context.next = 4;
102
+ break;
103
+ }
104
+ case 53:
105
+ if (!chunkBuffer) {
106
+ _context.next = 56;
107
+ break;
108
+ }
109
+ error = new Error("Not all the data was processed: ".concat(chunkBuffer));
110
+ throw error;
111
+ case 56:
112
+ case "end":
113
+ return _context.stop();
114
+ }
115
+ }, _callee, null, [[4, 44], [15, 36, 39, 42], [19, 27]]);
116
+ }));
117
+ return _readStream.apply(this, arguments);
118
+ }
@@ -1,120 +1,3 @@
1
- import _awaitAsyncGenerator from "@babel/runtime/helpers/awaitAsyncGenerator";
2
- import _wrapAsyncGenerator from "@babel/runtime/helpers/wrapAsyncGenerator";
3
- import _regeneratorRuntime from "@babel/runtime/regenerator";
4
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
- export function readStream(_x) {
8
- return _readStream.apply(this, arguments);
9
- }
10
- function _readStream() {
11
- _readStream = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
12
- var reader, doneStreaming, chunkBuffer, chunkTypeErrorMessage, _yield$_awaitAsyncGen, value, done, processedChunks, _iterator, _step, chunk, jsonChunk, error;
13
- return _regeneratorRuntime.wrap(function _callee$(_context) {
14
- while (1) switch (_context.prev = _context.next) {
15
- case 0:
16
- reader = getBufferReader(response);
17
- doneStreaming = false;
18
- chunkBuffer = '';
19
- chunkTypeErrorMessage = 'jsonChunkType error';
20
- case 4:
21
- _context.prev = 4;
22
- _context.next = 7;
23
- return _awaitAsyncGenerator(reader.read());
24
- case 7:
25
- _yield$_awaitAsyncGen = _context.sent;
26
- value = _yield$_awaitAsyncGen.value;
27
- done = _yield$_awaitAsyncGen.done;
28
- doneStreaming = done;
29
- if (!value) {
30
- _context.next = 42;
31
- break;
32
- }
33
- processedChunks = "".concat(chunkBuffer).concat(value).split('\n'); // assumes that all JSON chunks are separated by a new-line;
34
- chunkBuffer = '';
35
- _iterator = _createForOfIteratorHelper(processedChunks);
36
- _context.prev = 15;
37
- _iterator.s();
38
- case 17:
39
- if ((_step = _iterator.n()).done) {
40
- _context.next = 34;
41
- break;
42
- }
43
- chunk = _step.value;
44
- _context.prev = 19;
45
- jsonChunk = JSON.parse(chunk);
46
- if (!(jsonChunk.type === 'ERROR')) {
47
- _context.next = 23;
48
- break;
49
- }
50
- throw new Error(chunkTypeErrorMessage);
51
- case 23:
52
- _context.next = 25;
53
- return jsonChunk;
54
- case 25:
55
- _context.next = 32;
56
- break;
57
- case 27:
58
- _context.prev = 27;
59
- _context.t0 = _context["catch"](19);
60
- if (!(_context.t0 instanceof Error && _context.t0.message === chunkTypeErrorMessage)) {
61
- _context.next = 31;
62
- break;
63
- }
64
- throw _context.t0;
65
- case 31:
66
- // the chunk may be incomplete, so we'll save it for the next iteration.
67
- chunkBuffer = chunk;
68
- case 32:
69
- _context.next = 17;
70
- break;
71
- case 34:
72
- _context.next = 39;
73
- break;
74
- case 36:
75
- _context.prev = 36;
76
- _context.t1 = _context["catch"](15);
77
- _iterator.e(_context.t1);
78
- case 39:
79
- _context.prev = 39;
80
- _iterator.f();
81
- return _context.finish(39);
82
- case 42:
83
- _context.next = 52;
84
- break;
85
- case 44:
86
- _context.prev = 44;
87
- _context.t2 = _context["catch"](4);
88
- if (!(_context.t2 instanceof DOMException && _context.t2.name === 'AbortError')) {
89
- _context.next = 50;
90
- break;
91
- }
92
- doneStreaming = true;
93
- _context.next = 52;
94
- break;
95
- case 50:
96
- reader.cancel();
97
- throw _context.t2;
98
- case 52:
99
- if (!doneStreaming) {
100
- _context.next = 4;
101
- break;
102
- }
103
- case 53:
104
- if (!chunkBuffer) {
105
- _context.next = 56;
106
- break;
107
- }
108
- error = new Error("Not all the data was processed: ".concat(chunkBuffer));
109
- throw error;
110
- case 56:
111
- case "end":
112
- return _context.stop();
113
- }
114
- }, _callee, null, [[4, 44], [15, 36, 39, 42], [19, 27]]);
115
- }));
116
- return _readStream.apply(this, arguments);
117
- }
118
1
  export var getBufferReader = function getBufferReader(response) {
119
2
  if (!response.body) {
120
3
  throw new Error('Response body is empty');
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
15
15
  export var context = {
16
16
  componentName: 'smart-cards',
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "26.52.4"
18
+ packageVersion: "26.52.5"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
10
10
  import LinkWarningModal from './LinkWarningModal';
11
11
  var PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "26.52.4",
13
+ packageVersion: "26.52.5",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -1,7 +1,7 @@
1
1
  export declare const CONTENT_URL_SECURITY_AND_PERMISSIONS = "https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links";
2
2
  export declare const CONTENT_URL_3P_ACCOUNT_AUTH = "https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/";
3
3
  export declare const CONTENT_URL_AI = "https://www.atlassian.com/trust/atlassian-intelligence";
4
- export declare const CONTENT_URL_AI_TROUBLESHOOTING = "https://support.atlassian.com/organization-administration/docs/troubleshooting-for-atlassian-intelligence/";
4
+ export declare const CONTENT_URL_AI_TROUBLESHOOTING = "https://status.atlassian.com/";
5
5
  export declare const CONTENT_URL_ACCEPTABLE_USE_POLICY = "https://www.atlassian.com/legal/acceptable-use-policy";
6
6
  /**
7
7
  * The alignment of Flexible UI component.
@@ -0,0 +1 @@
1
+ export declare function readStream<T>(response: Response): AsyncGenerator<T>;
@@ -11,8 +11,11 @@ export type AISummaryServiceProps = {
11
11
  onStart?: (id: string) => void;
12
12
  onSuccess?: (id: string) => void;
13
13
  product?: ProductType;
14
+ /**
15
+ * we should always include the ARI if possible
16
+ */
17
+ ari?: string;
14
18
  url: string;
15
- ari: string;
16
19
  };
17
20
  export type AISummaryServiceConfig = {
18
21
  baseUrl: string;
@@ -81,7 +84,9 @@ export type StreamAnswerPart = {
81
84
  export type StreamTrace = {
82
85
  type: 'TRACE';
83
86
  message: {
87
+ message_template: string;
84
88
  content: string;
89
+ user_query: string;
85
90
  };
86
91
  millisOffset: number;
87
92
  metadata?: {
@@ -1,3 +1,2 @@
1
- export declare function readStream<T>(response: Response): AsyncGenerator<T>;
2
1
  export declare const getBufferReader: (response: Response) => ReadableStreamDefaultReader<string>;
3
2
  export declare const addPath: (baseUrl: string, path: string) => string;
@@ -1,7 +1,7 @@
1
1
  export declare const CONTENT_URL_SECURITY_AND_PERMISSIONS = "https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links";
2
2
  export declare const CONTENT_URL_3P_ACCOUNT_AUTH = "https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/";
3
3
  export declare const CONTENT_URL_AI = "https://www.atlassian.com/trust/atlassian-intelligence";
4
- export declare const CONTENT_URL_AI_TROUBLESHOOTING = "https://support.atlassian.com/organization-administration/docs/troubleshooting-for-atlassian-intelligence/";
4
+ export declare const CONTENT_URL_AI_TROUBLESHOOTING = "https://status.atlassian.com/";
5
5
  export declare const CONTENT_URL_ACCEPTABLE_USE_POLICY = "https://www.atlassian.com/legal/acceptable-use-policy";
6
6
  /**
7
7
  * The alignment of Flexible UI component.
@@ -0,0 +1 @@
1
+ export declare function readStream<T>(response: Response): AsyncGenerator<T>;
@@ -11,8 +11,11 @@ export type AISummaryServiceProps = {
11
11
  onStart?: (id: string) => void;
12
12
  onSuccess?: (id: string) => void;
13
13
  product?: ProductType;
14
+ /**
15
+ * we should always include the ARI if possible
16
+ */
17
+ ari?: string;
14
18
  url: string;
15
- ari: string;
16
19
  };
17
20
  export type AISummaryServiceConfig = {
18
21
  baseUrl: string;
@@ -91,7 +94,9 @@ export type StreamAnswerPart = {
91
94
  export type StreamTrace = {
92
95
  type: 'TRACE';
93
96
  message: {
97
+ message_template: string;
94
98
  content: string;
99
+ user_query: string;
95
100
  };
96
101
  millisOffset: number;
97
102
  metadata?: {
@@ -1,3 +1,2 @@
1
- export declare function readStream<T>(response: Response): AsyncGenerator<T>;
2
1
  export declare const getBufferReader: (response: Response) => ReadableStreamDefaultReader<string>;
3
2
  export declare const addPath: (baseUrl: string, path: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.52.4",
3
+ "version": "26.52.5",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"