@atlaskit/link-datasource 3.8.3 → 3.8.4

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
+ ## 3.8.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#161257](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/161257)
8
+ [`085902303c5ee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/085902303c5ee) -
9
+ Fixes how we pass input params to executeFetchAction - behind ff
10
+
3
11
  ## 3.8.3
4
12
 
5
13
  ### Patch Changes
@@ -179,7 +179,6 @@ var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4)
179
179
  var useAtomicUpdateActionSchema = exports.useAtomicUpdateActionSchema = (0, _reactSweetState.createHook)(ActionsStore, {
180
180
  selector: getFieldUpdateActionByAri
181
181
  });
182
-
183
182
  /**
184
183
  * Given an ARI + fieldKey + integrationKey
185
184
  * Returns an executable action that updates a field on the entity if the user has permissions to do so
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
@@ -97,7 +96,7 @@ var loadOptions = /*#__PURE__*/function () {
97
96
  break;
98
97
  }
99
98
  _context.next = 3;
100
- return executeFetch((0, _defineProperty2.default)({}, currentValue.type, currentValue.values[0]));
99
+ return executeFetch({});
101
100
  case 3:
102
101
  result = _context.sent;
103
102
  operationStatus = result.operationStatus, entities = result.entities;
@@ -161,7 +161,6 @@ const getFieldUpdateActionByAri = (state, {
161
161
  export const useAtomicUpdateActionSchema = createHook(ActionsStore, {
162
162
  selector: getFieldUpdateActionByAri
163
163
  });
164
-
165
164
  /**
166
165
  * Given an ARI + fieldKey + integrationKey
167
166
  * Returns an executable action that updates a field on the entity if the user has permissions to do so
@@ -67,9 +67,7 @@ const useStatusOptions = (currentValue, executeFetch) => {
67
67
  };
68
68
  const loadOptions = async (currentValue, executeFetch) => {
69
69
  if (executeFetch) {
70
- const result = await executeFetch({
71
- [currentValue.type]: currentValue.values[0]
72
- });
70
+ const result = await executeFetch({});
73
71
  const {
74
72
  operationStatus,
75
73
  entities
@@ -173,7 +173,6 @@ var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4)
173
173
  export var useAtomicUpdateActionSchema = createHook(ActionsStore, {
174
174
  selector: getFieldUpdateActionByAri
175
175
  });
176
-
177
176
  /**
178
177
  * Given an ARI + fieldKey + integrationKey
179
178
  * Returns an executable action that updates a field on the entity if the user has permissions to do so
@@ -1,4 +1,3 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
3
  import _extends from "@babel/runtime/helpers/extends";
@@ -87,7 +86,7 @@ var loadOptions = /*#__PURE__*/function () {
87
86
  break;
88
87
  }
89
88
  _context.next = 3;
90
- return executeFetch(_defineProperty({}, currentValue.type, currentValue.values[0]));
89
+ return executeFetch({});
91
90
  case 3:
92
91
  result = _context.sent;
93
92
  operationStatus = result.operationStatus, entities = result.entities;
@@ -1,6 +1,6 @@
1
1
  import { type Action } from 'react-sweet-state';
2
2
  import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
3
- import type { ActionsDiscoveryRequest, AtomicActionExecuteResponse, AtomicActionInterface } from '@atlaskit/linking-types';
3
+ import type { ActionsDiscoveryRequest, AtomicActionExecuteRequest, AtomicActionExecuteResponse, AtomicActionInterface } from '@atlaskit/linking-types';
4
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;
@@ -96,6 +96,7 @@ export declare const useAtomicUpdateActionSchema: import("react-sweet-state").Ho
96
96
  fieldKey: string;
97
97
  integrationKey: string;
98
98
  }>;
99
+ export type ExecuteFetch = <E>(inputs: AtomicActionExecuteRequest['parameters']['inputs']) => Promise<E>;
99
100
  /**
100
101
  * Given an ARI + fieldKey + integrationKey
101
102
  * Returns an executable action that updates a field on the entity if the user has permissions to do so
@@ -113,6 +114,6 @@ export declare const useExecuteAtomicAction: ({ ari, fieldKey, integrationKey, }
113
114
  integrationKey: string;
114
115
  }) => {
115
116
  execute?: ((value: string | number) => Promise<AtomicActionExecuteResponse<unknown>>) | undefined;
116
- executeFetch?: (<E>(inputs: any) => Promise<E>) | undefined;
117
+ executeFetch?: ExecuteFetch | undefined;
117
118
  };
118
119
  export {};
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type FieldProps } from '@atlaskit/form';
3
+ import type { ExecuteFetch } from '../../../../state/actions';
3
4
  import type { DatasourceTypeWithOnlyValues } from '../../types';
4
5
  interface Props extends Omit<FieldProps<string>, 'value'> {
5
6
  currentValue: DatasourceTypeWithOnlyValues;
6
7
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
7
- executeFetch?: <E>(inputs: any) => Promise<E>;
8
+ executeFetch?: ExecuteFetch;
8
9
  }
9
10
  declare const StatusEditType: (props: Props) => JSX.Element;
10
11
  export default StatusEditType;
@@ -1,6 +1,6 @@
1
1
  import { type Action } from 'react-sweet-state';
2
2
  import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
3
- import type { ActionsDiscoveryRequest, AtomicActionExecuteResponse, AtomicActionInterface } from '@atlaskit/linking-types';
3
+ import type { ActionsDiscoveryRequest, AtomicActionExecuteRequest, AtomicActionExecuteResponse, AtomicActionInterface } from '@atlaskit/linking-types';
4
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;
@@ -96,6 +96,7 @@ export declare const useAtomicUpdateActionSchema: import("react-sweet-state").Ho
96
96
  fieldKey: string;
97
97
  integrationKey: string;
98
98
  }>;
99
+ export type ExecuteFetch = <E>(inputs: AtomicActionExecuteRequest['parameters']['inputs']) => Promise<E>;
99
100
  /**
100
101
  * Given an ARI + fieldKey + integrationKey
101
102
  * Returns an executable action that updates a field on the entity if the user has permissions to do so
@@ -113,6 +114,6 @@ export declare const useExecuteAtomicAction: ({ ari, fieldKey, integrationKey, }
113
114
  integrationKey: string;
114
115
  }) => {
115
116
  execute?: ((value: string | number) => Promise<AtomicActionExecuteResponse<unknown>>) | undefined;
116
- executeFetch?: (<E>(inputs: any) => Promise<E>) | undefined;
117
+ executeFetch?: ExecuteFetch | undefined;
117
118
  };
118
119
  export {};
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type FieldProps } from '@atlaskit/form';
3
+ import type { ExecuteFetch } from '../../../../state/actions';
3
4
  import type { DatasourceTypeWithOnlyValues } from '../../types';
4
5
  interface Props extends Omit<FieldProps<string>, 'value'> {
5
6
  currentValue: DatasourceTypeWithOnlyValues;
6
7
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
7
- executeFetch?: <E>(inputs: any) => Promise<E>;
8
+ executeFetch?: ExecuteFetch;
8
9
  }
9
10
  declare const StatusEditType: (props: Props) => JSX.Element;
10
11
  export default StatusEditType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "3.8.3",
3
+ "version": "3.8.4",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",