@atlaskit/link-client-extension 6.1.0 → 7.0.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 +35 -0
- package/dist/cjs/entry-points/data-source-client-extension-mocks.js +11 -6
- package/dist/cjs/index.js +11 -6
- package/dist/cjs/services/use-data-source-client-extension/index.js +28 -28
- package/dist/cjs/services/use-data-source-client-extension/mockActionsDiscoveryEmptyResponse.js +12 -0
- package/dist/cjs/services/use-data-source-client-extension/mockActionsDiscoveryResponse.js +76 -0
- package/dist/cjs/services/use-data-source-client-extension/mockDatasourceDataNoActionsResponse.js +125 -0
- package/dist/cjs/services/use-data-source-client-extension/mockDatasourceDataResponse.js +126 -0
- package/dist/cjs/services/use-data-source-client-extension/mockDatasourceDetailsResponse.js +79 -0
- package/dist/cjs/services/use-data-source-client-extension/mockExecuteActionResponse.js +11 -0
- package/dist/cjs/services/use-data-source-client-extension/mockExecuteActionResponseFailure.js +14 -0
- package/dist/cjs/services/use-data-source-client-extension/mocks.js +7 -405
- package/dist/cjs/services/use-smart-link-client-extension/index.js +17 -17
- package/dist/es2019/entry-points/data-source-client-extension-mocks.js +6 -1
- package/dist/es2019/index.js +6 -1
- package/dist/es2019/services/use-data-source-client-extension/mockActionsDiscoveryEmptyResponse.js +6 -0
- package/dist/es2019/services/use-data-source-client-extension/mockActionsDiscoveryResponse.js +70 -0
- package/dist/es2019/services/use-data-source-client-extension/mockDatasourceDataNoActionsResponse.js +119 -0
- package/dist/es2019/services/use-data-source-client-extension/mockDatasourceDataResponse.js +120 -0
- package/dist/es2019/services/use-data-source-client-extension/mockDatasourceDetailsResponse.js +73 -0
- package/dist/es2019/services/use-data-source-client-extension/mockExecuteActionResponse.js +5 -0
- package/dist/es2019/services/use-data-source-client-extension/mockExecuteActionResponseFailure.js +8 -0
- package/dist/es2019/services/use-data-source-client-extension/mocks.js +2 -400
- package/dist/esm/entry-points/data-source-client-extension-mocks.js +6 -1
- package/dist/esm/index.js +6 -1
- package/dist/esm/services/use-data-source-client-extension/index.js +28 -28
- package/dist/esm/services/use-data-source-client-extension/mockActionsDiscoveryEmptyResponse.js +6 -0
- package/dist/esm/services/use-data-source-client-extension/mockActionsDiscoveryResponse.js +70 -0
- package/dist/esm/services/use-data-source-client-extension/mockDatasourceDataNoActionsResponse.js +119 -0
- package/dist/esm/services/use-data-source-client-extension/mockDatasourceDataResponse.js +120 -0
- package/dist/esm/services/use-data-source-client-extension/mockDatasourceDetailsResponse.js +73 -0
- package/dist/esm/services/use-data-source-client-extension/mockExecuteActionResponse.js +5 -0
- package/dist/esm/services/use-data-source-client-extension/mockExecuteActionResponseFailure.js +8 -0
- package/dist/esm/services/use-data-source-client-extension/mocks.js +3 -401
- package/dist/esm/services/use-smart-link-client-extension/index.js +17 -17
- package/dist/types/entry-points/data-source-client-extension-mocks.d.ts +6 -1
- package/dist/types/entry-points/data-source-response-types.d.ts +1 -1
- package/dist/types/index.d.ts +7 -2
- package/dist/types/services/use-data-source-client-extension/mockActionsDiscoveryEmptyResponse.d.ts +2 -0
- package/dist/types/services/use-data-source-client-extension/mockActionsDiscoveryResponse.d.ts +2 -0
- package/dist/types/services/use-data-source-client-extension/mockDatasourceDataNoActionsResponse.d.ts +2 -0
- package/dist/types/services/use-data-source-client-extension/mockDatasourceDataResponse.d.ts +2 -0
- package/dist/types/services/use-data-source-client-extension/mockDatasourceDetailsResponse.d.ts +2 -0
- package/dist/types/services/use-data-source-client-extension/mockExecuteActionResponse.d.ts +2 -0
- package/dist/types/services/use-data-source-client-extension/mockExecuteActionResponseFailure.d.ts +2 -0
- package/dist/types/services/use-data-source-client-extension/mocks.d.ts +1 -8
- package/link-client-extension.docs.tsx +49 -47
- package/package.json +8 -15
- package/use-data-source-client-extension/mocks/package.json +1 -8
- package/use-data-source-client-extension/package.json +1 -8
- package/use-data-source-client-extension/types/package.json +1 -8
- package/use-smart-link-client-extension/package.json +1 -8
- package/dist/types-ts4.5/entry-points/data-source-client-extension-mocks.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/data-source-response-types.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/use-data-source-client-extension.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/use-smart-link-client-extension.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -8
- package/dist/types-ts4.5/services/use-data-source-client-extension/index.d.ts +0 -13
- package/dist/types-ts4.5/services/use-data-source-client-extension/mocks.d.ts +0 -9
- package/dist/types-ts4.5/services/use-data-source-client-extension/types.d.ts +0 -13
- package/dist/types-ts4.5/services/use-resolver-url/index.d.ts +0 -2
- package/dist/types-ts4.5/services/use-smart-link-client-extension/index.d.ts +0 -13
|
@@ -1,410 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
meta: {
|
|
7
|
-
key: 'jira-object-provider',
|
|
8
|
-
access: 'granted',
|
|
9
|
-
auth: [],
|
|
10
|
-
definitionId: 'object-resolver-service',
|
|
11
|
-
product: 'jira',
|
|
12
|
-
visibility: 'restricted',
|
|
13
|
-
extensionKey: 'jira-object-provider',
|
|
14
|
-
providerName: 'Jira',
|
|
15
|
-
destinationObjectTypes: ['issue'],
|
|
16
|
-
objectTypesEntity: 'work-item'
|
|
17
|
-
},
|
|
18
|
-
data: {
|
|
19
|
-
totalCount: 1234,
|
|
20
|
-
items: [{
|
|
21
|
-
ari: {
|
|
22
|
-
data: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10025'
|
|
23
|
-
},
|
|
24
|
-
id: {
|
|
25
|
-
data: 'EDM-12'
|
|
26
|
-
},
|
|
27
|
-
description: {
|
|
28
|
-
data: 'Design datasource feature'
|
|
29
|
-
},
|
|
30
|
-
createdAt: {
|
|
31
|
-
data: '2023-01-22T01:30:00.000-05:00'
|
|
32
|
-
},
|
|
33
|
-
assigned: {
|
|
34
|
-
data: {
|
|
35
|
-
displayName: 'Sasha'
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
status: {
|
|
39
|
-
data: {
|
|
40
|
-
text: 'In Progress',
|
|
41
|
-
style: {
|
|
42
|
-
appearance: 'inprogress'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
ari: {
|
|
48
|
-
data: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10026'
|
|
49
|
-
},
|
|
50
|
-
id: {
|
|
51
|
-
data: 'EDM-14'
|
|
52
|
-
},
|
|
53
|
-
description: {
|
|
54
|
-
data: 'Implement datasource feature'
|
|
55
|
-
},
|
|
56
|
-
createdAt: {
|
|
57
|
-
data: '2023-03-01T01:30:00.000-05:00'
|
|
58
|
-
},
|
|
59
|
-
assigned: {
|
|
60
|
-
data: {
|
|
61
|
-
displayName: 'Hana'
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
status: {
|
|
65
|
-
data: {
|
|
66
|
-
text: 'To Do',
|
|
67
|
-
style: {
|
|
68
|
-
appearance: 'new'
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
ari: {
|
|
74
|
-
data: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10027'
|
|
75
|
-
},
|
|
76
|
-
id: {
|
|
77
|
-
data: 'EDM-15'
|
|
78
|
-
},
|
|
79
|
-
description: {
|
|
80
|
-
data: 'Add Jira Provider'
|
|
81
|
-
},
|
|
82
|
-
createdAt: {
|
|
83
|
-
data: '2023-03-31T01:30:00.000-05:00'
|
|
84
|
-
},
|
|
85
|
-
assigned: {
|
|
86
|
-
data: {
|
|
87
|
-
displayName: 'Princey'
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
status: {
|
|
91
|
-
data: {
|
|
92
|
-
text: 'To Do'
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
ari: {
|
|
97
|
-
data: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10028'
|
|
98
|
-
},
|
|
99
|
-
id: {
|
|
100
|
-
data: 'EDM-16'
|
|
101
|
-
},
|
|
102
|
-
description: {
|
|
103
|
-
data: 'Plan team party'
|
|
104
|
-
},
|
|
105
|
-
createdAt: {
|
|
106
|
-
data: '2023-05-01T01:30:00.000-05:00'
|
|
107
|
-
},
|
|
108
|
-
assigned: {
|
|
109
|
-
data: {
|
|
110
|
-
displayName: 'Nidhin'
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
status: {
|
|
114
|
-
data: {
|
|
115
|
-
text: 'Done',
|
|
116
|
-
style: {
|
|
117
|
-
appearance: 'success'
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}],
|
|
122
|
-
nextPageCursor: 'c3RhcnRBdD01'
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
export var mockDatasourceDataNoActionsResponse = {
|
|
126
|
-
meta: {
|
|
127
|
-
key: 'jira-object-provider',
|
|
128
|
-
access: 'granted',
|
|
129
|
-
auth: [],
|
|
130
|
-
definitionId: 'object-resolver-service',
|
|
131
|
-
product: 'jira',
|
|
132
|
-
visibility: 'restricted',
|
|
133
|
-
extensionKey: 'jira-object-provider',
|
|
134
|
-
providerName: 'Jira',
|
|
135
|
-
destinationObjectTypes: ['issue']
|
|
136
|
-
},
|
|
137
|
-
data: {
|
|
138
|
-
totalCount: 1234,
|
|
139
|
-
items: [{
|
|
140
|
-
ari: {
|
|
141
|
-
data: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10025'
|
|
142
|
-
},
|
|
143
|
-
id: {
|
|
144
|
-
data: 'EDM-12'
|
|
145
|
-
},
|
|
146
|
-
description: {
|
|
147
|
-
data: 'Design datasource feature'
|
|
148
|
-
},
|
|
149
|
-
createdAt: {
|
|
150
|
-
data: '2023-01-22T01:30:00.000-05:00'
|
|
151
|
-
},
|
|
152
|
-
assigned: {
|
|
153
|
-
data: {
|
|
154
|
-
displayName: 'Sasha'
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
status: {
|
|
158
|
-
data: {
|
|
159
|
-
text: 'In Progress',
|
|
160
|
-
style: {
|
|
161
|
-
appearance: 'inprogress'
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}, {
|
|
166
|
-
ari: {
|
|
167
|
-
data: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10026'
|
|
168
|
-
},
|
|
169
|
-
id: {
|
|
170
|
-
data: 'EDM-14'
|
|
171
|
-
},
|
|
172
|
-
description: {
|
|
173
|
-
data: 'Implement datasource feature'
|
|
174
|
-
},
|
|
175
|
-
createdAt: {
|
|
176
|
-
data: '2023-03-01T01:30:00.000-05:00'
|
|
177
|
-
},
|
|
178
|
-
assigned: {
|
|
179
|
-
data: {
|
|
180
|
-
displayName: 'Hana'
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
status: {
|
|
184
|
-
data: {
|
|
185
|
-
text: 'To Do',
|
|
186
|
-
style: {
|
|
187
|
-
appearance: 'new'
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}, {
|
|
192
|
-
ari: {
|
|
193
|
-
data: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10027'
|
|
194
|
-
},
|
|
195
|
-
id: {
|
|
196
|
-
data: 'EDM-15'
|
|
197
|
-
},
|
|
198
|
-
description: {
|
|
199
|
-
data: 'Add Jira Provider'
|
|
200
|
-
},
|
|
201
|
-
createdAt: {
|
|
202
|
-
data: '2023-03-31T01:30:00.000-05:00'
|
|
203
|
-
},
|
|
204
|
-
assigned: {
|
|
205
|
-
data: {
|
|
206
|
-
displayName: 'Princey'
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
status: {
|
|
210
|
-
data: {
|
|
211
|
-
text: 'To Do'
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}, {
|
|
215
|
-
ari: {
|
|
216
|
-
data: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10028'
|
|
217
|
-
},
|
|
218
|
-
id: {
|
|
219
|
-
data: 'EDM-16'
|
|
220
|
-
},
|
|
221
|
-
description: {
|
|
222
|
-
data: 'Plan team party'
|
|
223
|
-
},
|
|
224
|
-
createdAt: {
|
|
225
|
-
data: '2023-05-01T01:30:00.000-05:00'
|
|
226
|
-
},
|
|
227
|
-
assigned: {
|
|
228
|
-
data: {
|
|
229
|
-
displayName: 'Nidhin'
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
status: {
|
|
233
|
-
data: {
|
|
234
|
-
text: 'Done',
|
|
235
|
-
style: {
|
|
236
|
-
appearance: 'success'
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}],
|
|
241
|
-
nextPageCursor: 'c3RhcnRBdD01'
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
export var mockDatasourceDetailsResponse = {
|
|
245
|
-
meta: {
|
|
246
|
-
key: 'jira-object-provider',
|
|
247
|
-
access: 'granted',
|
|
248
|
-
auth: [],
|
|
249
|
-
definitionId: 'object-resolver-service',
|
|
250
|
-
product: 'jira',
|
|
251
|
-
visibility: 'restricted',
|
|
252
|
-
extensionKey: 'jira-object-provider',
|
|
253
|
-
providerName: 'Jira',
|
|
254
|
-
destinationObjectTypes: ['issue']
|
|
255
|
-
},
|
|
256
|
-
data: {
|
|
257
|
-
ari: 'ari:cloud:linking-platform:datasource/12e74246-a3f1-46c1-9fd9-8d952aa9f12f',
|
|
258
|
-
id: '12e74246-a3f1-46c1-9fd9-8d952aa9f12f',
|
|
259
|
-
name: 'JQL Datasource',
|
|
260
|
-
description: 'Fetches Issues using JQL',
|
|
261
|
-
parameters: [{
|
|
262
|
-
key: 'cloudId',
|
|
263
|
-
type: 'string',
|
|
264
|
-
description: 'Cloud Id'
|
|
265
|
-
}, {
|
|
266
|
-
key: 'jql',
|
|
267
|
-
type: 'string',
|
|
268
|
-
description: 'JQL query to retrieve list of issues'
|
|
269
|
-
}],
|
|
270
|
-
schema: {
|
|
271
|
-
properties: [{
|
|
272
|
-
key: 'id',
|
|
273
|
-
title: '',
|
|
274
|
-
type: 'string'
|
|
275
|
-
}, {
|
|
276
|
-
key: 'issue',
|
|
277
|
-
title: 'Key',
|
|
278
|
-
type: 'link'
|
|
279
|
-
}, {
|
|
280
|
-
key: 'type',
|
|
281
|
-
type: 'icon',
|
|
282
|
-
title: 'Type'
|
|
283
|
-
}, {
|
|
284
|
-
key: 'summary',
|
|
285
|
-
title: 'Summary',
|
|
286
|
-
type: 'link'
|
|
287
|
-
}, {
|
|
288
|
-
key: 'assignee',
|
|
289
|
-
title: 'Assignee',
|
|
290
|
-
type: 'user'
|
|
291
|
-
}, {
|
|
292
|
-
key: 'priority',
|
|
293
|
-
title: 'P',
|
|
294
|
-
type: 'icon'
|
|
295
|
-
}, {
|
|
296
|
-
key: 'labels',
|
|
297
|
-
title: 'Labels',
|
|
298
|
-
type: 'tag',
|
|
299
|
-
isList: true
|
|
300
|
-
}, {
|
|
301
|
-
key: 'status',
|
|
302
|
-
title: 'Status',
|
|
303
|
-
type: 'status'
|
|
304
|
-
}, {
|
|
305
|
-
key: 'created',
|
|
306
|
-
title: 'Created',
|
|
307
|
-
type: 'string'
|
|
308
|
-
}, {
|
|
309
|
-
key: 'due',
|
|
310
|
-
title: 'Due Date',
|
|
311
|
-
type: 'string'
|
|
312
|
-
}],
|
|
313
|
-
defaultProperties: ['type', 'issue', 'summary', 'assignee', 'priority', 'labels', 'status', 'created']
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
};
|
|
4
|
+
import { mockDatasourceDataResponse } from './mockDatasourceDataResponse';
|
|
5
|
+
import { mockDatasourceDetailsResponse } from './mockDatasourceDetailsResponse';
|
|
317
6
|
export var mockDatasourceDataResponseWithSchema = _objectSpread(_objectSpread({}, mockDatasourceDataResponse), {}, {
|
|
318
7
|
data: _objectSpread(_objectSpread({}, mockDatasourceDataResponse.data), {}, {
|
|
319
8
|
schema: {
|
|
320
9
|
properties: mockDatasourceDetailsResponse.data.schema.properties
|
|
321
10
|
}
|
|
322
11
|
})
|
|
323
|
-
});
|
|
324
|
-
export var mockActionsDiscoveryResponse = {
|
|
325
|
-
actions: [{
|
|
326
|
-
actionKey: 'atlassian:work-item:update:summary',
|
|
327
|
-
description: 'Updates issue summary',
|
|
328
|
-
fieldKey: 'summary',
|
|
329
|
-
integrationKey: 'jira',
|
|
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
|
-
}
|
|
373
|
-
}],
|
|
374
|
-
permissions: {
|
|
375
|
-
data: [{
|
|
376
|
-
ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10025',
|
|
377
|
-
fieldKey: 'summary',
|
|
378
|
-
isEditable: true
|
|
379
|
-
}, {
|
|
380
|
-
ari: 'ari:cloud:jira:3ac63b37-9bca-435e-9840-eff6f8739dba:issue/10030',
|
|
381
|
-
fieldKey: 'summary',
|
|
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
|
|
391
|
-
}]
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
export var mockActionsDiscoveryEmptyResponse = {
|
|
395
|
-
actions: [],
|
|
396
|
-
permissions: {
|
|
397
|
-
data: []
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
export var mockExecuteActionResponse = {
|
|
401
|
-
operationStatus: ActionOperationStatus.SUCCESS,
|
|
402
|
-
errors: []
|
|
403
|
-
};
|
|
404
|
-
export var mockExecuteActionResponseFailure = {
|
|
405
|
-
operationStatus: ActionOperationStatus.FAILURE,
|
|
406
|
-
errors: [{
|
|
407
|
-
message: 'summary: You must specify a summary of the issue.',
|
|
408
|
-
code: 400
|
|
409
|
-
}]
|
|
410
|
-
};
|
|
12
|
+
});
|
|
@@ -17,38 +17,38 @@ export var useSmartLinkClientExtension = function useSmartLinkClientExtension(ca
|
|
|
17
17
|
var resolverUrl = useResolverUrl(cardClient);
|
|
18
18
|
var invoke = useCallback( /*#__PURE__*/function () {
|
|
19
19
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
20
|
-
var errorBody;
|
|
21
|
-
return _regeneratorRuntime.wrap(function
|
|
20
|
+
var errorBody, _t;
|
|
21
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
22
22
|
while (1) switch (_context.prev = _context.next) {
|
|
23
23
|
case 0:
|
|
24
24
|
_context.prev = 0;
|
|
25
|
-
_context.next =
|
|
25
|
+
_context.next = 1;
|
|
26
26
|
return request('post', "".concat(resolverUrl, "/invoke"), data, undefined, [200, 201, 202, 203, 204]);
|
|
27
|
-
case
|
|
27
|
+
case 1:
|
|
28
28
|
return _context.abrupt("return", _context.sent);
|
|
29
|
-
case
|
|
30
|
-
_context.prev =
|
|
31
|
-
|
|
32
|
-
if (!(
|
|
33
|
-
_context.next =
|
|
29
|
+
case 2:
|
|
30
|
+
_context.prev = 2;
|
|
31
|
+
_t = _context["catch"](0);
|
|
32
|
+
if (!(_t && _t.json && typeof _t.json === 'function')) {
|
|
33
|
+
_context.next = 4;
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
|
-
_context.next =
|
|
37
|
-
return
|
|
38
|
-
case
|
|
36
|
+
_context.next = 3;
|
|
37
|
+
return _t.json();
|
|
38
|
+
case 3:
|
|
39
39
|
errorBody = _context.sent;
|
|
40
40
|
if (!errorBody) {
|
|
41
|
-
_context.next =
|
|
41
|
+
_context.next = 4;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
throw new InvokeError(errorBody === null || errorBody === void 0 ? void 0 : errorBody.error.message, errorBody === null || errorBody === void 0 ? void 0 : errorBody.error.status);
|
|
45
|
-
case
|
|
46
|
-
throw
|
|
47
|
-
case
|
|
45
|
+
case 4:
|
|
46
|
+
throw _t;
|
|
47
|
+
case 5:
|
|
48
48
|
case "end":
|
|
49
49
|
return _context.stop();
|
|
50
50
|
}
|
|
51
|
-
}, _callee, null, [[0,
|
|
51
|
+
}, _callee, null, [[0, 2]]);
|
|
52
52
|
}));
|
|
53
53
|
return function (_x) {
|
|
54
54
|
return _ref.apply(this, arguments);
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { mockActionsDiscoveryEmptyResponse } from '../services/use-data-source-client-extension/mockActionsDiscoveryEmptyResponse';
|
|
2
|
+
export { mockActionsDiscoveryResponse } from '../services/use-data-source-client-extension/mockActionsDiscoveryResponse';
|
|
3
|
+
export { mockDatasourceDataNoActionsResponse } from '../services/use-data-source-client-extension/mockDatasourceDataNoActionsResponse';
|
|
4
|
+
export { mockDatasourceDataResponse } from '../services/use-data-source-client-extension/mockDatasourceDataResponse';
|
|
5
|
+
export { mockDatasourceDetailsResponse as mockDatasourceResponse, mockDatasourceDetailsResponse, } from '../services/use-data-source-client-extension/mockDatasourceDetailsResponse';
|
|
6
|
+
export { mockDatasourceDataResponseWithSchema } from '../services/use-data-source-client-extension/mocks';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { JsonLdDatasourceResponse, DatasourceResolveResponse } from '../services/use-data-source-client-extension/types';
|
|
1
|
+
export type { JsonLdDatasourceResponse, DatasourceResolveResponse, } from '../services/use-data-source-client-extension/types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ export { useSmartLinkClientExtension } from './services/use-smart-link-client-ex
|
|
|
3
3
|
/** @deprecated use @atlaskit/link-client-extension/use-data-source-client-extension */
|
|
4
4
|
export { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension, } from './services/use-data-source-client-extension';
|
|
5
5
|
/** @deprecated use @atlaskit/link-client-extension/data-source-client-extension/mocks */
|
|
6
|
-
export {
|
|
6
|
+
export { mockActionsDiscoveryEmptyResponse } from './services/use-data-source-client-extension/mockActionsDiscoveryEmptyResponse';
|
|
7
|
+
export { mockActionsDiscoveryResponse } from './services/use-data-source-client-extension/mockActionsDiscoveryResponse';
|
|
8
|
+
export { mockDatasourceDataNoActionsResponse } from './services/use-data-source-client-extension/mockDatasourceDataNoActionsResponse';
|
|
9
|
+
export { mockDatasourceDataResponse } from './services/use-data-source-client-extension/mockDatasourceDataResponse';
|
|
10
|
+
export { mockDatasourceDetailsResponse as mockDatasourceResponse, mockDatasourceDetailsResponse, } from './services/use-data-source-client-extension/mockDatasourceDetailsResponse';
|
|
11
|
+
export { mockDatasourceDataResponseWithSchema } from './services/use-data-source-client-extension/mocks';
|
|
7
12
|
/** @deprecated use @atlaskit/link-client-extension/use-data-source-client-extension/types */
|
|
8
|
-
export type { JsonLdDatasourceResponse, DatasourceResolveResponse } from './services/use-data-source-client-extension/types';
|
|
13
|
+
export type { JsonLdDatasourceResponse, DatasourceResolveResponse, } from './services/use-data-source-client-extension/types';
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const mockDatasourceDataResponse: DatasourceDataResponse;
|
|
3
|
-
export declare const mockDatasourceDataNoActionsResponse: DatasourceDataResponse;
|
|
4
|
-
export declare const mockDatasourceDetailsResponse: DatasourceDetailsResponse;
|
|
1
|
+
import { type DatasourceDataResponse } from '@atlaskit/linking-types';
|
|
5
2
|
export declare const mockDatasourceDataResponseWithSchema: DatasourceDataResponse;
|
|
6
|
-
export declare const mockActionsDiscoveryResponse: ActionsDiscoveryResponse;
|
|
7
|
-
export declare const mockActionsDiscoveryEmptyResponse: ActionsServiceDiscoveryResponse;
|
|
8
|
-
export declare const mockExecuteActionResponse: AtomicActionExecuteResponse;
|
|
9
|
-
export declare const mockExecuteActionResponseFailure: AtomicActionExecuteResponse;
|
|
@@ -5,61 +5,63 @@
|
|
|
5
5
|
|
|
6
6
|
import path from 'path';
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
9
9
|
|
|
10
10
|
import packageJson from './package.json';
|
|
11
11
|
|
|
12
12
|
const packagePath = path.resolve(__dirname);
|
|
13
13
|
|
|
14
|
-
const documentation:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
description:
|
|
18
|
-
'Hook that extends the CardClient from link-provider with Smart Link action invocation. Accepts a CardClient and returns an invoke function to call Smart Link actions (e.g. custom actions) via the resolver.',
|
|
19
|
-
status: 'general-availability',
|
|
20
|
-
import: {
|
|
14
|
+
const documentation: StructuredContentSource = {
|
|
15
|
+
components: [
|
|
16
|
+
{
|
|
21
17
|
name: 'useSmartLinkClientExtension',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
description:
|
|
19
|
+
'Hook that extends the CardClient from link-provider with Smart Link action invocation. Accepts a CardClient and returns an invoke function to call Smart Link actions (e.g. custom actions) via the resolver.',
|
|
20
|
+
status: 'general-availability',
|
|
21
|
+
import: {
|
|
22
|
+
name: 'useSmartLinkClientExtension',
|
|
23
|
+
package: '@atlaskit/link-client-extension',
|
|
24
|
+
type: 'named',
|
|
25
|
+
packagePath,
|
|
26
|
+
packageJson,
|
|
27
|
+
},
|
|
28
|
+
usageGuidelines: [
|
|
29
|
+
'Use when you need to invoke Smart Link actions (POST to resolver /invoke) from custom UI. Pass the client from useSmartLinkContext; use the returned invoke for action execution.',
|
|
30
|
+
],
|
|
31
|
+
contentGuidelines: [],
|
|
32
|
+
accessibilityGuidelines: [],
|
|
33
|
+
keywords: [
|
|
34
|
+
'link-client-extension',
|
|
35
|
+
'hooks',
|
|
36
|
+
'invoke',
|
|
37
|
+
'actions',
|
|
38
|
+
'useSmartLinkClientExtension',
|
|
39
|
+
],
|
|
40
|
+
categories: ['linking', 'interaction'],
|
|
41
|
+
examples: [],
|
|
26
42
|
},
|
|
27
|
-
|
|
28
|
-
'Use when you need to invoke Smart Link actions (POST to resolver /invoke) from custom UI. Pass the client from useSmartLinkContext; use the returned invoke for action execution.',
|
|
29
|
-
],
|
|
30
|
-
contentGuidelines: [],
|
|
31
|
-
accessibilityGuidelines: [],
|
|
32
|
-
keywords: [
|
|
33
|
-
'link-client-extension',
|
|
34
|
-
'hooks',
|
|
35
|
-
'invoke',
|
|
36
|
-
'actions',
|
|
37
|
-
'useSmartLinkClientExtension',
|
|
38
|
-
],
|
|
39
|
-
categories: ['linking', 'interaction'],
|
|
40
|
-
examples: [],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'useDatasourceClientExtension',
|
|
44
|
-
description:
|
|
45
|
-
'Hook that provides methods to fetch datasource details, datasource data (paginated), and actions discovery. Uses the Smart Link context client and caches responses. Required for rendering datasource tables or custom datasource UI.',
|
|
46
|
-
status: 'general-availability',
|
|
47
|
-
import: {
|
|
43
|
+
{
|
|
48
44
|
name: 'useDatasourceClientExtension',
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
description:
|
|
46
|
+
'Hook that provides methods to fetch datasource details, datasource data (paginated), and actions discovery. Uses the Smart Link context client and caches responses. Required for rendering datasource tables or custom datasource UI.',
|
|
47
|
+
status: 'general-availability',
|
|
48
|
+
import: {
|
|
49
|
+
name: 'useDatasourceClientExtension',
|
|
50
|
+
package: '@atlaskit/link-client-extension',
|
|
51
|
+
type: 'named',
|
|
52
|
+
packagePath,
|
|
53
|
+
packageJson,
|
|
54
|
+
},
|
|
55
|
+
usageGuidelines: [
|
|
56
|
+
'Use when building UI that loads or displays datasource data (e.g. list of links from Jira, Confluence, Assets). Must be used inside SmartCardProvider. Use getDatasourceDetails, getDatasourceData, and getActionsDiscovery as needed.',
|
|
57
|
+
],
|
|
58
|
+
contentGuidelines: [],
|
|
59
|
+
accessibilityGuidelines: [],
|
|
60
|
+
keywords: ['link-client-extension', 'hooks', 'datasource', 'useDatasourceClientExtension'],
|
|
61
|
+
categories: ['linking', 'data-display'],
|
|
62
|
+
examples: [],
|
|
53
63
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
],
|
|
57
|
-
contentGuidelines: [],
|
|
58
|
-
accessibilityGuidelines: [],
|
|
59
|
-
keywords: ['link-client-extension', 'hooks', 'datasource', 'useDatasourceClientExtension'],
|
|
60
|
-
categories: ['linking', 'data-display'],
|
|
61
|
-
examples: [],
|
|
62
|
-
},
|
|
63
|
-
];
|
|
64
|
+
],
|
|
65
|
+
};
|
|
64
66
|
|
|
65
67
|
export default documentation;
|