@atlaskit/link-datasource 3.6.13 → 3.6.14
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 +9 -0
- package/dist/cjs/state/actions/index.js +33 -11
- package/dist/es2019/state/actions/index.js +43 -18
- package/dist/esm/state/actions/index.js +33 -11
- package/dist/types/state/actions/index.d.ts +27 -11
- package/dist/types-ts4.5/state/actions/index.d.ts +27 -11
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 3.6.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#157343](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157343)
|
|
8
|
+
[`64cef773c3dcf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/64cef773c3dcf) -
|
|
9
|
+
Internal refactor to support fetchActions behind new ff: `enable_datasource_supporting_actions`
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.6.13
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
var _reactSweetState = require("react-sweet-state");
|
|
14
14
|
var _linkClientExtension = require("@atlaskit/link-client-extension");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _analytics = require("../../analytics");
|
|
16
17
|
var _useErrorLogger2 = _interopRequireDefault(require("../../hooks/useErrorLogger"));
|
|
17
18
|
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; }
|
|
@@ -20,15 +21,27 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
21
|
* Atomic actions available for an integration (by field)
|
|
21
22
|
* @example
|
|
22
23
|
* ```ts
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
24
|
+
* {
|
|
25
|
+
* jira: {
|
|
26
|
+
* summary: {
|
|
27
|
+
* actionKey: 'atlassian:work-item:update:summary',
|
|
28
|
+
* type: 'string'
|
|
29
|
+
* },
|
|
30
|
+
* status: {
|
|
31
|
+
* actionKey: 'atlassian:work-item:update:status',
|
|
32
|
+
* type: 'string',
|
|
33
|
+
* fetchAction: {
|
|
34
|
+
* actionKey: 'atlassian:work-item:get:statuses',
|
|
35
|
+
* type: 'string',
|
|
36
|
+
* inputs: {
|
|
37
|
+
* issueId: {
|
|
38
|
+
* type: 'string'
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
32
45
|
* ```
|
|
33
46
|
*/
|
|
34
47
|
|
|
@@ -73,10 +86,19 @@ var actions = exports.actions = {
|
|
|
73
86
|
if ('permissions' in response) {
|
|
74
87
|
_getState = getState(), currentActions = _getState.actionsByIntegration, currentPermissions = _getState.permissions;
|
|
75
88
|
actionsByIntegration = response.actions.reduce(function (acc, action) {
|
|
76
|
-
|
|
89
|
+
var _action$inputs;
|
|
90
|
+
var fieldKey = action.fieldKey;
|
|
91
|
+
var fetchAction = (_action$inputs = action.inputs) === null || _action$inputs === void 0 || (_action$inputs = _action$inputs[fieldKey]) === null || _action$inputs === void 0 ? void 0 : _action$inputs.fetchAction;
|
|
92
|
+
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, action.integrationKey, _objectSpread(_objectSpread({}, acc[action.integrationKey]), {}, (0, _defineProperty2.default)({}, fieldKey, _objectSpread({
|
|
77
93
|
actionKey: action.actionKey,
|
|
78
94
|
type: action.type
|
|
79
|
-
}))
|
|
95
|
+
}, fetchAction && (0, _platformFeatureFlags.fg)('enable_datasource_supporting_actions') && {
|
|
96
|
+
fetchAction: {
|
|
97
|
+
actionKey: fetchAction.actionKey,
|
|
98
|
+
type: fetchAction.type,
|
|
99
|
+
inputs: fetchAction.inputs
|
|
100
|
+
}
|
|
101
|
+
})))));
|
|
80
102
|
}, currentActions);
|
|
81
103
|
permissions = response.permissions.data.reduce(function (acc, permission) {
|
|
82
104
|
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, permission.ari, _objectSpread(_objectSpread({}, acc[permission.ari]), {}, (0, _defineProperty2.default)({}, permission.fieldKey, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
2
|
import { createActionsHook, createHook, createStore } from 'react-sweet-state';
|
|
3
3
|
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
5
6
|
import useErrorLogger from '../../hooks/useErrorLogger';
|
|
6
7
|
|
|
@@ -8,15 +9,27 @@ import useErrorLogger from '../../hooks/useErrorLogger';
|
|
|
8
9
|
* Atomic actions available for an integration (by field)
|
|
9
10
|
* @example
|
|
10
11
|
* ```ts
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
12
|
+
* {
|
|
13
|
+
* jira: {
|
|
14
|
+
* summary: {
|
|
15
|
+
* actionKey: 'atlassian:work-item:update:summary',
|
|
16
|
+
* type: 'string'
|
|
17
|
+
* },
|
|
18
|
+
* status: {
|
|
19
|
+
* actionKey: 'atlassian:work-item:update:status',
|
|
20
|
+
* type: 'string',
|
|
21
|
+
* fetchAction: {
|
|
22
|
+
* actionKey: 'atlassian:work-item:get:statuses',
|
|
23
|
+
* type: 'string',
|
|
24
|
+
* inputs: {
|
|
25
|
+
* issueId: {
|
|
26
|
+
* type: 'string'
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
20
33
|
* ```
|
|
21
34
|
*/
|
|
22
35
|
|
|
@@ -54,16 +67,28 @@ export const actions = {
|
|
|
54
67
|
actionsByIntegration: currentActions,
|
|
55
68
|
permissions: currentPermissions
|
|
56
69
|
} = getState();
|
|
57
|
-
const actionsByIntegration = response.actions.reduce((acc, action) =>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
const actionsByIntegration = response.actions.reduce((acc, action) => {
|
|
71
|
+
var _action$inputs, _action$inputs$fieldK;
|
|
72
|
+
const fieldKey = action.fieldKey;
|
|
73
|
+
const fetchAction = (_action$inputs = action.inputs) === null || _action$inputs === void 0 ? void 0 : (_action$inputs$fieldK = _action$inputs[fieldKey]) === null || _action$inputs$fieldK === void 0 ? void 0 : _action$inputs$fieldK.fetchAction;
|
|
74
|
+
return {
|
|
75
|
+
...acc,
|
|
76
|
+
[action.integrationKey]: {
|
|
77
|
+
...acc[action.integrationKey],
|
|
78
|
+
[fieldKey]: {
|
|
79
|
+
actionKey: action.actionKey,
|
|
80
|
+
type: action.type,
|
|
81
|
+
...(fetchAction && fg('enable_datasource_supporting_actions') && {
|
|
82
|
+
fetchAction: {
|
|
83
|
+
actionKey: fetchAction.actionKey,
|
|
84
|
+
type: fetchAction.type,
|
|
85
|
+
inputs: fetchAction.inputs
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
}
|
|
64
89
|
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
90
|
+
};
|
|
91
|
+
}, currentActions);
|
|
67
92
|
const permissions = response.permissions.data.reduce((acc, permission) => ({
|
|
68
93
|
...acc,
|
|
69
94
|
[permission.ari]: {
|
|
@@ -7,6 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { useCallback, useMemo } from 'react';
|
|
8
8
|
import { createActionsHook, createHook, createStore } from 'react-sweet-state';
|
|
9
9
|
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
11
12
|
import useErrorLogger from '../../hooks/useErrorLogger';
|
|
12
13
|
|
|
@@ -14,15 +15,27 @@ import useErrorLogger from '../../hooks/useErrorLogger';
|
|
|
14
15
|
* Atomic actions available for an integration (by field)
|
|
15
16
|
* @example
|
|
16
17
|
* ```ts
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
18
|
+
* {
|
|
19
|
+
* jira: {
|
|
20
|
+
* summary: {
|
|
21
|
+
* actionKey: 'atlassian:work-item:update:summary',
|
|
22
|
+
* type: 'string'
|
|
23
|
+
* },
|
|
24
|
+
* status: {
|
|
25
|
+
* actionKey: 'atlassian:work-item:update:status',
|
|
26
|
+
* type: 'string',
|
|
27
|
+
* fetchAction: {
|
|
28
|
+
* actionKey: 'atlassian:work-item:get:statuses',
|
|
29
|
+
* type: 'string',
|
|
30
|
+
* inputs: {
|
|
31
|
+
* issueId: {
|
|
32
|
+
* type: 'string'
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
26
39
|
* ```
|
|
27
40
|
*/
|
|
28
41
|
|
|
@@ -67,10 +80,19 @@ export var actions = {
|
|
|
67
80
|
if ('permissions' in response) {
|
|
68
81
|
_getState = getState(), currentActions = _getState.actionsByIntegration, currentPermissions = _getState.permissions;
|
|
69
82
|
actionsByIntegration = response.actions.reduce(function (acc, action) {
|
|
70
|
-
|
|
83
|
+
var _action$inputs;
|
|
84
|
+
var fieldKey = action.fieldKey;
|
|
85
|
+
var fetchAction = (_action$inputs = action.inputs) === null || _action$inputs === void 0 || (_action$inputs = _action$inputs[fieldKey]) === null || _action$inputs === void 0 ? void 0 : _action$inputs.fetchAction;
|
|
86
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, action.integrationKey, _objectSpread(_objectSpread({}, acc[action.integrationKey]), {}, _defineProperty({}, fieldKey, _objectSpread({
|
|
71
87
|
actionKey: action.actionKey,
|
|
72
88
|
type: action.type
|
|
73
|
-
})
|
|
89
|
+
}, fetchAction && fg('enable_datasource_supporting_actions') && {
|
|
90
|
+
fetchAction: {
|
|
91
|
+
actionKey: fetchAction.actionKey,
|
|
92
|
+
type: fetchAction.type,
|
|
93
|
+
inputs: fetchAction.inputs
|
|
94
|
+
}
|
|
95
|
+
})))));
|
|
74
96
|
}, currentActions);
|
|
75
97
|
permissions = response.permissions.data.reduce(function (acc, permission) {
|
|
76
98
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, permission.ari, _objectSpread(_objectSpread({}, acc[permission.ari]), {}, _defineProperty({}, permission.fieldKey, {
|
|
@@ -9,18 +9,32 @@ type FieldKey = string;
|
|
|
9
9
|
* Atomic actions available for an integration (by field)
|
|
10
10
|
* @example
|
|
11
11
|
* ```ts
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
12
|
+
* {
|
|
13
|
+
* jira: {
|
|
14
|
+
* summary: {
|
|
15
|
+
* actionKey: 'atlassian:work-item:update:summary',
|
|
16
|
+
* type: 'string'
|
|
17
|
+
* },
|
|
18
|
+
* status: {
|
|
19
|
+
* actionKey: 'atlassian:work-item:update:status',
|
|
20
|
+
* type: 'string',
|
|
21
|
+
* fetchAction: {
|
|
22
|
+
* actionKey: 'atlassian:work-item:get:statuses',
|
|
23
|
+
* type: 'string',
|
|
24
|
+
* inputs: {
|
|
25
|
+
* issueId: {
|
|
26
|
+
* type: 'string'
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
21
33
|
* ```
|
|
22
34
|
*/
|
|
23
|
-
type IntegrationActions = Record<IntegrationKey, Record<FieldKey, Pick<AtomicActionInterface, 'actionKey' | 'type' | 'description'
|
|
35
|
+
type IntegrationActions = Record<IntegrationKey, Record<FieldKey, Pick<AtomicActionInterface, 'actionKey' | 'type' | 'description'> & {
|
|
36
|
+
fetchAction?: Pick<AtomicActionInterface, 'actionKey' | 'type' | 'inputs'>;
|
|
37
|
+
}>>;
|
|
24
38
|
/**
|
|
25
39
|
* Permissions available for a target
|
|
26
40
|
*/
|
|
@@ -67,7 +81,9 @@ export declare const useDiscoverActions: ({ captureError, fireEvent }: UseDiscov
|
|
|
67
81
|
/**
|
|
68
82
|
* Retrieves the action schema for a given ARI + fieldKey + integrationKey
|
|
69
83
|
*/
|
|
70
|
-
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description">
|
|
84
|
+
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<(Pick<AtomicActionInterface, "actionKey" | "type" | "description"> & {
|
|
85
|
+
fetchAction?: Pick<AtomicActionInterface, "actionKey" | "type" | "inputs"> | undefined;
|
|
86
|
+
}) | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
|
|
71
87
|
discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
72
88
|
}>, {
|
|
73
89
|
ari: string;
|
|
@@ -9,18 +9,32 @@ type FieldKey = string;
|
|
|
9
9
|
* Atomic actions available for an integration (by field)
|
|
10
10
|
* @example
|
|
11
11
|
* ```ts
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
12
|
+
* {
|
|
13
|
+
* jira: {
|
|
14
|
+
* summary: {
|
|
15
|
+
* actionKey: 'atlassian:work-item:update:summary',
|
|
16
|
+
* type: 'string'
|
|
17
|
+
* },
|
|
18
|
+
* status: {
|
|
19
|
+
* actionKey: 'atlassian:work-item:update:status',
|
|
20
|
+
* type: 'string',
|
|
21
|
+
* fetchAction: {
|
|
22
|
+
* actionKey: 'atlassian:work-item:get:statuses',
|
|
23
|
+
* type: 'string',
|
|
24
|
+
* inputs: {
|
|
25
|
+
* issueId: {
|
|
26
|
+
* type: 'string'
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
21
33
|
* ```
|
|
22
34
|
*/
|
|
23
|
-
type IntegrationActions = Record<IntegrationKey, Record<FieldKey, Pick<AtomicActionInterface, 'actionKey' | 'type' | 'description'
|
|
35
|
+
type IntegrationActions = Record<IntegrationKey, Record<FieldKey, Pick<AtomicActionInterface, 'actionKey' | 'type' | 'description'> & {
|
|
36
|
+
fetchAction?: Pick<AtomicActionInterface, 'actionKey' | 'type' | 'inputs'>;
|
|
37
|
+
}>>;
|
|
24
38
|
/**
|
|
25
39
|
* Permissions available for a target
|
|
26
40
|
*/
|
|
@@ -67,7 +81,9 @@ export declare const useDiscoverActions: ({ captureError, fireEvent }: UseDiscov
|
|
|
67
81
|
/**
|
|
68
82
|
* Retrieves the action schema for a given ARI + fieldKey + integrationKey
|
|
69
83
|
*/
|
|
70
|
-
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description">
|
|
84
|
+
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<(Pick<AtomicActionInterface, "actionKey" | "type" | "description"> & {
|
|
85
|
+
fetchAction?: Pick<AtomicActionInterface, "actionKey" | "type" | "inputs"> | undefined;
|
|
86
|
+
}) | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
|
|
71
87
|
discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
72
88
|
}>, {
|
|
73
89
|
ari: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.14",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/layering": "^0.7.0",
|
|
60
60
|
"@atlaskit/link-client-extension": "^2.4.0",
|
|
61
61
|
"@atlaskit/linking-common": "^6.0.0",
|
|
62
|
-
"@atlaskit/linking-types": "^9.
|
|
62
|
+
"@atlaskit/linking-types": "^9.3.0",
|
|
63
63
|
"@atlaskit/logo": "^14.3.0",
|
|
64
64
|
"@atlaskit/lozenge": "^11.12.0",
|
|
65
65
|
"@atlaskit/modal-dialog": "^12.17.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^1.2.0",
|
|
72
72
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
73
73
|
"@atlaskit/primitives": "^12.2.0",
|
|
74
|
-
"@atlaskit/select": "^18.
|
|
74
|
+
"@atlaskit/select": "^18.4.0",
|
|
75
75
|
"@atlaskit/smart-card": "^30.1.0",
|
|
76
76
|
"@atlaskit/smart-user-picker": "6.11.1",
|
|
77
77
|
"@atlaskit/spinner": "^16.3.0",
|
|
@@ -161,6 +161,9 @@
|
|
|
161
161
|
"platform-datasources-enable-two-way-sync": {
|
|
162
162
|
"type": "boolean"
|
|
163
163
|
},
|
|
164
|
+
"enable_datasource_supporting_actions": {
|
|
165
|
+
"type": "boolean"
|
|
166
|
+
},
|
|
164
167
|
"platform.linking-platform.datasource-assets_add_version_parameter": {
|
|
165
168
|
"type": "boolean"
|
|
166
169
|
},
|