@atlaskit/smart-card 32.4.0 → 32.5.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 (36) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/analytics.spec.yaml +100 -0
  3. package/dist/cjs/state/actions/index.js +35 -11
  4. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +5 -1
  5. package/dist/cjs/utils/analytics/analytics.js +21 -1
  6. package/dist/cjs/utils/analytics/index.js +3 -0
  7. package/dist/cjs/view/CardWithUrl/component.js +32 -10
  8. package/dist/cjs/view/CardWithUrl/loader.js +19 -6
  9. package/dist/cjs/view/LinkUrl/index.js +1 -1
  10. package/dist/es2019/state/actions/index.js +35 -11
  11. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +5 -1
  12. package/dist/es2019/utils/analytics/analytics.js +21 -1
  13. package/dist/es2019/utils/analytics/index.js +4 -0
  14. package/dist/es2019/view/CardWithUrl/component.js +32 -10
  15. package/dist/es2019/view/CardWithUrl/loader.js +20 -6
  16. package/dist/es2019/view/LinkUrl/index.js +1 -1
  17. package/dist/esm/state/actions/index.js +35 -11
  18. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +5 -1
  19. package/dist/esm/utils/analytics/analytics.js +21 -1
  20. package/dist/esm/utils/analytics/index.js +4 -0
  21. package/dist/esm/view/CardWithUrl/component.js +32 -10
  22. package/dist/esm/view/CardWithUrl/loader.js +19 -6
  23. package/dist/esm/view/LinkUrl/index.js +1 -1
  24. package/dist/types/common/analytics/generated/analytics.types.d.ts +38 -1
  25. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +5 -1
  26. package/dist/types/utils/analytics/analytics.d.ts +15 -0
  27. package/dist/types/utils/analytics/index.d.ts +3 -0
  28. package/dist/types/utils/analytics/types.d.ts +12 -0
  29. package/dist/types/view/FlexibleCard/components/blocks/ai-footer-block/icons/info/index.d.ts +2 -2
  30. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +38 -1
  31. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +5 -1
  32. package/dist/types-ts4.5/utils/analytics/analytics.d.ts +15 -0
  33. package/dist/types-ts4.5/utils/analytics/index.d.ts +3 -0
  34. package/dist/types-ts4.5/utils/analytics/types.d.ts +12 -0
  35. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-footer-block/icons/info/index.d.ts +2 -2
  36. package/package.json +9 -6
@@ -2,6 +2,8 @@ import React, { lazy, Suspense, useCallback, useEffect, useState } from 'react';
2
2
  import { ErrorBoundary } from 'react-error-boundary';
3
3
  import { di } from 'react-magnetic-di';
4
4
  import uuid from 'uuid';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
5
7
  import { useSmartLinkAnalytics } from '../../state/analytics';
6
8
  import { importWithRetry } from '../../utils';
7
9
  import { isFlexibleUiCard } from '../../utils/flexible';
@@ -10,6 +12,9 @@ import { LoadingCardLink } from './component-lazy/LoadingCardLink';
10
12
  export const LazyCardWithUrlContent = /*#__PURE__*/lazy(() => importWithRetry(() => import( /* webpackChunkName: "@atlaskit-internal_smartcard-urlcardcontent" */'./component-lazy/index')));
11
13
  export function CardWithURLRenderer(props) {
12
14
  const [id] = useState(() => props.id ? props.id : uuid());
15
+ const {
16
+ fireEvent
17
+ } = useAnalyticsEvents();
13
18
  useEffect(() => {
14
19
  // ComponentWillUnmount
15
20
  return () => {
@@ -60,11 +65,20 @@ export function CardWithURLRenderer(props) {
60
65
  // to the reliability of the smart-card front-end components.
61
66
  // Likewise, chunk loading errors are not caused by a failure of smart-card rendering.
62
67
  if (error.name === 'ChunkLoadError') {
63
- analytics.operational.chunkloadFailedEvent({
64
- display: appearance,
65
- error,
66
- errorInfo
67
- });
68
+ if (fg('platform_smart-card-migrate-operational-analytics')) {
69
+ fireEvent('operational.smartLink.chunkLoadFailed', {
70
+ display: appearance,
71
+ error: error,
72
+ errorInfo: errorInfo,
73
+ definitionId: null
74
+ });
75
+ } else {
76
+ analytics.operational.chunkloadFailedEvent({
77
+ display: appearance,
78
+ error,
79
+ errorInfo
80
+ });
81
+ }
68
82
  } else if (error.name !== 'APIError') {
69
83
  analytics.ui.renderFailedEvent({
70
84
  display: isFlexibleUi ? 'flexible' : appearance,
@@ -78,7 +92,7 @@ export function CardWithURLRenderer(props) {
78
92
  url: url !== null && url !== void 0 ? url : '',
79
93
  err: error
80
94
  });
81
- }, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi]);
95
+ }, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi, fireEvent]);
82
96
  if (!url) {
83
97
  throw new Error('@atlaskit/smart-card: url property is missing.');
84
98
  }
@@ -7,7 +7,7 @@ import LinkWarningModal from './LinkWarningModal';
7
7
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "32.4.0",
10
+ packageVersion: "32.5.0",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -4,8 +4,10 @@ import { useCallback, useMemo } from 'react';
4
4
  import { useSmartLinkContext } from '@atlaskit/link-provider';
5
5
  import { ACTION_RESOLVING, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common';
6
6
  import { auth } from '@atlaskit/outbound-auth-flow-client';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
8
9
  import { SmartLinkStatus } from '../../constants';
10
+ import { startUfoExperience } from '../analytics';
9
11
  import { getByDefinitionId, getDefinitionId, getExtensionKey, getServices } from '../helpers';
10
12
  import useInvokeClientAction from '../hooks/use-invoke-client-action';
11
13
  import useResolve from '../hooks/use-resolve';
@@ -119,19 +121,41 @@ export var useSmartCardActions = function useSmartCardActions(id, url, analytics
119
121
  fireEvent('track.applicationAccount.connected', {
120
122
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
121
123
  });
122
- analytics.operational.connectSucceededEvent({
123
- id: id,
124
- definitionId: definitionId,
125
- extensionKey: extensionKey
126
- });
124
+ if (fg('platform_smart-card-migrate-operational-analytics')) {
125
+ startUfoExperience('smart-link-authenticated', id, {
126
+ extensionKey: extensionKey,
127
+ status: 'success'
128
+ });
129
+ fireEvent('operational.smartLink.connectSucceeded', {
130
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
131
+ });
132
+ } else {
133
+ analytics.operational.connectSucceededEvent({
134
+ id: id,
135
+ definitionId: definitionId,
136
+ extensionKey: extensionKey
137
+ });
138
+ }
127
139
  reload();
128
140
  }, function (err) {
129
- analytics.operational.connectFailedEvent({
130
- id: id,
131
- definitionId: definitionId,
132
- extensionKey: extensionKey,
133
- reason: err.type
134
- });
141
+ if (fg('platform_smart-card-migrate-operational-analytics')) {
142
+ var _err$type;
143
+ startUfoExperience('smart-link-authenticated', id, {
144
+ extensionKey: extensionKey,
145
+ status: err.type
146
+ });
147
+ fireEvent('operational.smartLink.connectFailed', {
148
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
149
+ reason: (_err$type = err.type) !== null && _err$type !== void 0 ? _err$type : null
150
+ });
151
+ } else {
152
+ analytics.operational.connectFailedEvent({
153
+ id: id,
154
+ definitionId: definitionId,
155
+ extensionKey: extensionKey,
156
+ reason: err.type
157
+ });
158
+ }
135
159
  if (err.type === 'auth_window_closed') {
136
160
  analytics.ui.closedAuthEvent({
137
161
  display: appearance,
@@ -511,6 +511,7 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
511
511
  * @param id The unique ID for this Smart Link.
512
512
  * @param definitionId The definitionId of the Smart Link resolver invoked.
513
513
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
514
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
514
515
  */
515
516
  connectSucceededEvent: function connectSucceededEvent(_ref13) {
516
517
  var id = _ref13.id,
@@ -541,6 +542,7 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
541
542
  * @param definitionId The definitionId of the Smart Link resolver invoked.
542
543
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
543
544
  * @param reason The reason why the Smart Link connect account failed.
545
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
544
546
  */
545
547
  connectFailedEvent: function connectFailedEvent(_ref14) {
546
548
  var id = _ref14.id,
@@ -575,6 +577,7 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
575
577
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
576
578
  * @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
577
579
  * @param error An error representing why the Smart Link request failed.
580
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
578
581
  */
579
582
  instrument: function instrument(_ref15) {
580
583
  var id = _ref15.id,
@@ -602,11 +605,12 @@ export var useSmartLinkAnalytics = function useSmartLinkAnalytics(url, id, defau
602
605
  }
603
606
  },
604
607
  /**
605
- * This fires an event that represents when a Smart Link renders unsuccessfuly.
608
+ * This fires an event that represents when a Smart Link renders unsuccessfully.
606
609
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
607
610
  * @param id The unique ID for this Smart Link.
608
611
  * @param error: An error representing why the Smart Link render failed.
609
612
  * @param errorInfo: Additional details about the error including the stack trace.
613
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
610
614
  */
611
615
  chunkloadFailedEvent: function chunkloadFailedEvent(_ref16) {
612
616
  var display = _ref16.display,
@@ -10,7 +10,7 @@ export var ANALYTICS_CHANNEL = 'media';
10
10
  export var context = {
11
11
  componentName: 'smart-cards',
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "32.4.0"
13
+ packageVersion: "32.5.0"
14
14
  };
15
15
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
16
16
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -57,6 +57,10 @@ export var fireSmartLinkEvent = function fireSmartLinkEvent(payload, createAnaly
57
57
  createAnalyticsEvent(payload).fire(ANALYTICS_CHANNEL);
58
58
  }
59
59
  };
60
+
61
+ /**
62
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
63
+ */
60
64
  export var resolvedEvent = function resolvedEvent(props) {
61
65
  return {
62
66
  action: 'resolved',
@@ -65,6 +69,10 @@ export var resolvedEvent = function resolvedEvent(props) {
65
69
  attributes: _objectSpread(_objectSpread({}, props), context)
66
70
  };
67
71
  };
72
+
73
+ /**
74
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
75
+ */
68
76
  export var unresolvedEvent = function unresolvedEvent(_ref) {
69
77
  var id = _ref.id,
70
78
  definitionId = _ref.definitionId,
@@ -159,6 +167,10 @@ export var invokeFailedEvent = function invokeFailedEvent(_ref3) {
159
167
  })
160
168
  };
161
169
  };
170
+
171
+ /**
172
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
173
+ */
162
174
  export var connectSucceededEvent = function connectSucceededEvent(_ref4) {
163
175
  var definitionId = _ref4.definitionId,
164
176
  extensionKey = _ref4.extensionKey,
@@ -178,6 +190,10 @@ export var connectSucceededEvent = function connectSucceededEvent(_ref4) {
178
190
  })
179
191
  };
180
192
  };
193
+
194
+ /**
195
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
196
+ */
181
197
  export var connectFailedEvent = function connectFailedEvent(_ref5) {
182
198
  var definitionId = _ref5.definitionId,
183
199
  extensionKey = _ref5.extensionKey,
@@ -461,6 +477,10 @@ export var uiLearnMoreLinkClickedEvent = function uiLearnMoreLinkClickedEvent()
461
477
  attributes: _objectSpread({}, context)
462
478
  };
463
479
  };
480
+
481
+ /**
482
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
483
+ */
464
484
  export var chunkloadFailedEvent = function chunkloadFailedEvent(_ref16) {
465
485
  var display = _ref16.display,
466
486
  error = _ref16.error,
@@ -4,6 +4,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { getMeasure } from '../performance';
5
5
  import { resolvedEvent, unresolvedEvent } from './analytics';
6
6
  export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, chunkloadFailedEvent, connectSucceededEvent, connectFailedEvent, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiLearnMoreLinkClickedEvent, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked } from './analytics';
7
+
8
+ /**
9
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
10
+ */
7
11
  export var instrumentEvent = function instrumentEvent(_ref) {
8
12
  var id = _ref.id,
9
13
  status = _ref.status,
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback, useEffect, useMemo } from 'react';
2
2
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
4
5
  import { CardDisplay } from '../../constants';
5
6
  import { useSmartLink } from '../../state';
@@ -118,18 +119,39 @@ function Component(_ref) {
118
119
  useEffect(function () {
119
120
  measure.mark(id, state.status);
120
121
  if (state.status !== 'pending' && state.status !== 'resolving') {
121
- var _state$error;
122
122
  measure.create(id, state.status);
123
- analytics.operational.instrument({
124
- id: id,
125
- status: state.status,
126
- definitionId: definitionId,
127
- extensionKey: extensionKey !== null && extensionKey !== void 0 ? extensionKey : (_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.extensionKey,
128
- resourceType: resourceType,
129
- error: state.error
130
- });
123
+ if (fg('platform_smart-card-migrate-operational-analytics')) {
124
+ var _state$error;
125
+ if (state.status === 'resolved') {
126
+ var _measure$getMeasure$d, _measure$getMeasure;
127
+ fireEvent('operational.smartLink.resolved', {
128
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
129
+ duration: (_measure$getMeasure$d = (_measure$getMeasure = measure.getMeasure(id, state.status)) === null || _measure$getMeasure === void 0 ? void 0 : _measure$getMeasure.duration) !== null && _measure$getMeasure$d !== void 0 ? _measure$getMeasure$d : null
130
+ });
131
+ } else if (((_state$error = state.error) === null || _state$error === void 0 ? void 0 : _state$error.type) !== 'ResolveUnsupportedError') {
132
+ fireEvent('operational.smartLink.unresolved', {
133
+ definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
134
+ reason: state.status,
135
+ error: state.error === undefined ? null : {
136
+ name: state.error.name,
137
+ kind: state.error.kind,
138
+ type: state.error.type
139
+ }
140
+ });
141
+ }
142
+ } else {
143
+ var _state$error2;
144
+ analytics.operational.instrument({
145
+ id: id,
146
+ status: state.status,
147
+ definitionId: definitionId,
148
+ extensionKey: extensionKey !== null && extensionKey !== void 0 ? extensionKey : (_state$error2 = state.error) === null || _state$error2 === void 0 ? void 0 : _state$error2.extensionKey,
149
+ resourceType: resourceType,
150
+ error: state.error
151
+ });
152
+ }
131
153
  }
132
- }, [id, appearance, state.status, state.error, definitionId, extensionKey, resourceType, analytics.operational]);
154
+ }, [id, appearance, state.status, state.error, definitionId, extensionKey, resourceType, analytics.operational, fireEvent]);
133
155
 
134
156
  // NB: once the smart-card has rendered into an end state, we capture
135
157
  // this as a successful render. These can be one of:
@@ -3,6 +3,8 @@ import React, { lazy, Suspense, useCallback, useEffect, useState } from 'react';
3
3
  import { ErrorBoundary } from 'react-error-boundary';
4
4
  import { di } from 'react-magnetic-di';
5
5
  import uuid from 'uuid';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
6
8
  import { useSmartLinkAnalytics } from '../../state/analytics';
7
9
  import { importWithRetry } from '../../utils';
8
10
  import { isFlexibleUiCard } from '../../utils/flexible';
@@ -19,6 +21,8 @@ export function CardWithURLRenderer(props) {
19
21
  }),
20
22
  _useState2 = _slicedToArray(_useState, 1),
21
23
  id = _useState2[0];
24
+ var _useAnalyticsEvents = useAnalyticsEvents(),
25
+ fireEvent = _useAnalyticsEvents.fireEvent;
22
26
  useEffect(function () {
23
27
  // ComponentWillUnmount
24
28
  return function () {
@@ -65,11 +69,20 @@ export function CardWithURLRenderer(props) {
65
69
  // to the reliability of the smart-card front-end components.
66
70
  // Likewise, chunk loading errors are not caused by a failure of smart-card rendering.
67
71
  if (error.name === 'ChunkLoadError') {
68
- analytics.operational.chunkloadFailedEvent({
69
- display: appearance,
70
- error: error,
71
- errorInfo: errorInfo
72
- });
72
+ if (fg('platform_smart-card-migrate-operational-analytics')) {
73
+ fireEvent('operational.smartLink.chunkLoadFailed', {
74
+ display: appearance,
75
+ error: error,
76
+ errorInfo: errorInfo,
77
+ definitionId: null
78
+ });
79
+ } else {
80
+ analytics.operational.chunkloadFailedEvent({
81
+ display: appearance,
82
+ error: error,
83
+ errorInfo: errorInfo
84
+ });
85
+ }
73
86
  } else if (error.name !== 'APIError') {
74
87
  analytics.ui.renderFailedEvent({
75
88
  display: isFlexibleUi ? 'flexible' : appearance,
@@ -83,7 +96,7 @@ export function CardWithURLRenderer(props) {
83
96
  url: url !== null && url !== void 0 ? url : '',
84
97
  err: error
85
98
  });
86
- }, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi]);
99
+ }, [analytics.operational, analytics.ui, appearance, id, onError, url, isFlexibleUi, fireEvent]);
87
100
  if (!url) {
88
101
  throw new Error('@atlaskit/smart-card: url property is missing.');
89
102
  }
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  var PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "32.4.0",
13
+ packageVersion: "32.5.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6a2a0a5715993e0dd235d38d95d6bbcc>>
6
+ * @codegen <<SignedSource::519effabaa6c383d7fa35374469faada>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataContextType = {
@@ -93,6 +93,28 @@ export type SmartLinkQuickActionFailedAttributesType = {
93
93
  export type ConsentModalViewedAttributesType = {
94
94
  definitionId: string | null;
95
95
  };
96
+ export type SmartLinkConnectSucceededAttributesType = {
97
+ definitionId: string | null;
98
+ };
99
+ export type SmartLinkConnectFailedAttributesType = {
100
+ reason: string | null;
101
+ definitionId: string | null;
102
+ };
103
+ export type SmartLinkResolvedAttributesType = {
104
+ definitionId: string | null;
105
+ duration: number | null;
106
+ };
107
+ export type SmartLinkUnresolvedAttributesType = {
108
+ definitionId: string | null;
109
+ error: Record<string, unknown> | null;
110
+ reason: string;
111
+ };
112
+ export type SmartLinkChunkLoadFailedAttributesType = {
113
+ display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
114
+ definitionId: string | null;
115
+ error: Record<string, unknown>;
116
+ errorInfo: Record<string, unknown>;
117
+ };
96
118
  export type AnalyticsEventAttributes = {
97
119
  /**
98
120
  * fired when an ai summary is clicked */
@@ -157,5 +179,20 @@ export type AnalyticsEventAttributes = {
157
179
  /**
158
180
  * fires an event which represents the connect account page being opened. */
159
181
  'screen.consentModal.viewed': ConsentModalViewedAttributesType;
182
+ /**
183
+ * fires an event that represents an account successfully being connected via a Smart Link. */
184
+ 'operational.smartLink.connectSucceeded': SmartLinkConnectSucceededAttributesType;
185
+ /**
186
+ * fires an event that represents an account unsuccessfully being connected. */
187
+ 'operational.smartLink.connectFailed': SmartLinkConnectFailedAttributesType;
188
+ /**
189
+ * fires an event which represents a Smart Link request succeeding. */
190
+ 'operational.smartLink.resolved': SmartLinkResolvedAttributesType;
191
+ /**
192
+ * fires an event which represents a Smart Link request failing. */
193
+ 'operational.smartLink.unresolved': SmartLinkUnresolvedAttributesType;
194
+ /**
195
+ * fires an event that represents when a Smart Link renders unsuccessfully. */
196
+ 'operational.smartLink.chunkLoadFailed': SmartLinkChunkLoadFailedAttributesType;
160
197
  };
161
198
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -164,6 +164,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
164
164
  * @param id The unique ID for this Smart Link.
165
165
  * @param definitionId The definitionId of the Smart Link resolver invoked.
166
166
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
167
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
167
168
  */
168
169
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => void;
169
170
  /**
@@ -172,6 +173,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
172
173
  * @param definitionId The definitionId of the Smart Link resolver invoked.
173
174
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
174
175
  * @param reason The reason why the Smart Link connect account failed.
176
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
175
177
  */
176
178
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectFailedEventProps) => void;
177
179
  /**
@@ -182,14 +184,16 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
182
184
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
183
185
  * @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
184
186
  * @param error An error representing why the Smart Link request failed.
187
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
185
188
  */
186
189
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => void;
187
190
  /**
188
- * This fires an event that represents when a Smart Link renders unsuccessfuly.
191
+ * This fires an event that represents when a Smart Link renders unsuccessfully.
189
192
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
190
193
  * @param id The unique ID for this Smart Link.
191
194
  * @param error: An error representing why the Smart Link render failed.
192
195
  * @param errorInfo: Additional details about the error including the stack trace.
196
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
193
197
  */
194
198
  chunkloadFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => void;
195
199
  };
@@ -22,11 +22,23 @@ export declare class SmartLinkEvents {
22
22
  insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
23
23
  }
24
24
  export declare const fireSmartLinkEvent: (payload: AnalyticsPayload, createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
25
+ /**
26
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
27
+ */
25
28
  export declare const resolvedEvent: (props: ResolvedEventProps) => AnalyticsPayload;
29
+ /**
30
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
31
+ */
26
32
  export declare const unresolvedEvent: ({ id, definitionId, extensionKey, resourceType, destinationSubproduct, destinationProduct, error, status, location, }: UnresolvedEventProps) => AnalyticsPayload;
27
33
  export declare const invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => AnalyticsPayload;
28
34
  export declare const invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => AnalyticsPayload;
35
+ /**
36
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
37
+ */
29
38
  export declare const connectSucceededEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => AnalyticsPayload;
39
+ /**
40
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
41
+ */
30
42
  export declare const connectFailedEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, reason, }: ConnectFailedEventProps) => AnalyticsPayload;
31
43
  export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
32
44
  export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
@@ -39,6 +51,9 @@ export declare const uiHoverCardViewedEvent: ({ id, previewDisplay, extensionKey
39
51
  export declare const uiHoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, status, }: UiHoverCardDismissedEventProps) => AnalyticsPayload;
40
52
  export declare const uiHoverCardOpenLinkClickedEvent: ({ id, previewDisplay, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardOpenLinkClickedEventProps) => AnalyticsPayload;
41
53
  export declare const uiLearnMoreLinkClickedEvent: () => AnalyticsPayload;
54
+ /**
55
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
56
+ */
42
57
  export declare const chunkloadFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => AnalyticsPayload;
43
58
  export declare const uiSmartLinkStatusLozengeButtonClicked: () => AnalyticsPayload;
44
59
  export declare const uiSmartLinkStatusListItemButtonClicked: () => AnalyticsPayload;
@@ -1,4 +1,7 @@
1
1
  import { type AnalyticsPayload } from '../types';
2
2
  import { type InstrumentEventProps } from './types';
3
3
  export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, chunkloadFailedEvent, connectSucceededEvent, connectFailedEvent, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiLearnMoreLinkClickedEvent, uiSmartLinkStatusLozengeButtonClicked, uiSmartLinkStatusListItemButtonClicked, uiSmartLinkStatusOpenPreviewButtonClicked, } from './analytics';
4
+ /**
5
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
6
+ */
4
7
  export declare const instrumentEvent: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => AnalyticsPayload | undefined;
@@ -36,9 +36,15 @@ export type InvokeFailedEventProps = CommonEventProps & {
36
36
  display?: CardInnerAppearance;
37
37
  reason: string;
38
38
  };
39
+ /**
40
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
41
+ */
39
42
  export type ConnectSucceededEventProps = CommonEventProps & {
40
43
  id?: string;
41
44
  };
45
+ /**
46
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
47
+ */
42
48
  export type ConnectFailedEventProps = CommonEventProps & {
43
49
  id?: string;
44
50
  reason?: string;
@@ -73,6 +79,9 @@ export type UiRenderSuccessEventProps = CommonEventProps & {
73
79
  status: CardType;
74
80
  canBeDatasource?: boolean;
75
81
  };
82
+ /**
83
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
84
+ */
76
85
  export type UiRenderFailedEventProps = CommonEventProps & {
77
86
  display: CardInnerAppearance;
78
87
  error: Error;
@@ -93,6 +102,9 @@ export type UiHoverCardOpenLinkClickedEventProps = CommonEventProps & {
93
102
  previewDisplay: PreviewDisplay;
94
103
  previewInvokeMethod?: PreviewInvokeMethod;
95
104
  };
105
+ /**
106
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
107
+ */
96
108
  export type InstrumentEventProps = CommonEventProps & {
97
109
  error?: APIError;
98
110
  status: CardType;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { type UNSAFE_NewCoreIconProps } from '@atlaskit/icon';
3
- export declare const InfoIcon: (props: UNSAFE_NewCoreIconProps) => JSX.Element;
2
+ import { type NewCoreIconProps } from '@atlaskit/icon';
3
+ export declare const InfoIcon: (props: NewCoreIconProps) => JSX.Element;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6a2a0a5715993e0dd235d38d95d6bbcc>>
6
+ * @codegen <<SignedSource::519effabaa6c383d7fa35374469faada>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataContextType = {
@@ -93,6 +93,28 @@ export type SmartLinkQuickActionFailedAttributesType = {
93
93
  export type ConsentModalViewedAttributesType = {
94
94
  definitionId: string | null;
95
95
  };
96
+ export type SmartLinkConnectSucceededAttributesType = {
97
+ definitionId: string | null;
98
+ };
99
+ export type SmartLinkConnectFailedAttributesType = {
100
+ reason: string | null;
101
+ definitionId: string | null;
102
+ };
103
+ export type SmartLinkResolvedAttributesType = {
104
+ definitionId: string | null;
105
+ duration: number | null;
106
+ };
107
+ export type SmartLinkUnresolvedAttributesType = {
108
+ definitionId: string | null;
109
+ error: Record<string, unknown> | null;
110
+ reason: string;
111
+ };
112
+ export type SmartLinkChunkLoadFailedAttributesType = {
113
+ display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
114
+ definitionId: string | null;
115
+ error: Record<string, unknown>;
116
+ errorInfo: Record<string, unknown>;
117
+ };
96
118
  export type AnalyticsEventAttributes = {
97
119
  /**
98
120
  * fired when an ai summary is clicked */
@@ -157,5 +179,20 @@ export type AnalyticsEventAttributes = {
157
179
  /**
158
180
  * fires an event which represents the connect account page being opened. */
159
181
  'screen.consentModal.viewed': ConsentModalViewedAttributesType;
182
+ /**
183
+ * fires an event that represents an account successfully being connected via a Smart Link. */
184
+ 'operational.smartLink.connectSucceeded': SmartLinkConnectSucceededAttributesType;
185
+ /**
186
+ * fires an event that represents an account unsuccessfully being connected. */
187
+ 'operational.smartLink.connectFailed': SmartLinkConnectFailedAttributesType;
188
+ /**
189
+ * fires an event which represents a Smart Link request succeeding. */
190
+ 'operational.smartLink.resolved': SmartLinkResolvedAttributesType;
191
+ /**
192
+ * fires an event which represents a Smart Link request failing. */
193
+ 'operational.smartLink.unresolved': SmartLinkUnresolvedAttributesType;
194
+ /**
195
+ * fires an event that represents when a Smart Link renders unsuccessfully. */
196
+ 'operational.smartLink.chunkLoadFailed': SmartLinkChunkLoadFailedAttributesType;
160
197
  };
161
198
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -164,6 +164,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
164
164
  * @param id The unique ID for this Smart Link.
165
165
  * @param definitionId The definitionId of the Smart Link resolver invoked.
166
166
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
167
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
167
168
  */
168
169
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => void;
169
170
  /**
@@ -172,6 +173,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
172
173
  * @param definitionId The definitionId of the Smart Link resolver invoked.
173
174
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
174
175
  * @param reason The reason why the Smart Link connect account failed.
176
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
175
177
  */
176
178
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectFailedEventProps) => void;
177
179
  /**
@@ -182,14 +184,16 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
182
184
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
183
185
  * @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
184
186
  * @param error An error representing why the Smart Link request failed.
187
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
185
188
  */
186
189
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => void;
187
190
  /**
188
- * This fires an event that represents when a Smart Link renders unsuccessfuly.
191
+ * This fires an event that represents when a Smart Link renders unsuccessfully.
189
192
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
190
193
  * @param id The unique ID for this Smart Link.
191
194
  * @param error: An error representing why the Smart Link render failed.
192
195
  * @param errorInfo: Additional details about the error including the stack trace.
196
+ * @deprecated remove with platform_smart-card-migrate-operational-analytics clean up
193
197
  */
194
198
  chunkloadFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => void;
195
199
  };