@atlaskit/collab-provider 9.18.0 → 9.18.2
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 +12 -0
- package/dist/cjs/analytics/analytics-helper.js +2 -2
- package/dist/cjs/channel.js +14 -12
- package/dist/cjs/document/document-service.js +7 -6
- package/dist/cjs/errors/{error-types.js → custom-errors.js} +1 -68
- package/dist/cjs/errors/error-code-mapper.js +27 -26
- package/dist/cjs/errors/internal-errors.js +40 -0
- package/dist/cjs/errors/ncs-errors.js +37 -0
- package/dist/cjs/provider/commit-step.js +3 -3
- package/dist/cjs/provider/index.js +14 -13
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/analytics/analytics-helper.js +1 -1
- package/dist/es2019/channel.js +3 -1
- package/dist/es2019/document/document-service.js +2 -1
- package/dist/es2019/errors/custom-errors.js +92 -0
- package/dist/es2019/errors/error-code-mapper.js +2 -2
- package/dist/es2019/errors/internal-errors.js +39 -0
- package/dist/es2019/errors/ncs-errors.js +34 -0
- package/dist/es2019/provider/commit-step.js +1 -1
- package/dist/es2019/provider/index.js +2 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/analytics/analytics-helper.js +1 -1
- package/dist/esm/channel.js +3 -1
- package/dist/esm/document/document-service.js +2 -1
- package/dist/esm/errors/{error-types.js → custom-errors.js} +0 -73
- package/dist/esm/errors/error-code-mapper.js +2 -2
- package/dist/esm/errors/internal-errors.js +39 -0
- package/dist/esm/errors/ncs-errors.js +34 -0
- package/dist/esm/provider/commit-step.js +1 -1
- package/dist/esm/provider/index.js +2 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/document/document-service.d.ts +1 -1
- package/dist/types/errors/custom-errors.d.ts +56 -0
- package/dist/types/errors/error-code-mapper.d.ts +2 -2
- package/dist/types/errors/internal-errors.d.ts +90 -0
- package/dist/types/errors/ncs-errors.d.ts +172 -0
- package/dist/types/provider/commit-step.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/document/document-service.d.ts +1 -1
- package/dist/types-ts4.5/errors/custom-errors.d.ts +56 -0
- package/dist/types-ts4.5/errors/error-code-mapper.d.ts +2 -2
- package/dist/types-ts4.5/errors/internal-errors.d.ts +90 -0
- package/dist/types-ts4.5/errors/ncs-errors.d.ts +172 -0
- package/dist/types-ts4.5/provider/commit-step.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +2 -2
- package/dist/es2019/errors/error-types.js +0 -165
- package/dist/types/errors/error-types.d.ts +0 -315
- package/dist/types-ts4.5/errors/error-types.d.ts +0 -315
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
2
2
|
import type { AnalyticsWebClient } from '@atlaskit/analytics-listeners';
|
|
3
3
|
import type { Manager } from 'socket.io-client';
|
|
4
|
-
import type { InternalError } from './errors/
|
|
4
|
+
import type { InternalError } from './errors/internal-errors';
|
|
5
5
|
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
6
6
|
import type { GetUserType } from './participants/participants-helper';
|
|
7
7
|
import type AnalyticsHelper from './analytics/analytics-helper';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "9.18.
|
|
3
|
+
"version": "9.18.2",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@atlaskit/adf-schema": "^
|
|
65
|
+
"@atlaskit/adf-schema": "^35.0.0",
|
|
66
66
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
67
67
|
"typescript": "~4.9.5"
|
|
68
68
|
},
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
// Internal error codes (generated by collab provider)
|
|
3
|
-
|
|
4
|
-
export let INTERNAL_ERROR_CODE = /*#__PURE__*/function (INTERNAL_ERROR_CODE) {
|
|
5
|
-
INTERNAL_ERROR_CODE["TOKEN_PERMISSION_ERROR"] = "TOKEN_PERMISSION_ERROR";
|
|
6
|
-
INTERNAL_ERROR_CODE["RECONNECTION_NETWORK_ISSUE"] = "RECONNECTION_NETWORK_ISSUE";
|
|
7
|
-
INTERNAL_ERROR_CODE["CONNECTION_ERROR"] = "CONNECTION_ERROR";
|
|
8
|
-
INTERNAL_ERROR_CODE["RECONNECTION_ERROR"] = "RECONNECTION_ERROR";
|
|
9
|
-
INTERNAL_ERROR_CODE["DOCUMENT_NOT_FOUND"] = "DOCUMENT_NOT_FOUND";
|
|
10
|
-
INTERNAL_ERROR_CODE["CATCHUP_FAILED"] = "CATCHUP_FAILED";
|
|
11
|
-
INTERNAL_ERROR_CODE["DOCUMENT_RESTORE_ERROR"] = "DOCUMENT_RESTORE_ERROR";
|
|
12
|
-
INTERNAL_ERROR_CODE["ADD_STEPS_ERROR"] = "ADD_STEPS_ERROR";
|
|
13
|
-
INTERNAL_ERROR_CODE["DOCUMENT_UPDATE_ERROR"] = "DOCUMENT_UPDATE_ERROR";
|
|
14
|
-
return INTERNAL_ERROR_CODE;
|
|
15
|
-
}({});
|
|
16
|
-
|
|
17
|
-
// NCS error coded (generated by NCS)
|
|
18
|
-
export let NCS_ERROR_CODE = /*#__PURE__*/function (NCS_ERROR_CODE) {
|
|
19
|
-
NCS_ERROR_CODE["HEAD_VERSION_UPDATE_FAILED"] = "HEAD_VERSION_UPDATE_FAILED";
|
|
20
|
-
NCS_ERROR_CODE["VERSION_NUMBER_ALREADY_EXISTS"] = "VERSION_NUMBER_ALREADY_EXISTS";
|
|
21
|
-
NCS_ERROR_CODE["INSUFFICIENT_EDITING_PERMISSION"] = "INSUFFICIENT_EDITING_PERMISSION";
|
|
22
|
-
NCS_ERROR_CODE["FORBIDDEN_USER_TOKEN"] = "FORBIDDEN_USER_TOKEN";
|
|
23
|
-
NCS_ERROR_CODE["DOCUMENT_NOT_FOUND"] = "DOCUMENT_NOT_FOUND";
|
|
24
|
-
NCS_ERROR_CODE["INIT_DATA_LOAD_FAILED"] = "INIT_DATA_LOAD_FAILED";
|
|
25
|
-
NCS_ERROR_CODE["ERROR_MAPPING_ERROR"] = "ERROR_MAPPING_ERROR";
|
|
26
|
-
NCS_ERROR_CODE["NAMESPACE_INVALID"] = "NAMESPACE_INVALID";
|
|
27
|
-
NCS_ERROR_CODE["NAMESPACE_NOT_FOUND"] = "NAMESPACE_NOT_FOUND";
|
|
28
|
-
NCS_ERROR_CODE["TENANT_INSTANCE_MAINTENANCE"] = "TENANT_INSTANCE_MAINTENANCE";
|
|
29
|
-
NCS_ERROR_CODE["LOCKED_DOCUMENT"] = "LOCKED_DOCUMENT";
|
|
30
|
-
NCS_ERROR_CODE["EMPTY_BROADCAST"] = "EMPTY_BROADCAST";
|
|
31
|
-
NCS_ERROR_CODE["DYNAMO_ERROR"] = "DYNAMO_ERROR";
|
|
32
|
-
NCS_ERROR_CODE["INVALID_ACTIVATION_ID"] = "INVALID_ACTIVATION_ID";
|
|
33
|
-
NCS_ERROR_CODE["INVALID_DOCUMENT_ARI"] = "INVALID_DOCUMENT_ARI";
|
|
34
|
-
NCS_ERROR_CODE["INVALID_CLOUD_ID"] = "INVALID_CLOUD_ID";
|
|
35
|
-
NCS_ERROR_CODE["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
|
|
36
|
-
return NCS_ERROR_CODE;
|
|
37
|
-
}({});
|
|
38
|
-
|
|
39
|
-
// TODO: Import emitted error codes from NCS
|
|
40
|
-
|
|
41
|
-
// NCS Errors
|
|
42
|
-
// - Step rejection errors
|
|
43
|
-
// - Permission errors
|
|
44
|
-
// - Page missing / TTL errors
|
|
45
|
-
// - Server errors
|
|
46
|
-
// - Less common back-end errors
|
|
47
|
-
// Provider Errors
|
|
48
|
-
// Channel Errors
|
|
49
|
-
/**
|
|
50
|
-
* When we try to apply state updates to the editor, if that fails to apply the user can enter an invalid state where no
|
|
51
|
-
* changes can be saved to NCS.
|
|
52
|
-
*/
|
|
53
|
-
/**
|
|
54
|
-
* The client is trying to send too many messages or messages that are too large. This not expected to be a standard
|
|
55
|
-
* operating condition and should only ever indicate a frontend bug.
|
|
56
|
-
*/
|
|
57
|
-
/**
|
|
58
|
-
* A union of all possible internal errors, that are mapped to another error if being emitted to the editor.
|
|
59
|
-
*/
|
|
60
|
-
/*
|
|
61
|
-
* This is what a generic ProviderError type would look like:
|
|
62
|
-
* type ProviderError = {
|
|
63
|
-
* // Unique code, identifies the specific emitted error
|
|
64
|
-
* // Also exposed as a PROVIDER_ERROR_CODE enum to allow subscribers to use them
|
|
65
|
-
* code: PROVIDER_ERROR_CODE;
|
|
66
|
-
* // Informative message describing what went wrong
|
|
67
|
-
* message: string;
|
|
68
|
-
* // Flag indicating whether an error is recoverable or not
|
|
69
|
-
* // used by consumers to disable the provider and show an error message
|
|
70
|
-
* recoverable: boolean;
|
|
71
|
-
* // A reason code used to give more detail about why a certain error was thrown
|
|
72
|
-
* reason?: string;
|
|
73
|
-
* }
|
|
74
|
-
*/
|
|
75
|
-
// Custom Errors
|
|
76
|
-
export class CustomError extends Error {
|
|
77
|
-
constructor(message, error, extraEventAttributes) {
|
|
78
|
-
super(message);
|
|
79
|
-
_defineProperty(this, "getExtraErrorEventAttributes", () => this.extraEventAttributes);
|
|
80
|
-
if (typeof (error === null || error === void 0 ? void 0 : error.message) === 'string') {
|
|
81
|
-
this.message = error.message;
|
|
82
|
-
}
|
|
83
|
-
if (extraEventAttributes) {
|
|
84
|
-
this.extraEventAttributes = extraEventAttributes;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
toJSON() {
|
|
88
|
-
return {
|
|
89
|
-
name: this.name,
|
|
90
|
-
message: this.message
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export class NotConnectedError extends CustomError {
|
|
95
|
-
constructor(...args) {
|
|
96
|
-
super(...args);
|
|
97
|
-
_defineProperty(this, "name", 'NotConnectedError');
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
export class NotInitializedError extends CustomError {
|
|
101
|
-
constructor(...args) {
|
|
102
|
-
super(...args);
|
|
103
|
-
_defineProperty(this, "name", 'NotInitializedError');
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
export class ProviderInitialisationError extends CustomError {
|
|
107
|
-
constructor(...args) {
|
|
108
|
-
super(...args);
|
|
109
|
-
_defineProperty(this, "name", 'ProviderInitialisationError');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
export class SendTransactionError extends CustomError {
|
|
113
|
-
constructor(...args) {
|
|
114
|
-
super(...args);
|
|
115
|
-
_defineProperty(this, "name", 'SendTransactionError');
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
export class DestroyError extends CustomError {
|
|
119
|
-
constructor(...args) {
|
|
120
|
-
super(...args);
|
|
121
|
-
_defineProperty(this, "name", 'DestroyError');
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
export class SetTitleError extends CustomError {
|
|
125
|
-
constructor(...args) {
|
|
126
|
-
super(...args);
|
|
127
|
-
_defineProperty(this, "name", 'SetTitleError');
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
export class SetEditorWidthError extends CustomError {
|
|
131
|
-
constructor(...args) {
|
|
132
|
-
super(...args);
|
|
133
|
-
_defineProperty(this, "name", 'SetEditorWidthError');
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
export class SetMetadataError extends CustomError {
|
|
137
|
-
constructor(...args) {
|
|
138
|
-
super(...args);
|
|
139
|
-
_defineProperty(this, "name", 'SetMetadataError');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
export class GetCurrentStateError extends CustomError {
|
|
143
|
-
constructor(...args) {
|
|
144
|
-
super(...args);
|
|
145
|
-
_defineProperty(this, "name", 'GetCurrentStateError');
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
export class GetFinalAcknowledgedStateError extends CustomError {
|
|
149
|
-
constructor(...args) {
|
|
150
|
-
super(...args);
|
|
151
|
-
_defineProperty(this, "name", 'GetFinalAcknowledgedStateError');
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
export class UpdateDocumentError extends CustomError {
|
|
155
|
-
constructor(message, extraAttributes) {
|
|
156
|
-
super(message, undefined, extraAttributes);
|
|
157
|
-
_defineProperty(this, "name", 'UpdateDocumentError');
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
export class CantSyncUpError extends CustomError {
|
|
161
|
-
constructor(message, extraAttributes) {
|
|
162
|
-
super(message, undefined, extraAttributes);
|
|
163
|
-
_defineProperty(this, "name", 'CantSyncUpError');
|
|
164
|
-
}
|
|
165
|
-
}
|
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
import { CantSyncUpErrorAttributes, DocumentUpdateErrorAttributes } from '../helpers/const';
|
|
2
|
-
export declare enum INTERNAL_ERROR_CODE {
|
|
3
|
-
TOKEN_PERMISSION_ERROR = "TOKEN_PERMISSION_ERROR",
|
|
4
|
-
RECONNECTION_NETWORK_ISSUE = "RECONNECTION_NETWORK_ISSUE",
|
|
5
|
-
CONNECTION_ERROR = "CONNECTION_ERROR",
|
|
6
|
-
RECONNECTION_ERROR = "RECONNECTION_ERROR",
|
|
7
|
-
DOCUMENT_NOT_FOUND = "DOCUMENT_NOT_FOUND",
|
|
8
|
-
CATCHUP_FAILED = "CATCHUP_FAILED",
|
|
9
|
-
DOCUMENT_RESTORE_ERROR = "DOCUMENT_RESTORE_ERROR",
|
|
10
|
-
ADD_STEPS_ERROR = "ADD_STEPS_ERROR",
|
|
11
|
-
DOCUMENT_UPDATE_ERROR = "DOCUMENT_UPDATE_ERROR"
|
|
12
|
-
}
|
|
13
|
-
export declare enum NCS_ERROR_CODE {
|
|
14
|
-
HEAD_VERSION_UPDATE_FAILED = "HEAD_VERSION_UPDATE_FAILED",
|
|
15
|
-
VERSION_NUMBER_ALREADY_EXISTS = "VERSION_NUMBER_ALREADY_EXISTS",
|
|
16
|
-
INSUFFICIENT_EDITING_PERMISSION = "INSUFFICIENT_EDITING_PERMISSION",
|
|
17
|
-
FORBIDDEN_USER_TOKEN = "FORBIDDEN_USER_TOKEN",
|
|
18
|
-
DOCUMENT_NOT_FOUND = "DOCUMENT_NOT_FOUND",
|
|
19
|
-
INIT_DATA_LOAD_FAILED = "INIT_DATA_LOAD_FAILED",
|
|
20
|
-
ERROR_MAPPING_ERROR = "ERROR_MAPPING_ERROR",
|
|
21
|
-
NAMESPACE_INVALID = "NAMESPACE_INVALID",
|
|
22
|
-
NAMESPACE_NOT_FOUND = "NAMESPACE_NOT_FOUND",
|
|
23
|
-
TENANT_INSTANCE_MAINTENANCE = "TENANT_INSTANCE_MAINTENANCE",
|
|
24
|
-
LOCKED_DOCUMENT = "LOCKED_DOCUMENT",
|
|
25
|
-
EMPTY_BROADCAST = "EMPTY_BROADCAST",
|
|
26
|
-
DYNAMO_ERROR = "DYNAMO_ERROR",
|
|
27
|
-
INVALID_ACTIVATION_ID = "INVALID_ACTIVATION_ID",
|
|
28
|
-
INVALID_DOCUMENT_ARI = "INVALID_DOCUMENT_ARI",
|
|
29
|
-
INVALID_CLOUD_ID = "INVALID_CLOUD_ID",
|
|
30
|
-
RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR"
|
|
31
|
-
}
|
|
32
|
-
type HeadVersionUpdateFailedError = {
|
|
33
|
-
message: string;
|
|
34
|
-
data: {
|
|
35
|
-
code: NCS_ERROR_CODE.HEAD_VERSION_UPDATE_FAILED;
|
|
36
|
-
meta: {
|
|
37
|
-
currentVersion: any;
|
|
38
|
-
incomingVersion: number;
|
|
39
|
-
};
|
|
40
|
-
status: number;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
type VersionAlreadyPresentInDynamoError = {
|
|
44
|
-
message: string;
|
|
45
|
-
data: {
|
|
46
|
-
code: NCS_ERROR_CODE.VERSION_NUMBER_ALREADY_EXISTS;
|
|
47
|
-
meta: string;
|
|
48
|
-
status: number;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
type InsufficientEditingPermissionError = {
|
|
52
|
-
message: string;
|
|
53
|
-
data: {
|
|
54
|
-
code: NCS_ERROR_CODE.INSUFFICIENT_EDITING_PERMISSION;
|
|
55
|
-
meta: {
|
|
56
|
-
description: string;
|
|
57
|
-
reason?: string;
|
|
58
|
-
};
|
|
59
|
-
status: number;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
type ForbiddenUserTokenError = {
|
|
63
|
-
message: string;
|
|
64
|
-
data: {
|
|
65
|
-
code: NCS_ERROR_CODE.FORBIDDEN_USER_TOKEN;
|
|
66
|
-
meta: string;
|
|
67
|
-
status: number;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
type NCSDocumentNotFoundError = {
|
|
71
|
-
message: string;
|
|
72
|
-
data: {
|
|
73
|
-
code: NCS_ERROR_CODE.DOCUMENT_NOT_FOUND;
|
|
74
|
-
status: number;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
type FailedToLoadInitDataError = {
|
|
78
|
-
message: string;
|
|
79
|
-
data: {
|
|
80
|
-
code: NCS_ERROR_CODE.INIT_DATA_LOAD_FAILED;
|
|
81
|
-
status: number;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
type ErrorMappingError = {
|
|
85
|
-
message: string;
|
|
86
|
-
data: {
|
|
87
|
-
code: NCS_ERROR_CODE.ERROR_MAPPING_ERROR;
|
|
88
|
-
status: number;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
type InvalidNamespaceDefinedError = {
|
|
92
|
-
message: string;
|
|
93
|
-
data: {
|
|
94
|
-
code: NCS_ERROR_CODE.NAMESPACE_INVALID;
|
|
95
|
-
meta: string;
|
|
96
|
-
status: number;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
type SocketNamespaceNotFoundError = {
|
|
100
|
-
message: string;
|
|
101
|
-
data: {
|
|
102
|
-
code: NCS_ERROR_CODE.NAMESPACE_NOT_FOUND;
|
|
103
|
-
meta: string;
|
|
104
|
-
status: number;
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
type TenantInstanceMaintenanceError = {
|
|
108
|
-
message: string;
|
|
109
|
-
data: {
|
|
110
|
-
code: NCS_ERROR_CODE.TENANT_INSTANCE_MAINTENANCE;
|
|
111
|
-
meta: {
|
|
112
|
-
description: string;
|
|
113
|
-
reason: string;
|
|
114
|
-
};
|
|
115
|
-
status: number;
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
type NamespaceLockedError = {
|
|
119
|
-
message: string;
|
|
120
|
-
data: {
|
|
121
|
-
code: NCS_ERROR_CODE.LOCKED_DOCUMENT;
|
|
122
|
-
meta: string;
|
|
123
|
-
status: number;
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
type EmptyBroadcastError = {
|
|
127
|
-
message: string;
|
|
128
|
-
data: {
|
|
129
|
-
code: NCS_ERROR_CODE.EMPTY_BROADCAST;
|
|
130
|
-
meta: string;
|
|
131
|
-
status: number;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
type DynamoError = {
|
|
135
|
-
message: string;
|
|
136
|
-
data: {
|
|
137
|
-
code: NCS_ERROR_CODE.DYNAMO_ERROR;
|
|
138
|
-
meta: string;
|
|
139
|
-
status: number;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
type InvalidActivationIdError = {
|
|
143
|
-
message: string;
|
|
144
|
-
data: {
|
|
145
|
-
code: NCS_ERROR_CODE.INVALID_ACTIVATION_ID;
|
|
146
|
-
meta: string;
|
|
147
|
-
status: number;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
type InvalidDocumentAriError = {
|
|
151
|
-
message: string;
|
|
152
|
-
data: {
|
|
153
|
-
code: NCS_ERROR_CODE.INVALID_DOCUMENT_ARI;
|
|
154
|
-
meta: string;
|
|
155
|
-
status: number;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
type InvalidCloudIdError = {
|
|
159
|
-
message: string;
|
|
160
|
-
data: {
|
|
161
|
-
code: NCS_ERROR_CODE.INVALID_CLOUD_ID;
|
|
162
|
-
meta: string;
|
|
163
|
-
status: number;
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | InternalDocumentUpdateFailure;
|
|
167
|
-
type DocumentRecoveryError = {
|
|
168
|
-
message: string;
|
|
169
|
-
data: {
|
|
170
|
-
code: INTERNAL_ERROR_CODE.DOCUMENT_RESTORE_ERROR;
|
|
171
|
-
status: number;
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
type AddStepsError = {
|
|
175
|
-
message: string;
|
|
176
|
-
data: {
|
|
177
|
-
code: INTERNAL_ERROR_CODE.ADD_STEPS_ERROR;
|
|
178
|
-
status: number;
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
export type CatchUpFailedError = {
|
|
182
|
-
message: string;
|
|
183
|
-
data: {
|
|
184
|
-
code: INTERNAL_ERROR_CODE.CATCHUP_FAILED;
|
|
185
|
-
status: number;
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
export type TokenPermissionError = {
|
|
189
|
-
message: string;
|
|
190
|
-
data: {
|
|
191
|
-
code: INTERNAL_ERROR_CODE.TOKEN_PERMISSION_ERROR;
|
|
192
|
-
status: number;
|
|
193
|
-
meta: {
|
|
194
|
-
originalError?: unknown;
|
|
195
|
-
reason?: string;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
export type ReconnectionError = {
|
|
200
|
-
message: string;
|
|
201
|
-
data: {
|
|
202
|
-
code: INTERNAL_ERROR_CODE.RECONNECTION_ERROR;
|
|
203
|
-
status: number;
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
export type ConnectionError = {
|
|
207
|
-
message: string;
|
|
208
|
-
data: {
|
|
209
|
-
code: INTERNAL_ERROR_CODE.CONNECTION_ERROR;
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
export type ReconnectionNetworkError = {
|
|
213
|
-
message: string;
|
|
214
|
-
data: {
|
|
215
|
-
code: INTERNAL_ERROR_CODE.RECONNECTION_NETWORK_ISSUE;
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
export type DocumentNotFoundError = {
|
|
219
|
-
message: string;
|
|
220
|
-
data: {
|
|
221
|
-
code: INTERNAL_ERROR_CODE.DOCUMENT_NOT_FOUND;
|
|
222
|
-
status: number;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
226
|
-
* When we try to apply state updates to the editor, if that fails to apply the user can enter an invalid state where no
|
|
227
|
-
* changes can be saved to NCS.
|
|
228
|
-
*/
|
|
229
|
-
export type InternalDocumentUpdateFailure = {
|
|
230
|
-
message: 'The provider failed to apply changes to the editor';
|
|
231
|
-
data: {
|
|
232
|
-
code: INTERNAL_ERROR_CODE.DOCUMENT_UPDATE_ERROR;
|
|
233
|
-
meta: {
|
|
234
|
-
newVersion?: number;
|
|
235
|
-
editorVersion?: number;
|
|
236
|
-
};
|
|
237
|
-
status: 500;
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* The client is trying to send too many messages or messages that are too large. This not expected to be a standard
|
|
242
|
-
* operating condition and should only ever indicate a frontend bug.
|
|
243
|
-
*/
|
|
244
|
-
export type RateLimitError = {
|
|
245
|
-
message: string;
|
|
246
|
-
data: {
|
|
247
|
-
code: NCS_ERROR_CODE.RATE_LIMIT_ERROR;
|
|
248
|
-
meta: {
|
|
249
|
-
rateLimitType: number;
|
|
250
|
-
maxStepSize: number;
|
|
251
|
-
stepSizeCounter: number;
|
|
252
|
-
stepCounter: number;
|
|
253
|
-
};
|
|
254
|
-
status: 500;
|
|
255
|
-
};
|
|
256
|
-
};
|
|
257
|
-
/**
|
|
258
|
-
* A union of all possible internal errors, that are mapped to another error if being emitted to the editor.
|
|
259
|
-
*/
|
|
260
|
-
export type InternalError = NCSErrors | DocumentRecoveryError | AddStepsError | CatchUpFailedError | TokenPermissionError | ReconnectionError | ConnectionError | ReconnectionNetworkError | DocumentNotFoundError | InternalDocumentUpdateFailure | RateLimitError;
|
|
261
|
-
type ValidEventAttributeType = boolean | string | number;
|
|
262
|
-
export declare class CustomError extends Error {
|
|
263
|
-
extraEventAttributes?: {
|
|
264
|
-
[key: string]: ValidEventAttributeType;
|
|
265
|
-
};
|
|
266
|
-
constructor(message: string, error?: unknown, extraEventAttributes?: {
|
|
267
|
-
[key: string]: ValidEventAttributeType;
|
|
268
|
-
});
|
|
269
|
-
toJSON(): {
|
|
270
|
-
name: string;
|
|
271
|
-
message: string;
|
|
272
|
-
};
|
|
273
|
-
getExtraErrorEventAttributes: () => {
|
|
274
|
-
[key: string]: ValidEventAttributeType;
|
|
275
|
-
} | undefined;
|
|
276
|
-
}
|
|
277
|
-
export declare class NotConnectedError extends CustomError {
|
|
278
|
-
name: string;
|
|
279
|
-
}
|
|
280
|
-
export declare class NotInitializedError extends CustomError {
|
|
281
|
-
name: string;
|
|
282
|
-
}
|
|
283
|
-
export declare class ProviderInitialisationError extends CustomError {
|
|
284
|
-
name: string;
|
|
285
|
-
}
|
|
286
|
-
export declare class SendTransactionError extends CustomError {
|
|
287
|
-
name: string;
|
|
288
|
-
}
|
|
289
|
-
export declare class DestroyError extends CustomError {
|
|
290
|
-
name: string;
|
|
291
|
-
}
|
|
292
|
-
export declare class SetTitleError extends CustomError {
|
|
293
|
-
name: string;
|
|
294
|
-
}
|
|
295
|
-
export declare class SetEditorWidthError extends CustomError {
|
|
296
|
-
name: string;
|
|
297
|
-
}
|
|
298
|
-
export declare class SetMetadataError extends CustomError {
|
|
299
|
-
name: string;
|
|
300
|
-
}
|
|
301
|
-
export declare class GetCurrentStateError extends CustomError {
|
|
302
|
-
name: string;
|
|
303
|
-
}
|
|
304
|
-
export declare class GetFinalAcknowledgedStateError extends CustomError {
|
|
305
|
-
name: string;
|
|
306
|
-
}
|
|
307
|
-
export declare class UpdateDocumentError extends CustomError {
|
|
308
|
-
name: string;
|
|
309
|
-
constructor(message: string, extraAttributes: DocumentUpdateErrorAttributes);
|
|
310
|
-
}
|
|
311
|
-
export declare class CantSyncUpError extends CustomError {
|
|
312
|
-
name: string;
|
|
313
|
-
constructor(message: string, extraAttributes: CantSyncUpErrorAttributes);
|
|
314
|
-
}
|
|
315
|
-
export {};
|