@atlaskit/link-datasource 2.11.15 → 2.11.16

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 2.11.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [#136744](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136744)
8
+ [`04df6a1d732b5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/04df6a1d732b5) -
9
+ Fix errorLocation analytic attribute typing
10
+
3
11
  ## 2.11.15
4
12
 
5
13
  ### Patch Changes
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::b545a6ba498c7d701c956e5ca94c24cf>>
6
+ * @codegen <<SignedSource::0d4e0c024f984c4facf077d6a3f6ccda>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -68,7 +68,7 @@ export type DatasourceRenderSuccessAttributesType = {
68
68
  };
69
69
  export type DatasourceRenderFailureAttributesType = {};
70
70
  export type DatasourceOperationFailedAttributesType = {
71
- errorLocation: string | null;
71
+ errorLocation: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | null;
72
72
  traceId: string | null;
73
73
  status: number | null;
74
74
  };
@@ -1,3 +1,4 @@
1
+ import { type DatasourceOperationFailedAttributesType } from '../analytics/generated/analytics.types';
1
2
  /**
2
3
  * This function is just a wrapper around captureException that checks if the enable-sentry-client FF is enabled
3
4
  * and error is instanceof Error. We have to override the type of error from captureException to unknown so we use
@@ -14,6 +15,6 @@ interface UseErrorLoggerPropsActions {
14
15
  }
15
16
  export type UseErrorLoggerProps = UseErrorLoggerPropsDatasource | UseErrorLoggerPropsActions;
16
17
  declare const useErrorLogger: (loggerProps: UseErrorLoggerProps) => {
17
- captureError: (errorLocation: string, error: unknown) => void;
18
+ captureError: (errorLocation: DatasourceOperationFailedAttributesType['errorLocation'], error: unknown) => void;
18
19
  };
19
20
  export default useErrorLogger;
@@ -1,7 +1,7 @@
1
1
  import { type Action } from 'react-sweet-state';
2
2
  import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
3
3
  import type { ActionsDiscoveryRequest, AtomicActionInterface } from '@atlaskit/linking-types';
4
- import { type EventKey } from '../../../src/analytics/generated/analytics.types';
4
+ import { type DatasourceOperationFailedAttributesType, type EventKey } from '../../../src/analytics/generated/analytics.types';
5
5
  import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
6
6
  type IntegrationKey = string;
7
7
  type FieldKey = string;
@@ -49,7 +49,7 @@ export interface ActionsStoreState {
49
49
  interface Client {
50
50
  getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
51
51
  }
52
- type AnalyticsCaptureError = (errorLocation: string, error: unknown) => void;
52
+ type AnalyticsCaptureError = (errorLocation: DatasourceOperationFailedAttributesType['errorLocation'], error: unknown) => void;
53
53
  type AnalyticsFireEvent = <K extends EventKey>(...params: Parameters<typeof createEventPayload<K>>) => void;
54
54
  interface UseDiscoverActionsProps {
55
55
  captureError: AnalyticsCaptureError;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::b545a6ba498c7d701c956e5ca94c24cf>>
6
+ * @codegen <<SignedSource::0d4e0c024f984c4facf077d6a3f6ccda>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -68,7 +68,7 @@ export type DatasourceRenderSuccessAttributesType = {
68
68
  };
69
69
  export type DatasourceRenderFailureAttributesType = {};
70
70
  export type DatasourceOperationFailedAttributesType = {
71
- errorLocation: string | null;
71
+ errorLocation: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | null;
72
72
  traceId: string | null;
73
73
  status: number | null;
74
74
  };
@@ -1,3 +1,4 @@
1
+ import { type DatasourceOperationFailedAttributesType } from '../analytics/generated/analytics.types';
1
2
  /**
2
3
  * This function is just a wrapper around captureException that checks if the enable-sentry-client FF is enabled
3
4
  * and error is instanceof Error. We have to override the type of error from captureException to unknown so we use
@@ -14,6 +15,6 @@ interface UseErrorLoggerPropsActions {
14
15
  }
15
16
  export type UseErrorLoggerProps = UseErrorLoggerPropsDatasource | UseErrorLoggerPropsActions;
16
17
  declare const useErrorLogger: (loggerProps: UseErrorLoggerProps) => {
17
- captureError: (errorLocation: string, error: unknown) => void;
18
+ captureError: (errorLocation: DatasourceOperationFailedAttributesType['errorLocation'], error: unknown) => void;
18
19
  };
19
20
  export default useErrorLogger;
@@ -1,7 +1,7 @@
1
1
  import { type Action } from 'react-sweet-state';
2
2
  import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
3
3
  import type { ActionsDiscoveryRequest, AtomicActionInterface } from '@atlaskit/linking-types';
4
- import { type EventKey } from '../../../src/analytics/generated/analytics.types';
4
+ import { type DatasourceOperationFailedAttributesType, type EventKey } from '../../../src/analytics/generated/analytics.types';
5
5
  import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
6
6
  type IntegrationKey = string;
7
7
  type FieldKey = string;
@@ -49,7 +49,7 @@ export interface ActionsStoreState {
49
49
  interface Client {
50
50
  getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
51
51
  }
52
- type AnalyticsCaptureError = (errorLocation: string, error: unknown) => void;
52
+ type AnalyticsCaptureError = (errorLocation: DatasourceOperationFailedAttributesType['errorLocation'], error: unknown) => void;
53
53
  type AnalyticsFireEvent = <K extends EventKey>(...params: Parameters<typeof createEventPayload<K>>) => void;
54
54
  interface UseDiscoverActionsProps {
55
55
  captureError: AnalyticsCaptureError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "2.11.15",
3
+ "version": "2.11.16",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",