@atlaskit/editor-synced-block-provider 3.9.0 → 3.10.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 +7 -0
- package/dist/cjs/providers/block-service/blockServiceAPI.js +21 -1
- package/dist/es2019/providers/block-service/blockServiceAPI.js +21 -1
- package/dist/esm/providers/block-service/blockServiceAPI.js +21 -1
- package/dist/types/clients/confluence/fetchMediaToken.d.ts +2 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/clients/confluence/fetchMediaToken.d.ts +2 -3
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 3.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`7638bd91b6c72`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7638bd91b6c72) -
|
|
8
|
+
The errors should render correctly when using batch-retrieve to fetch synced blocks
|
|
9
|
+
|
|
3
10
|
## 3.9.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -43,6 +43,26 @@ var mapBlockError = function mapBlockError(error) {
|
|
|
43
43
|
}
|
|
44
44
|
return _types.SyncBlockError.Errored;
|
|
45
45
|
};
|
|
46
|
+
var mapErrorResponseCode = function mapErrorResponseCode(errorCode) {
|
|
47
|
+
switch (errorCode) {
|
|
48
|
+
case 'FORBIDDEN':
|
|
49
|
+
return _types.SyncBlockError.Forbidden;
|
|
50
|
+
case 'NOT_FOUND':
|
|
51
|
+
return _types.SyncBlockError.NotFound;
|
|
52
|
+
case 'INVALID_REQUEST':
|
|
53
|
+
return _types.SyncBlockError.InvalidRequest;
|
|
54
|
+
case 'CONFLICT':
|
|
55
|
+
return _types.SyncBlockError.Conflict;
|
|
56
|
+
case 'RATE_LIMITED':
|
|
57
|
+
return _types.SyncBlockError.RateLimited;
|
|
58
|
+
case 'SERVER_ERROR':
|
|
59
|
+
return _types.SyncBlockError.ServerError;
|
|
60
|
+
case 'INVALID_CONTENT':
|
|
61
|
+
return _types.SyncBlockError.InvalidContent;
|
|
62
|
+
default:
|
|
63
|
+
return _types.SyncBlockError.Errored;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
46
66
|
|
|
47
67
|
/**
|
|
48
68
|
* Extracts the ResourceId from a block ARI by returning the full path after synced-block/.
|
|
@@ -460,7 +480,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
460
480
|
case 44:
|
|
461
481
|
processedResourceIds.add(_resourceId);
|
|
462
482
|
results.push({
|
|
463
|
-
error:
|
|
483
|
+
error: mapErrorResponseCode(errorResponse.code),
|
|
464
484
|
resourceId: _resourceId
|
|
465
485
|
});
|
|
466
486
|
case 46:
|
|
@@ -26,6 +26,26 @@ const mapBlockError = error => {
|
|
|
26
26
|
}
|
|
27
27
|
return SyncBlockError.Errored;
|
|
28
28
|
};
|
|
29
|
+
const mapErrorResponseCode = errorCode => {
|
|
30
|
+
switch (errorCode) {
|
|
31
|
+
case 'FORBIDDEN':
|
|
32
|
+
return SyncBlockError.Forbidden;
|
|
33
|
+
case 'NOT_FOUND':
|
|
34
|
+
return SyncBlockError.NotFound;
|
|
35
|
+
case 'INVALID_REQUEST':
|
|
36
|
+
return SyncBlockError.InvalidRequest;
|
|
37
|
+
case 'CONFLICT':
|
|
38
|
+
return SyncBlockError.Conflict;
|
|
39
|
+
case 'RATE_LIMITED':
|
|
40
|
+
return SyncBlockError.RateLimited;
|
|
41
|
+
case 'SERVER_ERROR':
|
|
42
|
+
return SyncBlockError.ServerError;
|
|
43
|
+
case 'INVALID_CONTENT':
|
|
44
|
+
return SyncBlockError.InvalidContent;
|
|
45
|
+
default:
|
|
46
|
+
return SyncBlockError.Errored;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
29
49
|
|
|
30
50
|
/**
|
|
31
51
|
* Extracts the ResourceId from a block ARI by returning the full path after synced-block/.
|
|
@@ -314,7 +334,7 @@ class BlockServiceADFFetchProvider {
|
|
|
314
334
|
}
|
|
315
335
|
processedResourceIds.add(resourceId);
|
|
316
336
|
results.push({
|
|
317
|
-
error:
|
|
337
|
+
error: mapErrorResponseCode(errorResponse.code),
|
|
318
338
|
resourceId
|
|
319
339
|
});
|
|
320
340
|
}
|
|
@@ -37,6 +37,26 @@ var mapBlockError = function mapBlockError(error) {
|
|
|
37
37
|
}
|
|
38
38
|
return SyncBlockError.Errored;
|
|
39
39
|
};
|
|
40
|
+
var mapErrorResponseCode = function mapErrorResponseCode(errorCode) {
|
|
41
|
+
switch (errorCode) {
|
|
42
|
+
case 'FORBIDDEN':
|
|
43
|
+
return SyncBlockError.Forbidden;
|
|
44
|
+
case 'NOT_FOUND':
|
|
45
|
+
return SyncBlockError.NotFound;
|
|
46
|
+
case 'INVALID_REQUEST':
|
|
47
|
+
return SyncBlockError.InvalidRequest;
|
|
48
|
+
case 'CONFLICT':
|
|
49
|
+
return SyncBlockError.Conflict;
|
|
50
|
+
case 'RATE_LIMITED':
|
|
51
|
+
return SyncBlockError.RateLimited;
|
|
52
|
+
case 'SERVER_ERROR':
|
|
53
|
+
return SyncBlockError.ServerError;
|
|
54
|
+
case 'INVALID_CONTENT':
|
|
55
|
+
return SyncBlockError.InvalidContent;
|
|
56
|
+
default:
|
|
57
|
+
return SyncBlockError.Errored;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
40
60
|
|
|
41
61
|
/**
|
|
42
62
|
* Extracts the ResourceId from a block ARI by returning the full path after synced-block/.
|
|
@@ -454,7 +474,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
454
474
|
case 44:
|
|
455
475
|
processedResourceIds.add(_resourceId);
|
|
456
476
|
results.push({
|
|
457
|
-
error:
|
|
477
|
+
error: mapErrorResponseCode(errorResponse.code),
|
|
458
478
|
resourceId: _resourceId
|
|
459
479
|
});
|
|
460
480
|
case 46:
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
type ConfigData = {
|
|
1
|
+
export type ConfigData = {
|
|
2
2
|
readonly clientId: string;
|
|
3
3
|
readonly fileStoreUrl: string;
|
|
4
4
|
};
|
|
5
|
-
type TokenData = {
|
|
5
|
+
export type TokenData = {
|
|
6
6
|
collectionId?: string;
|
|
7
7
|
config: ConfigData;
|
|
8
8
|
token: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const fetchMediaToken: (contentId: string) => Promise<TokenData>;
|
|
11
|
-
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { useFetchSyncBlockTitle } from './hooks/useFetchSyncBlockTitle';
|
|
|
6
6
|
export { useHandleContentChanges } from './hooks/useHandleContentChanges';
|
|
7
7
|
export { generateBlockAri, generateBlockAriFromReference, getLocalIdFromBlockResourceId, } from './clients/block-service/ari';
|
|
8
8
|
export { getConfluencePageAri, getPageIdAndTypeFromConfluencePageAri, } from './clients/confluence/ari';
|
|
9
|
-
export { fetchMediaToken } from './clients/confluence/fetchMediaToken';
|
|
9
|
+
export { fetchMediaToken, type TokenData, type ConfigData, } from './clients/confluence/fetchMediaToken';
|
|
10
10
|
export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from './clients/jira/ari';
|
|
11
11
|
export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, } from './providers/block-service/blockServiceAPI';
|
|
12
12
|
export { fetchConfluencePageInfo } from './clients/confluence/sourceInfo';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
type ConfigData = {
|
|
1
|
+
export type ConfigData = {
|
|
2
2
|
readonly clientId: string;
|
|
3
3
|
readonly fileStoreUrl: string;
|
|
4
4
|
};
|
|
5
|
-
type TokenData = {
|
|
5
|
+
export type TokenData = {
|
|
6
6
|
collectionId?: string;
|
|
7
7
|
config: ConfigData;
|
|
8
8
|
token: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const fetchMediaToken: (contentId: string) => Promise<TokenData>;
|
|
11
|
-
export {};
|
|
@@ -6,7 +6,7 @@ export { useFetchSyncBlockTitle } from './hooks/useFetchSyncBlockTitle';
|
|
|
6
6
|
export { useHandleContentChanges } from './hooks/useHandleContentChanges';
|
|
7
7
|
export { generateBlockAri, generateBlockAriFromReference, getLocalIdFromBlockResourceId, } from './clients/block-service/ari';
|
|
8
8
|
export { getConfluencePageAri, getPageIdAndTypeFromConfluencePageAri, } from './clients/confluence/ari';
|
|
9
|
-
export { fetchMediaToken } from './clients/confluence/fetchMediaToken';
|
|
9
|
+
export { fetchMediaToken, type TokenData, type ConfigData, } from './clients/confluence/fetchMediaToken';
|
|
10
10
|
export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from './clients/jira/ari';
|
|
11
11
|
export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, } from './providers/block-service/blockServiceAPI';
|
|
12
12
|
export { fetchConfluencePageInfo } from './clients/confluence/sourceInfo';
|
package/package.json
CHANGED