@atlaskit/link-client-extension 2.4.2 → 3.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/link-client-extension
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
8
+ [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
9
+ Update `React` from v16 to v18
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 3.0.0
16
+
17
+ ### Major Changes
18
+
19
+ - [#168956](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/168956)
20
+ [`311ab96847a83`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/311ab96847a83) -
21
+ Remove related link urls experiment
22
+
3
23
  ## 2.4.2
4
24
 
5
25
  ### Patch Changes
@@ -335,6 +335,48 @@ var mockActionsDiscoveryResponse = exports.mockActionsDiscoveryResponse = {
335
335
  fieldKey: 'summary',
336
336
  integrationKey: 'jira',
337
337
  type: 'string'
338
+ }, {
339
+ integrationKey: 'jira',
340
+ actionKey: 'atlassian:work-item:update:priority',
341
+ fieldKey: 'priority',
342
+ type: 'number',
343
+ inputs: {
344
+ priority: {
345
+ type: 'string',
346
+ fetchAction: {
347
+ actionKey: 'atlassian:work-item:get:priorities',
348
+ integrationKey: 'jira',
349
+ fieldKey: 'priority',
350
+ type: 'string',
351
+ inputs: {
352
+ issueId: {
353
+ type: 'string'
354
+ }
355
+ }
356
+ }
357
+ }
358
+ }
359
+ }, {
360
+ integrationKey: 'jira',
361
+ actionKey: 'atlassian:work-item:update:status',
362
+ type: 'string',
363
+ fieldKey: 'status',
364
+ inputs: {
365
+ status: {
366
+ type: 'string',
367
+ fetchAction: {
368
+ actionKey: 'atlassian:work-item:get:statuses',
369
+ integrationKey: 'jira',
370
+ fieldKey: 'status',
371
+ type: 'string',
372
+ inputs: {
373
+ issueId: {
374
+ type: 'string'
375
+ }
376
+ }
377
+ }
378
+ }
379
+ }
338
380
  }],
339
381
  permissions: {
340
382
  data: [{
@@ -345,6 +387,14 @@ var mockActionsDiscoveryResponse = exports.mockActionsDiscoveryResponse = {
345
387
  ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10030',
346
388
  fieldKey: 'summary',
347
389
  isEditable: true
390
+ }, {
391
+ ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10025',
392
+ fieldKey: 'status',
393
+ isEditable: true
394
+ }, {
395
+ ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10030',
396
+ fieldKey: 'status',
397
+ isEditable: true
348
398
  }]
349
399
  }
350
400
  };
@@ -60,31 +60,9 @@ var useSmartLinkClientExtension = exports.useSmartLinkClientExtension = function
60
60
  return _ref.apply(this, arguments);
61
61
  };
62
62
  }(), [resolverUrl]);
63
- var relatedUrls = (0, _react.useCallback)( /*#__PURE__*/function () {
64
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(url) {
65
- return _regenerator.default.wrap(function _callee2$(_context2) {
66
- while (1) switch (_context2.prev = _context2.next) {
67
- case 0:
68
- _context2.next = 2;
69
- return (0, _linkingCommon.request)('get', "".concat(resolverUrl, "/related-urls?url=").concat(encodeURIComponent(url)), undefined, {
70
- 'Cache-Control': 'private'
71
- }, [200]);
72
- case 2:
73
- return _context2.abrupt("return", _context2.sent);
74
- case 3:
75
- case "end":
76
- return _context2.stop();
77
- }
78
- }, _callee2);
79
- }));
80
- return function (_x2) {
81
- return _ref2.apply(this, arguments);
82
- };
83
- }(), [resolverUrl]);
84
63
  return (0, _react.useMemo)(function () {
85
64
  return {
86
- invoke: invoke,
87
- relatedUrls: relatedUrls
65
+ invoke: invoke
88
66
  };
89
- }, [invoke, relatedUrls]);
67
+ }, [invoke]);
90
68
  };
@@ -327,6 +327,48 @@ export const mockActionsDiscoveryResponse = {
327
327
  fieldKey: 'summary',
328
328
  integrationKey: 'jira',
329
329
  type: 'string'
330
+ }, {
331
+ integrationKey: 'jira',
332
+ actionKey: 'atlassian:work-item:update:priority',
333
+ fieldKey: 'priority',
334
+ type: 'number',
335
+ inputs: {
336
+ priority: {
337
+ type: 'string',
338
+ fetchAction: {
339
+ actionKey: 'atlassian:work-item:get:priorities',
340
+ integrationKey: 'jira',
341
+ fieldKey: 'priority',
342
+ type: 'string',
343
+ inputs: {
344
+ issueId: {
345
+ type: 'string'
346
+ }
347
+ }
348
+ }
349
+ }
350
+ }
351
+ }, {
352
+ integrationKey: 'jira',
353
+ actionKey: 'atlassian:work-item:update:status',
354
+ type: 'string',
355
+ fieldKey: 'status',
356
+ inputs: {
357
+ status: {
358
+ type: 'string',
359
+ fetchAction: {
360
+ actionKey: 'atlassian:work-item:get:statuses',
361
+ integrationKey: 'jira',
362
+ fieldKey: 'status',
363
+ type: 'string',
364
+ inputs: {
365
+ issueId: {
366
+ type: 'string'
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
330
372
  }],
331
373
  permissions: {
332
374
  data: [{
@@ -337,6 +379,14 @@ export const mockActionsDiscoveryResponse = {
337
379
  ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10030',
338
380
  fieldKey: 'summary',
339
381
  isEditable: true
382
+ }, {
383
+ ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10025',
384
+ fieldKey: 'status',
385
+ isEditable: true
386
+ }, {
387
+ ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10030',
388
+ fieldKey: 'status',
389
+ isEditable: true
340
390
  }]
341
391
  }
342
392
  };
@@ -29,13 +29,7 @@ export const useSmartLinkClientExtension = cardClient => {
29
29
  throw err;
30
30
  }
31
31
  }, [resolverUrl]);
32
- const relatedUrls = useCallback(async url => {
33
- return await request('get', `${resolverUrl}/related-urls?url=${encodeURIComponent(url)}`, undefined, {
34
- 'Cache-Control': 'private'
35
- }, [200]);
36
- }, [resolverUrl]);
37
32
  return useMemo(() => ({
38
- invoke,
39
- relatedUrls
40
- }), [invoke, relatedUrls]);
33
+ invoke
34
+ }), [invoke]);
41
35
  };
@@ -328,6 +328,48 @@ export var mockActionsDiscoveryResponse = {
328
328
  fieldKey: 'summary',
329
329
  integrationKey: 'jira',
330
330
  type: 'string'
331
+ }, {
332
+ integrationKey: 'jira',
333
+ actionKey: 'atlassian:work-item:update:priority',
334
+ fieldKey: 'priority',
335
+ type: 'number',
336
+ inputs: {
337
+ priority: {
338
+ type: 'string',
339
+ fetchAction: {
340
+ actionKey: 'atlassian:work-item:get:priorities',
341
+ integrationKey: 'jira',
342
+ fieldKey: 'priority',
343
+ type: 'string',
344
+ inputs: {
345
+ issueId: {
346
+ type: 'string'
347
+ }
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }, {
353
+ integrationKey: 'jira',
354
+ actionKey: 'atlassian:work-item:update:status',
355
+ type: 'string',
356
+ fieldKey: 'status',
357
+ inputs: {
358
+ status: {
359
+ type: 'string',
360
+ fetchAction: {
361
+ actionKey: 'atlassian:work-item:get:statuses',
362
+ integrationKey: 'jira',
363
+ fieldKey: 'status',
364
+ type: 'string',
365
+ inputs: {
366
+ issueId: {
367
+ type: 'string'
368
+ }
369
+ }
370
+ }
371
+ }
372
+ }
331
373
  }],
332
374
  permissions: {
333
375
  data: [{
@@ -338,6 +380,14 @@ export var mockActionsDiscoveryResponse = {
338
380
  ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10030',
339
381
  fieldKey: 'summary',
340
382
  isEditable: true
383
+ }, {
384
+ ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10025',
385
+ fieldKey: 'status',
386
+ isEditable: true
387
+ }, {
388
+ ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10030',
389
+ fieldKey: 'status',
390
+ isEditable: true
341
391
  }]
342
392
  }
343
393
  };
@@ -54,31 +54,9 @@ export var useSmartLinkClientExtension = function useSmartLinkClientExtension(ca
54
54
  return _ref.apply(this, arguments);
55
55
  };
56
56
  }(), [resolverUrl]);
57
- var relatedUrls = useCallback( /*#__PURE__*/function () {
58
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url) {
59
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
60
- while (1) switch (_context2.prev = _context2.next) {
61
- case 0:
62
- _context2.next = 2;
63
- return request('get', "".concat(resolverUrl, "/related-urls?url=").concat(encodeURIComponent(url)), undefined, {
64
- 'Cache-Control': 'private'
65
- }, [200]);
66
- case 2:
67
- return _context2.abrupt("return", _context2.sent);
68
- case 3:
69
- case "end":
70
- return _context2.stop();
71
- }
72
- }, _callee2);
73
- }));
74
- return function (_x2) {
75
- return _ref2.apply(this, arguments);
76
- };
77
- }(), [resolverUrl]);
78
57
  return useMemo(function () {
79
58
  return {
80
- invoke: invoke,
81
- relatedUrls: relatedUrls
59
+ invoke: invoke
82
60
  };
83
- }, [invoke, relatedUrls]);
61
+ }, [invoke]);
84
62
  };
@@ -8,6 +8,6 @@ export declare const useDatasourceClientExtension: () => {
8
8
  getDatasourceDetails: (datasourceId: string, data: DatasourceDetailsRequest, force?: boolean) => Promise<DatasourceDetailsResponse>;
9
9
  getDatasourceData: (datasourceId: string, data: DatasourceDataRequest, force?: boolean) => Promise<DatasourceDataResponse>;
10
10
  getDatasourceActionsAndPermissions: (data: ActionsDiscoveryRequest, force?: boolean) => Promise<ActionsDiscoveryResponse>;
11
- executeAtomicAction: (data: AtomicActionExecuteRequest) => Promise<AtomicActionExecuteResponse>;
11
+ executeAtomicAction: (data: AtomicActionExecuteRequest) => Promise<AtomicActionExecuteResponse<unknown>>;
12
12
  invalidateDatasourceDataCacheByAri: (ari: string) => void;
13
13
  };
@@ -10,5 +10,4 @@ import { type InvokeRequest, type InvokeResponse } from '@atlaskit/linking-types
10
10
  */
11
11
  export declare const useSmartLinkClientExtension: (cardClient: CardClient) => {
12
12
  invoke: (data: InvokeRequest) => Promise<InvokeResponse>;
13
- relatedUrls: <TResponse>(url: string) => Promise<TResponse>;
14
13
  };
@@ -8,6 +8,6 @@ export declare const useDatasourceClientExtension: () => {
8
8
  getDatasourceDetails: (datasourceId: string, data: DatasourceDetailsRequest, force?: boolean) => Promise<DatasourceDetailsResponse>;
9
9
  getDatasourceData: (datasourceId: string, data: DatasourceDataRequest, force?: boolean) => Promise<DatasourceDataResponse>;
10
10
  getDatasourceActionsAndPermissions: (data: ActionsDiscoveryRequest, force?: boolean) => Promise<ActionsDiscoveryResponse>;
11
- executeAtomicAction: (data: AtomicActionExecuteRequest) => Promise<AtomicActionExecuteResponse>;
11
+ executeAtomicAction: (data: AtomicActionExecuteRequest) => Promise<AtomicActionExecuteResponse<unknown>>;
12
12
  invalidateDatasourceDataCacheByAri: (ari: string) => void;
13
13
  };
@@ -10,5 +10,4 @@ import { type InvokeRequest, type InvokeResponse } from '@atlaskit/linking-types
10
10
  */
11
11
  export declare const useSmartLinkClientExtension: (cardClient: CardClient) => {
12
12
  invoke: (data: InvokeRequest) => Promise<InvokeResponse>;
13
- relatedUrls: <TResponse>(url: string) => Promise<TResponse>;
14
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-client-extension",
3
- "version": "2.4.2",
3
+ "version": "3.1.0",
4
4
  "description": "Extension methods for linking platform client",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,23 +33,23 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/linking-common": "^6.0.0",
37
- "@atlaskit/linking-types": "^9.0.0",
36
+ "@atlaskit/linking-common": "^6.2.0",
37
+ "@atlaskit/linking-types": "^9.6.0",
38
38
  "@atlaskit/platform-feature-flags": "0.3.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "json-ld-types": "^4.1.0",
41
41
  "lru_map": "^0.4.1"
42
42
  },
43
43
  "peerDependencies": {
44
- "@atlaskit/link-provider": "^1.16.0",
44
+ "@atlaskit/link-provider": "^1.18.0",
45
45
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@atlaskit/link-test-helpers": "^7.5.0",
49
- "@atlassian/feature-flags-test-utils": "0.2.3",
50
- "@testing-library/react": "^12.1.5",
48
+ "@atlaskit/link-test-helpers": "^7.6.0",
49
+ "@atlassian/feature-flags-test-utils": "0.3.0",
50
+ "@testing-library/react": "^13.4.0",
51
51
  "@testing-library/react-hooks": "^8.0.1",
52
- "react-dom": "^16.8.0",
52
+ "react-dom": "^18.2.0",
53
53
  "typescript": "~5.4.2",
54
54
  "wait-for-expect": "^1.2.0"
55
55
  },