@atlaskit/link-datasource 2.11.9 → 2.11.11
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 +17 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +2 -1
- package/dist/cjs/state/actions/index.js +16 -13
- package/dist/es2019/hooks/useDatasourceTableState.js +2 -1
- package/dist/es2019/state/actions/index.js +13 -12
- package/dist/esm/hooks/useDatasourceTableState.js +2 -1
- package/dist/esm/state/actions/index.js +16 -13
- package/dist/types/analytics/generated/analytics.types.d.ts +11 -2
- package/dist/types/state/actions/index.d.ts +12 -6
- package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +11 -2
- package/dist/types-ts4.5/state/actions/index.d.ts +12 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.11.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#134213](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134213)
|
|
8
|
+
[`93bd7032842ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/93bd7032842ec) -
|
|
9
|
+
[ux] [ED-24636] Bump ADF Schema package
|
|
10
|
+
|
|
11
|
+
## 2.11.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#130811](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130811)
|
|
16
|
+
[`3e95e200fd9e8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3e95e200fd9e8) -
|
|
17
|
+
Fire event when action discovery has been successful
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 2.11.9
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -31,7 +31,8 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
31
31
|
var _useDatasourceActions = (0, _state.useDatasourceActions)(),
|
|
32
32
|
onAddItems = _useDatasourceActions.onAddItems;
|
|
33
33
|
var _useDiscoverActions = (0, _actions.useDiscoverActions)({
|
|
34
|
-
captureError: captureError
|
|
34
|
+
captureError: captureError,
|
|
35
|
+
fireEvent: fireEvent
|
|
35
36
|
}),
|
|
36
37
|
discoverActions = _useDiscoverActions.discoverActions;
|
|
37
38
|
var idFieldCount = 1;
|
|
@@ -7,13 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useExecuteAtomicAction = exports.useDiscoverActions = exports.useAtomicUpdateActionSchema = exports.actions = exports.ActionsStore = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
12
|
var _react = require("react");
|
|
14
13
|
var _reactSweetState = require("react-sweet-state");
|
|
15
14
|
var _linkClientExtension = require("@atlaskit/link-client-extension");
|
|
16
|
-
var _excluded = ["aris", "fieldKeys"];
|
|
17
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
17
|
/**
|
|
@@ -57,10 +55,10 @@ var getInitialState = function getInitialState() {
|
|
|
57
55
|
};
|
|
58
56
|
};
|
|
59
57
|
var actions = exports.actions = {
|
|
60
|
-
discoverActions: function discoverActions(captureError, api, request) {
|
|
58
|
+
discoverActions: function discoverActions(captureError, fireEvent, api, request) {
|
|
61
59
|
return /*#__PURE__*/function () {
|
|
62
60
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
63
|
-
var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions
|
|
61
|
+
var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions;
|
|
64
62
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
65
63
|
while (1) switch (_context.prev = _context.next) {
|
|
66
64
|
case 0:
|
|
@@ -87,19 +85,23 @@ var actions = exports.actions = {
|
|
|
87
85
|
actionsByIntegration: actionsByIntegration,
|
|
88
86
|
permissions: permissions
|
|
89
87
|
});
|
|
88
|
+
fireEvent('operational.actionDiscovery.success', {
|
|
89
|
+
integrationKey: 'integrationKey' in request ? request.integrationKey : null,
|
|
90
|
+
datasourceId: 'datasourceId' in request ? request.datasourceId : null,
|
|
91
|
+
entityType: request.entityType,
|
|
92
|
+
experience: 'datasource'
|
|
93
|
+
});
|
|
90
94
|
}
|
|
91
|
-
_context.next =
|
|
95
|
+
_context.next = 11;
|
|
92
96
|
break;
|
|
93
97
|
case 8:
|
|
94
98
|
_context.prev = 8;
|
|
95
99
|
_context.t0 = _context["catch"](1);
|
|
96
100
|
/**
|
|
97
|
-
*
|
|
98
|
-
* We only want one of them with entityType, leave the rest out.
|
|
101
|
+
* captureError was already initialised with integrationKey or datasourceId
|
|
99
102
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
case 12:
|
|
103
|
+
captureError('actionDiscovery', _context.t0);
|
|
104
|
+
case 11:
|
|
103
105
|
case "end":
|
|
104
106
|
return _context.stop();
|
|
105
107
|
}
|
|
@@ -118,17 +120,18 @@ var ActionsStore = exports.ActionsStore = (0, _reactSweetState.createStore)({
|
|
|
118
120
|
});
|
|
119
121
|
var useActionStoreActions = (0, _reactSweetState.createActionsHook)(ActionsStore);
|
|
120
122
|
var useDiscoverActions = exports.useDiscoverActions = function useDiscoverActions(_ref3) {
|
|
121
|
-
var captureError = _ref3.captureError
|
|
123
|
+
var captureError = _ref3.captureError,
|
|
124
|
+
fireEvent = _ref3.fireEvent;
|
|
122
125
|
var _useDatasourceClientE = (0, _linkClientExtension.useDatasourceClientExtension)(),
|
|
123
126
|
getDatasourceActionsAndPermissions = _useDatasourceClientE.getDatasourceActionsAndPermissions;
|
|
124
127
|
var _useActionStoreAction = useActionStoreActions(),
|
|
125
128
|
discoverActions = _useActionStoreAction.discoverActions;
|
|
126
129
|
return {
|
|
127
130
|
discoverActions: (0, _react.useMemo)(function () {
|
|
128
|
-
return discoverActions.bind(null, captureError, {
|
|
131
|
+
return discoverActions.bind(null, captureError, fireEvent, {
|
|
129
132
|
getDatasourceActionsAndPermissions: getDatasourceActionsAndPermissions
|
|
130
133
|
});
|
|
131
|
-
}, [captureError, discoverActions, getDatasourceActionsAndPermissions])
|
|
134
|
+
}, [captureError, discoverActions, fireEvent, getDatasourceActionsAndPermissions])
|
|
132
135
|
};
|
|
133
136
|
};
|
|
134
137
|
var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4) {
|
|
@@ -41,7 +41,7 @@ const getInitialState = () => ({
|
|
|
41
41
|
permissions: {}
|
|
42
42
|
});
|
|
43
43
|
export const actions = {
|
|
44
|
-
discoverActions: (captureError, api, request) => async ({
|
|
44
|
+
discoverActions: (captureError, fireEvent, api, request) => async ({
|
|
45
45
|
setState,
|
|
46
46
|
getState
|
|
47
47
|
}) => {
|
|
@@ -75,18 +75,18 @@ export const actions = {
|
|
|
75
75
|
actionsByIntegration,
|
|
76
76
|
permissions
|
|
77
77
|
});
|
|
78
|
+
fireEvent('operational.actionDiscovery.success', {
|
|
79
|
+
integrationKey: 'integrationKey' in request ? request.integrationKey : null,
|
|
80
|
+
datasourceId: 'datasourceId' in request ? request.datasourceId : null,
|
|
81
|
+
entityType: request.entityType,
|
|
82
|
+
experience: 'datasource'
|
|
83
|
+
});
|
|
78
84
|
}
|
|
79
85
|
} catch (error) {
|
|
80
86
|
/**
|
|
81
|
-
*
|
|
82
|
-
* We only want one of them with entityType, leave the rest out.
|
|
87
|
+
* captureError was already initialised with integrationKey or datasourceId
|
|
83
88
|
*/
|
|
84
|
-
|
|
85
|
-
aris,
|
|
86
|
-
fieldKeys,
|
|
87
|
-
...rest
|
|
88
|
-
} = request;
|
|
89
|
-
captureError('actionDiscovery', error, rest);
|
|
89
|
+
captureError('actionDiscovery', error);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
};
|
|
@@ -97,7 +97,8 @@ export const ActionsStore = createStore({
|
|
|
97
97
|
});
|
|
98
98
|
const useActionStoreActions = createActionsHook(ActionsStore);
|
|
99
99
|
export const useDiscoverActions = ({
|
|
100
|
-
captureError
|
|
100
|
+
captureError,
|
|
101
|
+
fireEvent
|
|
101
102
|
}) => {
|
|
102
103
|
const {
|
|
103
104
|
getDatasourceActionsAndPermissions
|
|
@@ -106,9 +107,9 @@ export const useDiscoverActions = ({
|
|
|
106
107
|
discoverActions
|
|
107
108
|
} = useActionStoreActions();
|
|
108
109
|
return {
|
|
109
|
-
discoverActions: useMemo(() => discoverActions.bind(null, captureError, {
|
|
110
|
+
discoverActions: useMemo(() => discoverActions.bind(null, captureError, fireEvent, {
|
|
110
111
|
getDatasourceActionsAndPermissions
|
|
111
|
-
}), [captureError, discoverActions, getDatasourceActionsAndPermissions])
|
|
112
|
+
}), [captureError, discoverActions, fireEvent, getDatasourceActionsAndPermissions])
|
|
112
113
|
};
|
|
113
114
|
};
|
|
114
115
|
const getFieldUpdateActionByAri = (state, {
|
|
@@ -24,7 +24,8 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
24
24
|
var _useDatasourceActions = useDatasourceActions(),
|
|
25
25
|
onAddItems = _useDatasourceActions.onAddItems;
|
|
26
26
|
var _useDiscoverActions = useDiscoverActions({
|
|
27
|
-
captureError: captureError
|
|
27
|
+
captureError: captureError,
|
|
28
|
+
fireEvent: fireEvent
|
|
28
29
|
}),
|
|
29
30
|
discoverActions = _useDiscoverActions.discoverActions;
|
|
30
31
|
var idFieldCount = 1;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
|
-
var _excluded = ["aris", "fieldKeys"];
|
|
6
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -51,10 +49,10 @@ var getInitialState = function getInitialState() {
|
|
|
51
49
|
};
|
|
52
50
|
};
|
|
53
51
|
export var actions = {
|
|
54
|
-
discoverActions: function discoverActions(captureError, api, request) {
|
|
52
|
+
discoverActions: function discoverActions(captureError, fireEvent, api, request) {
|
|
55
53
|
return /*#__PURE__*/function () {
|
|
56
54
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
57
|
-
var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions
|
|
55
|
+
var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions;
|
|
58
56
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
59
57
|
while (1) switch (_context.prev = _context.next) {
|
|
60
58
|
case 0:
|
|
@@ -81,19 +79,23 @@ export var actions = {
|
|
|
81
79
|
actionsByIntegration: actionsByIntegration,
|
|
82
80
|
permissions: permissions
|
|
83
81
|
});
|
|
82
|
+
fireEvent('operational.actionDiscovery.success', {
|
|
83
|
+
integrationKey: 'integrationKey' in request ? request.integrationKey : null,
|
|
84
|
+
datasourceId: 'datasourceId' in request ? request.datasourceId : null,
|
|
85
|
+
entityType: request.entityType,
|
|
86
|
+
experience: 'datasource'
|
|
87
|
+
});
|
|
84
88
|
}
|
|
85
|
-
_context.next =
|
|
89
|
+
_context.next = 11;
|
|
86
90
|
break;
|
|
87
91
|
case 8:
|
|
88
92
|
_context.prev = 8;
|
|
89
93
|
_context.t0 = _context["catch"](1);
|
|
90
94
|
/**
|
|
91
|
-
*
|
|
92
|
-
* We only want one of them with entityType, leave the rest out.
|
|
95
|
+
* captureError was already initialised with integrationKey or datasourceId
|
|
93
96
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
case 12:
|
|
97
|
+
captureError('actionDiscovery', _context.t0);
|
|
98
|
+
case 11:
|
|
97
99
|
case "end":
|
|
98
100
|
return _context.stop();
|
|
99
101
|
}
|
|
@@ -112,17 +114,18 @@ export var ActionsStore = createStore({
|
|
|
112
114
|
});
|
|
113
115
|
var useActionStoreActions = createActionsHook(ActionsStore);
|
|
114
116
|
export var useDiscoverActions = function useDiscoverActions(_ref3) {
|
|
115
|
-
var captureError = _ref3.captureError
|
|
117
|
+
var captureError = _ref3.captureError,
|
|
118
|
+
fireEvent = _ref3.fireEvent;
|
|
116
119
|
var _useDatasourceClientE = useDatasourceClientExtension(),
|
|
117
120
|
getDatasourceActionsAndPermissions = _useDatasourceClientE.getDatasourceActionsAndPermissions;
|
|
118
121
|
var _useActionStoreAction = useActionStoreActions(),
|
|
119
122
|
discoverActions = _useActionStoreAction.discoverActions;
|
|
120
123
|
return {
|
|
121
124
|
discoverActions: useMemo(function () {
|
|
122
|
-
return discoverActions.bind(null, captureError, {
|
|
125
|
+
return discoverActions.bind(null, captureError, fireEvent, {
|
|
123
126
|
getDatasourceActionsAndPermissions: getDatasourceActionsAndPermissions
|
|
124
127
|
});
|
|
125
|
-
}, [captureError, discoverActions, getDatasourceActionsAndPermissions])
|
|
128
|
+
}, [captureError, discoverActions, fireEvent, getDatasourceActionsAndPermissions])
|
|
126
129
|
};
|
|
127
130
|
};
|
|
128
131
|
var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::26fd2d06084d185e97be01b2070484ff>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type ComponentMetaDataType = {
|
|
@@ -78,8 +78,8 @@ export type ProviderAuthSuccessAttributesType = {
|
|
|
78
78
|
};
|
|
79
79
|
export type ProviderAuthFailureAttributesType = {
|
|
80
80
|
extensionKey: string | null;
|
|
81
|
-
reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
|
|
82
81
|
experience: 'datasource';
|
|
82
|
+
reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
|
|
83
83
|
};
|
|
84
84
|
export type NextItemLoadedAttributesType = {
|
|
85
85
|
destinationObjectTypes: unknown[];
|
|
@@ -141,6 +141,12 @@ export type ObjectSchemasSuccessAttributesType = {};
|
|
|
141
141
|
export type ObjectSchemasFailedAttributesType = {
|
|
142
142
|
statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
|
|
143
143
|
};
|
|
144
|
+
export type ActionDiscoverySuccessAttributesType = {
|
|
145
|
+
experience: 'datasource';
|
|
146
|
+
entityType: string;
|
|
147
|
+
integrationKey: string | null;
|
|
148
|
+
datasourceId: string | null;
|
|
149
|
+
};
|
|
144
150
|
export type AnalyticsEventAttributes = {
|
|
145
151
|
/**
|
|
146
152
|
* Fires when user sees modal dialog. */
|
|
@@ -250,5 +256,8 @@ export type AnalyticsEventAttributes = {
|
|
|
250
256
|
/**
|
|
251
257
|
* Fired when fetching object schemas fails. */
|
|
252
258
|
'operational.objectSchemas.failed': ObjectSchemasFailedAttributesType;
|
|
259
|
+
/**
|
|
260
|
+
* Fired when the action discovery and permissions request is successful. */
|
|
261
|
+
'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
|
|
253
262
|
};
|
|
254
263
|
export type EventKey = keyof AnalyticsEventAttributes;
|
|
@@ -1,6 +1,8 @@
|
|
|
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';
|
|
5
|
+
import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
|
|
4
6
|
type IntegrationKey = string;
|
|
5
7
|
type FieldKey = string;
|
|
6
8
|
/**
|
|
@@ -47,22 +49,26 @@ export interface ActionsStoreState {
|
|
|
47
49
|
interface Client {
|
|
48
50
|
getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
|
|
49
51
|
}
|
|
52
|
+
type AnalyticsCaptureError = (errorLocation: string, error: unknown) => void;
|
|
53
|
+
type AnalyticsFireEvent = <K extends EventKey>(...params: Parameters<typeof createEventPayload<K>>) => void;
|
|
54
|
+
interface UseDiscoverActionsProps {
|
|
55
|
+
captureError: AnalyticsCaptureError;
|
|
56
|
+
fireEvent: AnalyticsFireEvent;
|
|
57
|
+
}
|
|
50
58
|
export declare const actions: {
|
|
51
|
-
discoverActions: (captureError:
|
|
59
|
+
discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
52
60
|
};
|
|
53
61
|
export declare const ActionsStore: import("react-sweet-state").Store<ActionsStoreState, {
|
|
54
|
-
discoverActions: (captureError:
|
|
62
|
+
discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
55
63
|
}>;
|
|
56
|
-
export declare const useDiscoverActions: ({ captureError, }: {
|
|
57
|
-
captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void;
|
|
58
|
-
}) => {
|
|
64
|
+
export declare const useDiscoverActions: ({ captureError, fireEvent }: UseDiscoverActionsProps) => {
|
|
59
65
|
discoverActions: (request: ActionsDiscoveryRequest) => void | Promise<void>;
|
|
60
66
|
};
|
|
61
67
|
/**
|
|
62
68
|
* Retrieves the action schema for a given ARI + fieldKey + integrationKey
|
|
63
69
|
*/
|
|
64
70
|
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description"> | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
|
|
65
|
-
discoverActions: (captureError:
|
|
71
|
+
discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
66
72
|
}>, {
|
|
67
73
|
ari: string;
|
|
68
74
|
fieldKey: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::26fd2d06084d185e97be01b2070484ff>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type ComponentMetaDataType = {
|
|
@@ -78,8 +78,8 @@ export type ProviderAuthSuccessAttributesType = {
|
|
|
78
78
|
};
|
|
79
79
|
export type ProviderAuthFailureAttributesType = {
|
|
80
80
|
extensionKey: string | null;
|
|
81
|
-
reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
|
|
82
81
|
experience: 'datasource';
|
|
82
|
+
reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
|
|
83
83
|
};
|
|
84
84
|
export type NextItemLoadedAttributesType = {
|
|
85
85
|
destinationObjectTypes: unknown[];
|
|
@@ -141,6 +141,12 @@ export type ObjectSchemasSuccessAttributesType = {};
|
|
|
141
141
|
export type ObjectSchemasFailedAttributesType = {
|
|
142
142
|
statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
|
|
143
143
|
};
|
|
144
|
+
export type ActionDiscoverySuccessAttributesType = {
|
|
145
|
+
experience: 'datasource';
|
|
146
|
+
entityType: string;
|
|
147
|
+
integrationKey: string | null;
|
|
148
|
+
datasourceId: string | null;
|
|
149
|
+
};
|
|
144
150
|
export type AnalyticsEventAttributes = {
|
|
145
151
|
/**
|
|
146
152
|
* Fires when user sees modal dialog. */
|
|
@@ -250,5 +256,8 @@ export type AnalyticsEventAttributes = {
|
|
|
250
256
|
/**
|
|
251
257
|
* Fired when fetching object schemas fails. */
|
|
252
258
|
'operational.objectSchemas.failed': ObjectSchemasFailedAttributesType;
|
|
259
|
+
/**
|
|
260
|
+
* Fired when the action discovery and permissions request is successful. */
|
|
261
|
+
'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
|
|
253
262
|
};
|
|
254
263
|
export type EventKey = keyof AnalyticsEventAttributes;
|
|
@@ -1,6 +1,8 @@
|
|
|
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';
|
|
5
|
+
import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
|
|
4
6
|
type IntegrationKey = string;
|
|
5
7
|
type FieldKey = string;
|
|
6
8
|
/**
|
|
@@ -47,22 +49,26 @@ export interface ActionsStoreState {
|
|
|
47
49
|
interface Client {
|
|
48
50
|
getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
|
|
49
51
|
}
|
|
52
|
+
type AnalyticsCaptureError = (errorLocation: string, error: unknown) => void;
|
|
53
|
+
type AnalyticsFireEvent = <K extends EventKey>(...params: Parameters<typeof createEventPayload<K>>) => void;
|
|
54
|
+
interface UseDiscoverActionsProps {
|
|
55
|
+
captureError: AnalyticsCaptureError;
|
|
56
|
+
fireEvent: AnalyticsFireEvent;
|
|
57
|
+
}
|
|
50
58
|
export declare const actions: {
|
|
51
|
-
discoverActions: (captureError:
|
|
59
|
+
discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
52
60
|
};
|
|
53
61
|
export declare const ActionsStore: import("react-sweet-state").Store<ActionsStoreState, {
|
|
54
|
-
discoverActions: (captureError:
|
|
62
|
+
discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
55
63
|
}>;
|
|
56
|
-
export declare const useDiscoverActions: ({ captureError, }: {
|
|
57
|
-
captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void;
|
|
58
|
-
}) => {
|
|
64
|
+
export declare const useDiscoverActions: ({ captureError, fireEvent }: UseDiscoverActionsProps) => {
|
|
59
65
|
discoverActions: (request: ActionsDiscoveryRequest) => void | Promise<void>;
|
|
60
66
|
};
|
|
61
67
|
/**
|
|
62
68
|
* Retrieves the action schema for a given ARI + fieldKey + integrationKey
|
|
63
69
|
*/
|
|
64
70
|
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description"> | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
|
|
65
|
-
discoverActions: (captureError:
|
|
71
|
+
discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
66
72
|
}>, {
|
|
67
73
|
ari: string;
|
|
68
74
|
fieldKey: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.11",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"analytics:codegen": "yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource --output ./src/analytics/generated"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@atlaskit/adf-schema": "^40.
|
|
39
|
+
"@atlaskit/adf-schema": "^40.9.0",
|
|
40
40
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
41
41
|
"@atlaskit/avatar": "^21.15.0",
|
|
42
42
|
"@atlaskit/avatar-group": "^9.11.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@atlaskit/jql-editor": "^4.5.0",
|
|
59
59
|
"@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
|
|
60
60
|
"@atlaskit/layering": "^0.4.0",
|
|
61
|
-
"@atlaskit/link-client-extension": "^2.
|
|
61
|
+
"@atlaskit/link-client-extension": "^2.2.0",
|
|
62
62
|
"@atlaskit/linking-common": "^5.11.0",
|
|
63
63
|
"@atlaskit/linking-types": "^9.0.0",
|
|
64
64
|
"@atlaskit/logo": "^14.2.0",
|