@atlaskit/link-client-extension 1.8.3 → 1.9.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,16 +1,36 @@
1
1
  # @atlaskit/link-client-extension
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#109647](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109647)
8
+ [`17d330a232539`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/17d330a232539) -
9
+ The changes here adds a "origin-timezone" header to datasource /data and /details requests.
10
+
11
+ ## 1.8.4
12
+
13
+ ### Patch Changes
14
+
15
+ - [#86596](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86596)
16
+ [`37621cb1f1b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/37621cb1f1b9) -
17
+ Update dependency json-ld-types
18
+
3
19
  ## 1.8.3
4
20
 
5
21
  ### Patch Changes
6
22
 
7
- - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
23
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
24
+ [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
25
+ Upgrade Typescript from `4.9.5` to `5.4.2`
8
26
 
9
27
  ## 1.8.2
10
28
 
11
29
  ### Patch Changes
12
30
 
13
- - [#68194](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68194) [`c1d4a8fecc4e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c1d4a8fecc4e) - bump json-ld-types to version 3.11.0
31
+ - [#68194](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68194)
32
+ [`c1d4a8fecc4e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c1d4a8fecc4e) -
33
+ bump json-ld-types to version 3.11.0
14
34
 
15
35
  ## 1.8.1
16
36
 
@@ -22,31 +42,41 @@
22
42
 
23
43
  ### Minor Changes
24
44
 
25
- - [#42199](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42199) [`896e6300360`](https://bitbucket.org/atlassian/atlassian-frontend/commits/896e6300360) - Add api to make GET request to related-urls endpoint
45
+ - [#42199](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42199)
46
+ [`896e6300360`](https://bitbucket.org/atlassian/atlassian-frontend/commits/896e6300360) - Add api
47
+ to make GET request to related-urls endpoint
26
48
 
27
49
  ## 1.7.3
28
50
 
29
51
  ### Patch Changes
30
52
 
31
- - [#41377](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41377) [`6191c789222`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6191c789222) - Fix bug where on next page load sorts the column in alphabetical order.
53
+ - [#41377](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41377)
54
+ [`6191c789222`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6191c789222) - Fix bug
55
+ where on next page load sorts the column in alphabetical order.
32
56
 
33
57
  ## 1.7.2
34
58
 
35
59
  ### Patch Changes
36
60
 
37
- - [#40491](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40491) [`1fedffbd64b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1fedffbd64b) - Update json-ld-types dependencies to be compatible with version
61
+ - [#40491](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40491)
62
+ [`1fedffbd64b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1fedffbd64b) - Update
63
+ json-ld-types dependencies to be compatible with version
38
64
 
39
65
  ## 1.7.1
40
66
 
41
67
  ### Patch Changes
42
68
 
43
- - [#40127](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40127) [`2cd7af71b63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2cd7af71b63) - Bump json-ld-types 3.8.0 -> 3.9.1
69
+ - [#40127](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40127)
70
+ [`2cd7af71b63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2cd7af71b63) - Bump
71
+ json-ld-types 3.8.0 -> 3.9.1
44
72
 
45
73
  ## 1.7.0
46
74
 
47
75
  ### Minor Changes
48
76
 
49
- - [#39265](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39265) [`8b8a309cb62`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8b8a309cb62) - Added a `DEFAULT_GET_DATA_PAGE_SIZE` constant for default page size on data calls.
77
+ - [#39265](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39265)
78
+ [`8b8a309cb62`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8b8a309cb62) - Added a
79
+ `DEFAULT_GET_DATA_PAGE_SIZE` constant for default page size on data calls.
50
80
 
51
81
  ### Patch Changes
52
82
 
@@ -56,26 +86,41 @@
56
86
 
57
87
  ### Patch Changes
58
88
 
59
- - [#39465](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39465) [`a21cffb7b23`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a21cffb7b23) - Extended mock response returned for datasources
89
+ - [#39465](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39465)
90
+ [`a21cffb7b23`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a21cffb7b23) - Extended
91
+ mock response returned for datasources
60
92
 
61
93
  ## 1.6.0
62
94
 
63
95
  ### Minor Changes
64
96
 
65
- - [#38189](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38189) [`5bc0af1de85`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bc0af1de85) - Introduce caching layer for both `getDatasourceDetails` and `getDatasourceData` calls. Export new member - `mockDatasourceDetailsResponse` that has same value as previously exported `mockDatasourceResponse`
66
- - [`b3b6782c3a0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b3b6782c3a0) - Add new member `mockDatasourceDetailsResponse` that has same value as existing `mockDatasourceResponse`; Add third optional boolean argument to `getDatasourceDetails` and `getDatasourceData` from `useDatasourceClientExtension` hook called `force` — when it is false (Default) cached version of response promise will be returned (in case request with same parameters has been made), when true new request will be made regardless of cache state.
97
+ - [#38189](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38189)
98
+ [`5bc0af1de85`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bc0af1de85) -
99
+ Introduce caching layer for both `getDatasourceDetails` and `getDatasourceData` calls. Export new
100
+ member - `mockDatasourceDetailsResponse` that has same value as previously exported
101
+ `mockDatasourceResponse`
102
+ - [`b3b6782c3a0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b3b6782c3a0) - Add new
103
+ member `mockDatasourceDetailsResponse` that has same value as existing `mockDatasourceResponse`;
104
+ Add third optional boolean argument to `getDatasourceDetails` and `getDatasourceData` from
105
+ `useDatasourceClientExtension` hook called `force` — when it is false (Default) cached version of
106
+ response promise will be returned (in case request with same parameters has been made), when true
107
+ new request will be made regardless of cache state.
67
108
 
68
109
  ## 1.5.4
69
110
 
70
111
  ### Patch Changes
71
112
 
72
- - [#37720](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37720) [`e74ae7f06d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e74ae7f06d4) - Update dependency json-ld-types@3.8.0
113
+ - [#37720](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37720)
114
+ [`e74ae7f06d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e74ae7f06d4) - Update
115
+ dependency json-ld-types@3.8.0
73
116
 
74
117
  ## 1.5.3
75
118
 
76
119
  ### Patch Changes
77
120
 
78
- - [#37340](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37340) [`b9355830504`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9355830504) - Opt out of peer dependency enforcement
121
+ - [#37340](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37340)
122
+ [`b9355830504`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9355830504) - Opt out
123
+ of peer dependency enforcement
79
124
 
80
125
  ## 1.5.2
81
126
 
@@ -87,13 +132,18 @@
87
132
 
88
133
  ### Patch Changes
89
134
 
90
- - [#36757](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36757) [`3fb20c4aeba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fb20c4aeba) - Add postinstall check to enforce internal peer dependencies
135
+ - [#36757](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36757)
136
+ [`3fb20c4aeba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fb20c4aeba) - Add
137
+ postinstall check to enforce internal peer dependencies
91
138
 
92
139
  ## 1.5.0
93
140
 
94
141
  ### Minor Changes
95
142
 
96
- - [#36138](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36138) [`12411d70076`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12411d70076) - export more datasource types in the linking-type index and remove the defaultProperties in the datasourceDataResponse
143
+ - [#36138](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36138)
144
+ [`12411d70076`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12411d70076) - export
145
+ more datasource types in the linking-type index and remove the defaultProperties in the
146
+ datasourceDataResponse
97
147
 
98
148
  ### Patch Changes
99
149
 
@@ -103,7 +153,10 @@
103
153
 
104
154
  ### Minor Changes
105
155
 
106
- - [#35032](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35032) [`04295e9d5bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04295e9d5bc) - [ux] Updating ORS response to include datasources and facilitating pasting JQL links turning into datasource tables
156
+ - [#35032](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35032)
157
+ [`04295e9d5bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04295e9d5bc) - [ux]
158
+ Updating ORS response to include datasources and facilitating pasting JQL links turning into
159
+ datasource tables
107
160
 
108
161
  ### Patch Changes
109
162
 
@@ -113,7 +166,10 @@
113
166
 
114
167
  ### Minor Changes
115
168
 
116
- - [#35861](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35861) [`f427908df3d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f427908df3d) - change the datasource response type to include the meta data section and the data response will wrap in the data section
169
+ - [#35861](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35861)
170
+ [`f427908df3d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f427908df3d) - change
171
+ the datasource response type to include the meta data section and the data response will wrap in
172
+ the data section
117
173
 
118
174
  ### Patch Changes
119
175
 
@@ -135,13 +191,17 @@
135
191
 
136
192
  ### Minor Changes
137
193
 
138
- - [#34180](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34180) [`b508cc26473`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b508cc26473) - Updated getDatasourceDetails request body to be `DatasourceDetailsRequest` type
194
+ - [#34180](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34180)
195
+ [`b508cc26473`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b508cc26473) - Updated
196
+ getDatasourceDetails request body to be `DatasourceDetailsRequest` type
139
197
 
140
198
  ## 1.1.7
141
199
 
142
200
  ### Patch Changes
143
201
 
144
- - [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443) [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
202
+ - [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)
203
+ [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing
204
+ unused dependencies and dev dependencies
145
205
  - Updated dependencies
146
206
 
147
207
  ## 1.1.6
@@ -160,35 +220,45 @@
160
220
 
161
221
  ### Patch Changes
162
222
 
163
- - [#34035](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34035) [`43ad059dcc5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43ad059dcc5) - Updated mock response to the new `DatasourceDataResponseItem` format
223
+ - [#34035](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34035)
224
+ [`43ad059dcc5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43ad059dcc5) - Updated
225
+ mock response to the new `DatasourceDataResponseItem` format
164
226
  - Updated dependencies
165
227
 
166
228
  ## 1.1.3
167
229
 
168
230
  ### Patch Changes
169
231
 
170
- - [#33917](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33917) [`e9ad7ee17bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e9ad7ee17bb) - Updated mock response to the new `DatasourceType` value format
232
+ - [#33917](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33917)
233
+ [`e9ad7ee17bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e9ad7ee17bb) - Updated
234
+ mock response to the new `DatasourceType` value format
171
235
  - Updated dependencies
172
236
 
173
237
  ## 1.1.2
174
238
 
175
239
  ### Patch Changes
176
240
 
177
- - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
241
+ - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
242
+ [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
243
+ legacy types are published for TS 4.5-4.8
178
244
  - Updated dependencies
179
245
 
180
246
  ## 1.1.1
181
247
 
182
248
  ### Patch Changes
183
249
 
184
- - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
250
+ - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
251
+ [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade
252
+ Typescript from `4.5.5` to `4.9.5`
185
253
  - Updated dependencies
186
254
 
187
255
  ## 1.1.0
188
256
 
189
257
  ### Minor Changes
190
258
 
191
- - [#33177](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33177) [`670454dc4a0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/670454dc4a0) - Add totalIssues to mock/types
259
+ - [#33177](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33177)
260
+ [`670454dc4a0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/670454dc4a0) - Add
261
+ totalIssues to mock/types
192
262
 
193
263
  ### Patch Changes
194
264
 
@@ -198,7 +268,9 @@
198
268
 
199
269
  ### Minor Changes
200
270
 
201
- - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
271
+ - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
272
+ [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
273
+ minor dependency bump
202
274
 
203
275
  ### Patch Changes
204
276
 
@@ -208,7 +280,9 @@
208
280
 
209
281
  ### Minor Changes
210
282
 
211
- - [#32751](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32751) [`5f0b51cb0e9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f0b51cb0e9) - Updated `useDatasourceClientExtension` hook to use `useSmartLinkContext` for creating smart-card client
283
+ - [#32751](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32751)
284
+ [`5f0b51cb0e9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f0b51cb0e9) - Updated
285
+ `useDatasourceClientExtension` hook to use `useSmartLinkContext` for creating smart-card client
212
286
 
213
287
  ### Patch Changes
214
288
 
@@ -218,7 +292,9 @@
218
292
 
219
293
  ### Patch Changes
220
294
 
221
- - [#32589](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32589) [`f1b712482b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1b712482b1) - Fixed error handling inside of invoke function
295
+ - [#32589](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32589)
296
+ [`f1b712482b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1b712482b1) - Fixed
297
+ error handling inside of invoke function
222
298
  - Updated dependencies
223
299
 
224
300
  ## 0.4.2
@@ -231,14 +307,18 @@
231
307
 
232
308
  ### Patch Changes
233
309
 
234
- - [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424) [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY remove before merging to master; dupe adf-schema via adf-utils
310
+ - [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)
311
+ [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY
312
+ remove before merging to master; dupe adf-schema via adf-utils
235
313
  - Updated dependencies
236
314
 
237
315
  ## 0.4.0
238
316
 
239
317
  ### Minor Changes
240
318
 
241
- - [#32368](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32368) [`d19a6e77d60`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d19a6e77d60) - Adds new hook useDatasourceClientExtension to fetch data for link datasources
319
+ - [#32368](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32368)
320
+ [`d19a6e77d60`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d19a6e77d60) - Adds new
321
+ hook useDatasourceClientExtension to fetch data for link datasources
242
322
 
243
323
  ### Patch Changes
244
324
 
@@ -248,13 +328,17 @@
248
328
 
249
329
  ### Minor Changes
250
330
 
251
- - [#31900](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31900) [`7297fb71759`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7297fb71759) - Update response type for useSmartLinkClientExtension
331
+ - [#31900](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31900)
332
+ [`7297fb71759`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7297fb71759) - Update
333
+ response type for useSmartLinkClientExtension
252
334
 
253
335
  ## 0.2.0
254
336
 
255
337
  ### Minor Changes
256
338
 
257
- - [#31905](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31905) [`f32cef73d0f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f32cef73d0f) - use new types from smart link types
339
+ - [#31905](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31905)
340
+ [`f32cef73d0f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f32cef73d0f) - use new
341
+ types from smart link types
258
342
 
259
343
  ### Patch Changes
260
344
 
package/LICENSE.md CHANGED
@@ -1,13 +1,11 @@
1
1
  Copyright 2022 Atlassian Pty Ltd
2
2
 
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
4
+ compliance with the License. You may obtain a copy of the License at
6
5
 
7
6
  http://www.apache.org/licenses/LICENSE-2.0
8
7
 
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
8
+ Unless required by applicable law or agreed to in writing, software distributed under the License is
9
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10
+ implied. See the License for the specific language governing permissions and limitations under the
11
+ License.
@@ -13,6 +13,7 @@ var _react = require("react");
13
13
  var _lru_map = require("lru_map");
14
14
  var _linkProvider = require("@atlaskit/link-provider");
15
15
  var _linkingCommon = require("@atlaskit/linking-common");
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _useResolverUrl = require("../use-resolver-url");
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; }
18
19
  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; }
@@ -26,7 +27,8 @@ var useDatasourceClientExtension = exports.useDatasourceClientExtension = functi
26
27
  var resolverUrl = (0, _useResolverUrl.useResolverUrl)(client);
27
28
  var cachedRequest = /*#__PURE__*/function () {
28
29
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(datasourceId, data, url, lruMap, force) {
29
- var cacheKeyData, cacheKey, responsePromise;
30
+ var _Intl;
31
+ var cacheKeyData, cacheKey, responsePromise, headers;
30
32
  return _regenerator.default.wrap(function _callee$(_context) {
31
33
  while (1) switch (_context.prev = _context.next) {
32
34
  case 0:
@@ -47,23 +49,30 @@ var useDatasourceClientExtension = exports.useDatasourceClientExtension = functi
47
49
  }
48
50
  return _context.abrupt("return", responsePromise);
49
51
  case 6:
50
- _context.prev = 6;
51
- responsePromise = (0, _linkingCommon.request)('post', url, data, undefined, [200, 201, 202, 203, 204]);
52
+ headers = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource.add-timezone-header') ? {
53
+ /**
54
+ * This header exist to enable the backend to process relative time, eg: "today", with respect to user timezone.
55
+ * eg: used in "confluence-object-provider" to process confluence SLLV requests to filter data for relative time.
56
+ */
57
+ 'origin-timezone': (_Intl = Intl) === null || _Intl === void 0 ? void 0 : _Intl.DateTimeFormat().resolvedOptions().timeZone
58
+ } : undefined;
59
+ _context.prev = 7;
60
+ responsePromise = (0, _linkingCommon.request)('post', url, data, headers, [200, 201, 202, 203, 204]);
52
61
  lruMap.set(cacheKey, responsePromise);
53
- _context.next = 11;
62
+ _context.next = 12;
54
63
  return responsePromise;
55
- case 11:
64
+ case 12:
56
65
  return _context.abrupt("return", _context.sent);
57
- case 14:
58
- _context.prev = 14;
59
- _context.t0 = _context["catch"](6);
66
+ case 15:
67
+ _context.prev = 15;
68
+ _context.t0 = _context["catch"](7);
60
69
  lruMap.delete(cacheKey);
61
70
  throw _context.t0;
62
- case 18:
71
+ case 19:
63
72
  case "end":
64
73
  return _context.stop();
65
74
  }
66
- }, _callee, null, [[6, 14]]);
75
+ }, _callee, null, [[7, 15]]);
67
76
  }));
68
77
  return function cachedRequest(_x, _x2, _x3, _x4, _x5) {
69
78
  return _ref.apply(this, arguments);
@@ -2,6 +2,7 @@ import { useCallback, useMemo } from 'react';
2
2
  import { LRUMap } from 'lru_map';
3
3
  import { useSmartLinkContext } from '@atlaskit/link-provider';
4
4
  import { request } from '@atlaskit/linking-common';
5
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
6
  import { useResolverUrl } from '../use-resolver-url';
6
7
  const URL_RESPONSE_CACHE_SIZE = 50;
7
8
  export const datasourceDetailsResponsePromiseCache = new LRUMap(URL_RESPONSE_CACHE_SIZE);
@@ -15,6 +16,7 @@ export const useDatasourceClientExtension = () => {
15
16
  } = useSmartLinkContext();
16
17
  const resolverUrl = useResolverUrl(client);
17
18
  const cachedRequest = async (datasourceId, data, url, lruMap, force) => {
19
+ var _Intl;
18
20
  const cacheKeyData = {
19
21
  ...data,
20
22
  // Sort fields to use cached version of response regardless of the order
@@ -33,8 +35,15 @@ export const useDatasourceClientExtension = () => {
33
35
  if (responsePromise) {
34
36
  return responsePromise;
35
37
  }
38
+ const headers = getBooleanFF('platform.linking-platform.datasource.add-timezone-header') ? {
39
+ /**
40
+ * This header exist to enable the backend to process relative time, eg: "today", with respect to user timezone.
41
+ * eg: used in "confluence-object-provider" to process confluence SLLV requests to filter data for relative time.
42
+ */
43
+ 'origin-timezone': (_Intl = Intl) === null || _Intl === void 0 ? void 0 : _Intl.DateTimeFormat().resolvedOptions().timeZone
44
+ } : undefined;
36
45
  try {
37
- responsePromise = request('post', url, data, undefined, [200, 201, 202, 203, 204]);
46
+ responsePromise = request('post', url, data, headers, [200, 201, 202, 203, 204]);
38
47
  lruMap.set(cacheKey, responsePromise);
39
48
  return await responsePromise;
40
49
  } catch (e) {
@@ -8,6 +8,7 @@ import { useCallback, useMemo } from 'react';
8
8
  import { LRUMap } from 'lru_map';
9
9
  import { useSmartLinkContext } from '@atlaskit/link-provider';
10
10
  import { request } from '@atlaskit/linking-common';
11
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
12
  import { useResolverUrl } from '../use-resolver-url';
12
13
  var URL_RESPONSE_CACHE_SIZE = 50;
13
14
  export var datasourceDetailsResponsePromiseCache = new LRUMap(URL_RESPONSE_CACHE_SIZE);
@@ -19,7 +20,8 @@ export var useDatasourceClientExtension = function useDatasourceClientExtension(
19
20
  var resolverUrl = useResolverUrl(client);
20
21
  var cachedRequest = /*#__PURE__*/function () {
21
22
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(datasourceId, data, url, lruMap, force) {
22
- var cacheKeyData, cacheKey, responsePromise;
23
+ var _Intl;
24
+ var cacheKeyData, cacheKey, responsePromise, headers;
23
25
  return _regeneratorRuntime.wrap(function _callee$(_context) {
24
26
  while (1) switch (_context.prev = _context.next) {
25
27
  case 0:
@@ -40,23 +42,30 @@ export var useDatasourceClientExtension = function useDatasourceClientExtension(
40
42
  }
41
43
  return _context.abrupt("return", responsePromise);
42
44
  case 6:
43
- _context.prev = 6;
44
- responsePromise = request('post', url, data, undefined, [200, 201, 202, 203, 204]);
45
+ headers = getBooleanFF('platform.linking-platform.datasource.add-timezone-header') ? {
46
+ /**
47
+ * This header exist to enable the backend to process relative time, eg: "today", with respect to user timezone.
48
+ * eg: used in "confluence-object-provider" to process confluence SLLV requests to filter data for relative time.
49
+ */
50
+ 'origin-timezone': (_Intl = Intl) === null || _Intl === void 0 ? void 0 : _Intl.DateTimeFormat().resolvedOptions().timeZone
51
+ } : undefined;
52
+ _context.prev = 7;
53
+ responsePromise = request('post', url, data, headers, [200, 201, 202, 203, 204]);
45
54
  lruMap.set(cacheKey, responsePromise);
46
- _context.next = 11;
55
+ _context.next = 12;
47
56
  return responsePromise;
48
- case 11:
57
+ case 12:
49
58
  return _context.abrupt("return", _context.sent);
50
- case 14:
51
- _context.prev = 14;
52
- _context.t0 = _context["catch"](6);
59
+ case 15:
60
+ _context.prev = 15;
61
+ _context.t0 = _context["catch"](7);
53
62
  lruMap.delete(cacheKey);
54
63
  throw _context.t0;
55
- case 18:
64
+ case 19:
56
65
  case "end":
57
66
  return _context.stop();
58
67
  }
59
- }, _callee, null, [[6, 14]]);
68
+ }, _callee, null, [[7, 15]]);
60
69
  }));
61
70
  return function cachedRequest(_x, _x2, _x3, _x4, _x5) {
62
71
  return _ref.apply(this, arguments);
@@ -1,4 +1,4 @@
1
1
  export { useSmartLinkClientExtension } from './services/use-smart-link-client-extension';
2
2
  export { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension, } from './services/use-data-source-client-extension';
3
3
  export { mockDatasourceDetailsResponse as mockDatasourceResponse, mockDatasourceDetailsResponse, mockDatasourceDataResponse, mockDatasourceDataResponseWithSchema, } from './services/use-data-source-client-extension/mocks';
4
- export type { JsonLdDatasourceResponse, DatasourceResolveResponse, } from './types';
4
+ export type { JsonLdDatasourceResponse, DatasourceResolveResponse } from './types';
@@ -1,5 +1,5 @@
1
1
  import type { CardClient } from '@atlaskit/link-provider';
2
- import { InvokeRequest, InvokeResponse } from '@atlaskit/linking-types/smart-link-actions';
2
+ import { type InvokeRequest, type InvokeResponse } from '@atlaskit/linking-types/smart-link-actions';
3
3
  /**
4
4
  * useSmartLinkClientExtension
5
5
  *
@@ -1,4 +1,4 @@
1
- import { JsonLd } from 'json-ld-types';
1
+ import { type JsonLd } from 'json-ld-types';
2
2
  import type { DatasourceParameters } from '@atlaskit/linking-types';
3
3
  export interface JsonLdDatasourceResponse extends JsonLd.Response {
4
4
  datasources?: DatasourceResolveResponse[];
@@ -1,4 +1,4 @@
1
1
  export { useSmartLinkClientExtension } from './services/use-smart-link-client-extension';
2
2
  export { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension, } from './services/use-data-source-client-extension';
3
3
  export { mockDatasourceDetailsResponse as mockDatasourceResponse, mockDatasourceDetailsResponse, mockDatasourceDataResponse, mockDatasourceDataResponseWithSchema, } from './services/use-data-source-client-extension/mocks';
4
- export type { JsonLdDatasourceResponse, DatasourceResolveResponse, } from './types';
4
+ export type { JsonLdDatasourceResponse, DatasourceResolveResponse } from './types';
@@ -1,5 +1,5 @@
1
1
  import type { CardClient } from '@atlaskit/link-provider';
2
- import { InvokeRequest, InvokeResponse } from '@atlaskit/linking-types/smart-link-actions';
2
+ import { type InvokeRequest, type InvokeResponse } from '@atlaskit/linking-types/smart-link-actions';
3
3
  /**
4
4
  * useSmartLinkClientExtension
5
5
  *
@@ -1,4 +1,4 @@
1
- import { JsonLd } from 'json-ld-types';
1
+ import { type JsonLd } from 'json-ld-types';
2
2
  import type { DatasourceParameters } from '@atlaskit/linking-types';
3
3
  export interface JsonLdDatasourceResponse extends JsonLd.Response {
4
4
  datasources?: DatasourceResolveResponse[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-client-extension",
3
- "version": "1.8.3",
3
+ "version": "1.9.0",
4
4
  "description": "Extension methods for linking platform client",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,18 +34,19 @@
34
34
  ".": "./src/index.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@atlaskit/linking-common": "^5.5.0",
38
- "@atlaskit/linking-types": "^8.7.0",
37
+ "@atlaskit/linking-common": "^5.7.0",
38
+ "@atlaskit/linking-types": "^8.9.0",
39
+ "@atlaskit/platform-feature-flags": "0.2.5",
39
40
  "@babel/runtime": "^7.0.0",
40
- "json-ld-types": "^3.11.0",
41
+ "json-ld-types": "^4.1.0",
41
42
  "lru_map": "^0.4.1"
42
43
  },
43
44
  "peerDependencies": {
44
- "@atlaskit/link-provider": "^1.8.0",
45
+ "@atlaskit/link-provider": "^1.10.0",
45
46
  "react": "^16.8.0"
46
47
  },
47
48
  "devDependencies": {
48
- "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
49
+ "@atlassian/feature-flags-test-utils": "0.2.1",
49
50
  "@testing-library/react": "^12.1.5",
50
51
  "@testing-library/react-hooks": "^8.0.1",
51
52
  "react-dom": "^16.8.0",
@@ -90,5 +91,9 @@
90
91
  ]
91
92
  }
92
93
  },
93
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
94
+ "platform-feature-flags": {
95
+ "platform.linking-platform.datasource.add-timezone-header": {
96
+ "type": "boolean"
97
+ }
98
+ }
94
99
  }
package/report.api.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## API Report File for "@atlaskit/link-client-extension"
4
4
 
5
- > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using
6
+ > [API Extractor](https://api-extractor.com/).
6
7
  > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
8
 
8
9
  ### Table of contents
@@ -27,12 +28,12 @@ import { JsonLd } from 'json-ld-types';
27
28
 
28
29
  // @public (undocumented)
29
30
  export type DatasourceResolveResponse = {
30
- id: string;
31
- ari?: string;
32
- key?: string;
33
- name?: string;
34
- description?: string;
35
- parameters: DatasourceParameters;
31
+ id: string;
32
+ ari?: string;
33
+ key?: string;
34
+ name?: string;
35
+ description?: string;
36
+ parameters: DatasourceParameters;
36
37
  };
37
38
 
38
39
  // @public (undocumented)
@@ -40,8 +41,8 @@ export const DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE = 20;
40
41
 
41
42
  // @public (undocumented)
42
43
  export interface JsonLdDatasourceResponse extends JsonLd.Response {
43
- // (undocumented)
44
- datasources?: DatasourceResolveResponse[];
44
+ // (undocumented)
45
+ datasources?: DatasourceResolveResponse[];
45
46
  }
46
47
 
47
48
  // @public (undocumented)
@@ -57,22 +58,22 @@ export { mockDatasourceDetailsResponse as mockDatasourceResponse };
57
58
 
58
59
  // @public (undocumented)
59
60
  export const useDatasourceClientExtension: () => {
60
- getDatasourceDetails: (
61
- datasourceId: string,
62
- data: DatasourceDetailsRequest,
63
- force?: any,
64
- ) => Promise<DatasourceDetailsResponse>;
65
- getDatasourceData: (
66
- datasourceId: string,
67
- data: DatasourceDataRequest,
68
- force?: any,
69
- ) => Promise<DatasourceDataResponse>;
61
+ getDatasourceDetails: (
62
+ datasourceId: string,
63
+ data: DatasourceDetailsRequest,
64
+ force?: any,
65
+ ) => Promise<DatasourceDetailsResponse>;
66
+ getDatasourceData: (
67
+ datasourceId: string,
68
+ data: DatasourceDataRequest,
69
+ force?: any,
70
+ ) => Promise<DatasourceDataResponse>;
70
71
  };
71
72
 
72
73
  // @public
73
74
  export const useSmartLinkClientExtension: (cardClient: CardClient) => {
74
- invoke: (data: InvokeRequest) => Promise<InvokeResponse>;
75
- relatedUrls: <TResponse>(url: string) => Promise<TResponse>;
75
+ invoke: (data: InvokeRequest) => Promise<InvokeResponse>;
76
+ relatedUrls: <TResponse>(url: string) => Promise<TResponse>;
76
77
  };
77
78
 
78
79
  // (No @packageDocumentation comment for this package)
@@ -86,8 +87,8 @@ export const useSmartLinkClientExtension: (cardClient: CardClient) => {
86
87
 
87
88
  ```json
88
89
  {
89
- "@atlaskit/link-provider": "^1.6.4",
90
- "react": "^16.8.0"
90
+ "@atlaskit/link-provider": "^1.6.4",
91
+ "react": "^16.8.0"
91
92
  }
92
93
  ```
93
94