@atlaskit/collab-provider 9.18.4 → 9.19.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,11 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 9.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#58777](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58777) [`f28d4e12e540`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f28d4e12e540) - Added PROSEMIRROR_SCHEMA_VALIDATION_ERROR from NCS
8
+
3
9
  ## 9.18.4
4
10
 
5
11
  ### Patch Changes
@@ -73,6 +73,12 @@ var errorCodeMapper = exports.errorCodeMapper = function errorCodeMapper(error)
73
73
  recoverable: false,
74
74
  status: 500
75
75
  };
76
+ case _ncsErrors.NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR:
77
+ return {
78
+ code: _collab.PROVIDER_ERROR_CODE.INITIALISATION_ERROR,
79
+ message: "The initial document couldn't be loaded from the collab service due to a prosemirror schema validation error",
80
+ recoverable: false
81
+ };
76
82
  case _internalErrors.INTERNAL_ERROR_CODE.DOCUMENT_UPDATE_ERROR:
77
83
  return {
78
84
  code: _collab.PROVIDER_ERROR_CODE.DOCUMENT_UPDATE_ERROR,
@@ -23,6 +23,7 @@ var NCS_ERROR_CODE = exports.NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_C
23
23
  NCS_ERROR_CODE["INVALID_DOCUMENT_ARI"] = "INVALID_DOCUMENT_ARI";
24
24
  NCS_ERROR_CODE["INVALID_CLOUD_ID"] = "INVALID_CLOUD_ID";
25
25
  NCS_ERROR_CODE["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
26
+ NCS_ERROR_CODE["PROSEMIRROR_SCHEMA_VALIDATION_ERROR"] = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR";
26
27
  return NCS_ERROR_CODE;
27
28
  }({}); // TODO: Import emitted error codes from NCS
28
29
  // NCS Errors
@@ -30,6 +31,10 @@ var NCS_ERROR_CODE = exports.NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_C
30
31
  // - Permission errors
31
32
  // - Page missing / TTL errors
32
33
  // - Server errors
34
+ /**
35
+ * The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
36
+ * This might be because invalid ADF has been written to a document, as it was not validated correctly.
37
+ */
33
38
  // - Less common back-end errors
34
39
  /**
35
40
  * The client is trying to send too many messages or messages that are too large. This not expected to be a standard
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/collab-provider";
8
- var version = exports.version = "9.18.4";
8
+ var version = exports.version = "9.19.0";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -68,6 +68,12 @@ export const errorCodeMapper = error => {
68
68
  recoverable: false,
69
69
  status: 500
70
70
  };
71
+ case NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR:
72
+ return {
73
+ code: PROVIDER_ERROR_CODE.INITIALISATION_ERROR,
74
+ message: "The initial document couldn't be loaded from the collab service due to a prosemirror schema validation error",
75
+ recoverable: false
76
+ };
71
77
  case INTERNAL_ERROR_CODE.DOCUMENT_UPDATE_ERROR:
72
78
  return {
73
79
  code: PROVIDER_ERROR_CODE.DOCUMENT_UPDATE_ERROR,
@@ -17,6 +17,7 @@ export let NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
17
17
  NCS_ERROR_CODE["INVALID_DOCUMENT_ARI"] = "INVALID_DOCUMENT_ARI";
18
18
  NCS_ERROR_CODE["INVALID_CLOUD_ID"] = "INVALID_CLOUD_ID";
19
19
  NCS_ERROR_CODE["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
20
+ NCS_ERROR_CODE["PROSEMIRROR_SCHEMA_VALIDATION_ERROR"] = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR";
20
21
  return NCS_ERROR_CODE;
21
22
  }({});
22
23
 
@@ -27,6 +28,10 @@ export let NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
27
28
  // - Permission errors
28
29
  // - Page missing / TTL errors
29
30
  // - Server errors
31
+ /**
32
+ * The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
33
+ * This might be because invalid ADF has been written to a document, as it was not validated correctly.
34
+ */
30
35
  // - Less common back-end errors
31
36
  /**
32
37
  * The client is trying to send too many messages or messages that are too large. This not expected to be a standard
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "9.18.4";
2
+ export const version = "9.19.0";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -68,6 +68,12 @@ export var errorCodeMapper = function errorCodeMapper(error) {
68
68
  recoverable: false,
69
69
  status: 500
70
70
  };
71
+ case NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR:
72
+ return {
73
+ code: PROVIDER_ERROR_CODE.INITIALISATION_ERROR,
74
+ message: "The initial document couldn't be loaded from the collab service due to a prosemirror schema validation error",
75
+ recoverable: false
76
+ };
71
77
  case INTERNAL_ERROR_CODE.DOCUMENT_UPDATE_ERROR:
72
78
  return {
73
79
  code: PROVIDER_ERROR_CODE.DOCUMENT_UPDATE_ERROR,
@@ -17,6 +17,7 @@ export var NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
17
17
  NCS_ERROR_CODE["INVALID_DOCUMENT_ARI"] = "INVALID_DOCUMENT_ARI";
18
18
  NCS_ERROR_CODE["INVALID_CLOUD_ID"] = "INVALID_CLOUD_ID";
19
19
  NCS_ERROR_CODE["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
20
+ NCS_ERROR_CODE["PROSEMIRROR_SCHEMA_VALIDATION_ERROR"] = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR";
20
21
  return NCS_ERROR_CODE;
21
22
  }({});
22
23
 
@@ -27,6 +28,10 @@ export var NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
27
28
  // - Permission errors
28
29
  // - Page missing / TTL errors
29
30
  // - Server errors
31
+ /**
32
+ * The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
33
+ * This might be because invalid ADF has been written to a document, as it was not validated correctly.
34
+ */
30
35
  // - Less common back-end errors
31
36
  /**
32
37
  * The client is trying to send too many messages or messages that are too large. This not expected to be a standard
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "9.18.4";
2
+ export var version = "9.19.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -15,7 +15,8 @@ export declare enum NCS_ERROR_CODE {
15
15
  INVALID_ACTIVATION_ID = "INVALID_ACTIVATION_ID",
16
16
  INVALID_DOCUMENT_ARI = "INVALID_DOCUMENT_ARI",
17
17
  INVALID_CLOUD_ID = "INVALID_CLOUD_ID",
18
- RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR"
18
+ RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR",
19
+ PROSEMIRROR_SCHEMA_VALIDATION_ERROR = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR"
19
20
  }
20
21
  type HeadVersionUpdateFailedError = {
21
22
  message: string;
@@ -69,6 +70,17 @@ type FailedToLoadInitDataError = {
69
70
  status: number;
70
71
  };
71
72
  };
73
+ /**
74
+ * The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
75
+ * This might be because invalid ADF has been written to a document, as it was not validated correctly.
76
+ */
77
+ type ProsemirrorSchemaValidationError = {
78
+ message: string;
79
+ data: {
80
+ code: NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR;
81
+ status: number;
82
+ };
83
+ };
72
84
  type ErrorMappingError = {
73
85
  message: string;
74
86
  data: {
@@ -168,5 +180,5 @@ export type RateLimitError = {
168
180
  status: 500;
169
181
  };
170
182
  };
171
- export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError;
183
+ export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError | ProsemirrorSchemaValidationError;
172
184
  export {};
@@ -15,7 +15,8 @@ export declare enum NCS_ERROR_CODE {
15
15
  INVALID_ACTIVATION_ID = "INVALID_ACTIVATION_ID",
16
16
  INVALID_DOCUMENT_ARI = "INVALID_DOCUMENT_ARI",
17
17
  INVALID_CLOUD_ID = "INVALID_CLOUD_ID",
18
- RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR"
18
+ RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR",
19
+ PROSEMIRROR_SCHEMA_VALIDATION_ERROR = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR"
19
20
  }
20
21
  type HeadVersionUpdateFailedError = {
21
22
  message: string;
@@ -69,6 +70,17 @@ type FailedToLoadInitDataError = {
69
70
  status: number;
70
71
  };
71
72
  };
73
+ /**
74
+ * The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
75
+ * This might be because invalid ADF has been written to a document, as it was not validated correctly.
76
+ */
77
+ type ProsemirrorSchemaValidationError = {
78
+ message: string;
79
+ data: {
80
+ code: NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR;
81
+ status: number;
82
+ };
83
+ };
72
84
  type ErrorMappingError = {
73
85
  message: string;
74
86
  data: {
@@ -168,5 +180,5 @@ export type RateLimitError = {
168
180
  status: 500;
169
181
  };
170
182
  };
171
- export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError;
183
+ export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError | ProsemirrorSchemaValidationError;
172
184
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.18.4",
3
+ "version": "9.19.0",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"