@atlaskit/collab-provider 11.3.1 → 11.3.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.
@@ -9,61 +9,77 @@ import type { StepJson, CollabSendableSelection, Metadata, UserPermitType, Prese
9
9
  import { type CatchupEventReason } from './helpers/const';
10
10
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
11
11
  export interface CollabEventDisconnectedData {
12
- sid: string;
13
12
  reason: 'CLIENT_DISCONNECT' | 'SERVER_DISCONNECT' | 'SOCKET_CLOSED' | 'SOCKET_ERROR' | 'SOCKET_TIMEOUT' | 'UNKNOWN_DISCONNECT';
13
+ sid: string;
14
14
  }
15
15
  export interface Storage {
16
+ delete: (key: string) => Promise<void>;
16
17
  get: (key: string) => Promise<string>;
17
18
  set: (key: string, value: string) => Promise<void>;
18
- delete: (key: string) => Promise<void>;
19
19
  }
20
20
  export interface InitialDraft {
21
21
  document: JSONDocNode;
22
- version: number;
23
22
  metadata?: Metadata;
23
+ version: number;
24
24
  }
25
25
  export type FetchAnonymousAsset = (presenceId: string | undefined) => Promise<AnonymousAsset | undefined>;
26
26
  export interface Config {
27
- url: string;
28
- documentAri: string;
29
- lifecycle?: Lifecycle;
30
- storage?: Storage;
31
- need404?: boolean;
32
- createSocket: (path: string, auth?: AuthCallback | InitAndAuthData, productInfo?: ProductInformation, isPresenceOnly?: boolean, analyticsHelper?: AnalyticsHelper) => SocketIOSocket;
33
- batchProps?: BatchProps;
34
- fetchAnonymousAsset?: FetchAnonymousAsset;
27
+ /**
28
+ * There is expected to be temporary divergence between Live Page editor expand behaviour and the standard expand behaviour.
29
+ *
30
+ * This is expected to be removed in Q4 as Editor and Live Page teams align on a singular behaviour.
31
+ *
32
+ * It is only supported for use by Confluence.
33
+ *
34
+ * @default false
35
+ */
36
+ __livePage?: boolean;
35
37
  /**
36
38
  * @deprecated: Use promise based getAnalyticsWebClient instead
37
39
  */
38
40
  analyticsClient?: AnalyticsWebClient;
39
- getAnalyticsWebClient?: Promise<AnalyticsWebClient>;
41
+ batchProps?: BatchProps;
42
+ createSocket: (path: string, auth?: AuthCallback | InitAndAuthData, productInfo?: ProductInformation, isPresenceOnly?: boolean, analyticsHelper?: AnalyticsHelper) => SocketIOSocket;
43
+ documentAri: string;
44
+ /**
45
+ * Enable checking if a document update from collab-provider is being dropped by the editor,
46
+ * throwing a non-recoverable error if it's detected.
47
+ */
48
+ enableErrorOnFailedDocumentApply?: boolean;
49
+ /**
50
+ * When a page is being published this number can control the number of failed steps until a catchup is triggered.
51
+ * The default value is MAX_STEP_REJECTED_ERROR (15).
52
+ */
53
+ failedStepLimitBeforeCatchupOnPublish?: number;
40
54
  featureFlags?: {
41
55
  [key: string]: boolean;
42
56
  };
57
+ fetchAnonymousAsset?: FetchAnonymousAsset;
58
+ getAnalyticsWebClient?: Promise<AnalyticsWebClient>;
43
59
  getUser?: GetUserType;
60
+ initialDraft?: InitialDraft;
61
+ isBufferingEnabled?: boolean;
62
+ isPresenceOnly?: boolean;
63
+ lifecycle?: Lifecycle;
64
+ need404?: boolean;
44
65
  /**
45
66
  * If provided, permissionTokenRefresh is called whenever a new JWT token is required.
46
67
  */
47
68
  permissionTokenRefresh?: () => Promise<string | null>;
48
- productInfo?: ProductInformation;
49
- /**
50
- * Throws errors when trying to send data to collab but the client is not offline.
51
- * This can lead to potential dataloss and retrying should be considered. Without this flag the provider silently drops the requests.
52
- */
53
- throwOnNotConnected?: boolean;
54
- initialDraft?: InitialDraft;
55
- isBufferingEnabled?: boolean;
56
- isPresenceOnly?: boolean;
57
69
  /**
58
- * When a page is being published this number can control the number of failed steps until a catchup is triggered.
59
- * The default value is MAX_STEP_REJECTED_ERROR (15).
70
+ * Configure the provider to pass along a default activity during presence events. This activity will be used
71
+ * to display a user's activity, such as 'viewer' or 'editor'.
72
+ *
73
+ * This activity can be updated later on by the participants-service.
60
74
  */
61
- failedStepLimitBeforeCatchupOnPublish?: number;
75
+ presenceActivity?: PresenceActivity;
62
76
  /**
63
- * Enable checking if a document update from collab-provider is being dropped by the editor,
64
- * throwing a non-recoverable error if it's detected.
77
+ * Configure the provider to pass along a persistent presenceId during presence events. This presenceId will be used
78
+ * to calculate the colors of the presence avatars as well as the editors telepointers. Since these two features are split across
79
+ * multiple websocket connections, the presenceId is used to correlate the two.
65
80
  */
66
- enableErrorOnFailedDocumentApply?: boolean;
81
+ presenceId?: string;
82
+ productInfo?: ProductInformation;
67
83
  /**
68
84
  * Configure the client side circuit breaker in the event that abnormal behaviour causes the client to flood
69
85
  * NCS with too many steps or too large a volume of data. This can result in either a soft fail or a hard (fatal) fail
@@ -73,29 +89,13 @@ export interface Config {
73
89
  rateLimitStepCount?: number;
74
90
  rateLimitTotalStepSize?: number;
75
91
  rateLimitType?: number;
92
+ storage?: Storage;
76
93
  /**
77
- * There is expected to be temporary divergence between Live Page editor expand behaviour and the standard expand behaviour.
78
- *
79
- * This is expected to be removed in Q4 as Editor and Live Page teams align on a singular behaviour.
80
- *
81
- * It is only supported for use by Confluence.
82
- *
83
- * @default false
84
- */
85
- __livePage?: boolean;
86
- /**
87
- * Configure the provider to pass along a persistent presenceId during presence events. This presenceId will be used
88
- * to calculate the colors of the presence avatars as well as the editors telepointers. Since these two features are split across
89
- * multiple websocket connections, the presenceId is used to correlate the two.
90
- */
91
- presenceId?: string;
92
- /**
93
- * Configure the provider to pass along a default activity during presence events. This activity will be used
94
- * to display a user's activity, such as 'viewer' or 'editor'.
95
- *
96
- * This activity can be updated later on by the participants-service.
94
+ * Throws errors when trying to send data to collab but the client is not offline.
95
+ * This can lead to potential dataloss and retrying should be considered. Without this flag the provider silently drops the requests.
97
96
  */
98
- presenceActivity?: PresenceActivity;
97
+ throwOnNotConnected?: boolean;
98
+ url: string;
99
99
  }
100
100
  export interface InitAndAuthData {
101
101
  initialized: boolean;
@@ -107,10 +107,10 @@ interface SimpleEventEmitter {
107
107
  on: (event: string, fn: Function) => SimpleEventEmitter;
108
108
  }
109
109
  export interface Socket extends SimpleEventEmitter {
110
- id: string;
110
+ close: () => Socket;
111
111
  connect: () => Socket;
112
112
  emit: (event: string, ...args: any[]) => Socket;
113
- close: () => Socket;
113
+ id: string;
114
114
  io?: Manager;
115
115
  }
116
116
  export type LifecycleEvents = 'save' | 'restore';
@@ -120,10 +120,10 @@ export interface Lifecycle {
120
120
  }
121
121
  export type InitPayload = {
122
122
  doc: any;
123
- version: number;
124
- userId?: string;
125
123
  metadata?: Metadata;
126
124
  targetClientId?: string;
125
+ userId?: string;
126
+ version: number;
127
127
  };
128
128
  /**
129
129
  * @description Incoming payload type from the `broadcast` route in NCS
@@ -132,21 +132,21 @@ export type InitPayload = {
132
132
  * @param data event specific data from NCS
133
133
  */
134
134
  export type BroadcastIncomingPayload = {
135
+ data: PresencePayload | TelepointerPayload | StepsPayload | any;
135
136
  sessionId?: string;
136
137
  timestamp?: number;
137
- data: PresencePayload | TelepointerPayload | StepsPayload | any;
138
138
  };
139
139
  export type PresenceData = {
140
- sessionId: string;
141
- userId: string | undefined;
142
140
  clientId: number | string;
143
141
  permit?: UserPermitType;
144
- presenceId?: string;
145
142
  presenceActivity?: PresenceActivity;
143
+ presenceId?: string;
144
+ sessionId: string;
145
+ userId: string | undefined;
146
146
  };
147
147
  export type PresencePayload = PresenceData & {
148
- timestamp: number;
149
148
  data?: Record<string, any>;
149
+ timestamp: number;
150
150
  };
151
151
  export type TelepointerPayload = PresencePayload & {
152
152
  selection: CollabSendableSelection;
@@ -160,19 +160,19 @@ export type AcknowledgementSuccessPayload = {
160
160
  };
161
161
  export type AcknowledgementPayload = AcknowledgementSuccessPayload | AcknowledgementErrorPayload;
162
162
  export type AddStepAcknowledgementSuccessPayload = {
163
+ delay?: number;
163
164
  type: AcknowledgementResponseTypes.SUCCESS;
164
165
  version: number;
165
- delay?: number;
166
166
  };
167
167
  export type AcknowledgementErrorPayload = {
168
- type: AcknowledgementResponseTypes.ERROR;
169
- error: InternalError;
170
168
  delay?: number;
169
+ error: InternalError;
170
+ type: AcknowledgementResponseTypes.ERROR;
171
171
  };
172
172
  export type AddStepAcknowledgementPayload = AddStepAcknowledgementSuccessPayload | AcknowledgementErrorPayload;
173
173
  export type StepsPayload = {
174
- version: number;
175
174
  steps: StepJson[];
175
+ version: number;
176
176
  };
177
177
  export type NamespaceStatus = {
178
178
  isLocked: boolean;
@@ -181,64 +181,64 @@ export type NamespaceStatus = {
181
181
  };
182
182
  export type ChannelEvent = {
183
183
  connected: {
184
- sid: string;
185
184
  initialized: boolean;
185
+ sid: string;
186
186
  };
187
+ disconnect: {
188
+ reason: string;
189
+ };
190
+ error: InternalError;
187
191
  init: InitPayload;
188
- restore: InitPayload;
189
- reconnected: null;
190
- 'presence:joined': PresencePayload;
191
- presence: PresencePayload;
192
+ 'metadata:changed': Metadata;
192
193
  'participant:left': PresencePayload;
193
194
  'participant:telepointer': TelepointerPayload;
194
195
  'participant:updated': PresencePayload;
196
+ permission: UserPermitType;
197
+ presence: PresencePayload;
198
+ 'presence:joined': PresencePayload;
199
+ reconnected: null;
200
+ restore: InitPayload;
201
+ status: NamespaceStatus;
202
+ 'steps:added': StepsPayload;
195
203
  'steps:commit': StepsPayload & {
196
- userId: string;
197
204
  collabMode: string;
198
205
  forcePublish?: boolean;
206
+ userId: string;
199
207
  };
200
- 'steps:added': StepsPayload;
201
- 'metadata:changed': Metadata;
202
- permission: UserPermitType;
203
- error: InternalError;
204
- disconnect: {
205
- reason: string;
206
- };
207
- status: NamespaceStatus;
208
208
  };
209
209
  export interface Catchupv2Response {
210
- steps?: StepJson[];
211
210
  metadata?: Metadata;
211
+ steps?: StepJson[];
212
212
  }
213
213
  export interface ReconcileResponse {
214
- document: string;
215
- version: number;
216
214
  ari?: string;
215
+ document: string;
217
216
  metadata?: Metadata;
217
+ version: number;
218
218
  }
219
219
  export type GenerateDiffStepsResponseBody = {
220
220
  documentAri: string;
221
221
  generatedSteps: StepJson[];
222
222
  latestDocument?: string;
223
- userId: string;
224
223
  message?: string;
224
+ userId: string;
225
225
  };
226
226
  export interface Catchupv2Options {
227
- getCurrentPmVersion: () => number;
228
- fetchCatchupv2: (fromVersion: number, clientId: number | string | undefined, catchUpOutofSync: boolean, reason?: CatchupEventReason, sessionId?: string) => Promise<Catchupv2Response>;
229
- updateMetadata: (metadata: Metadata | undefined) => void;
230
227
  analyticsHelper: AnalyticsHelper | undefined;
228
+ catchUpOutofSync: boolean;
231
229
  clientId: number | string | undefined;
230
+ fetchCatchupv2: (fromVersion: number, clientId: number | string | undefined, catchUpOutofSync: boolean, reason?: CatchupEventReason, sessionId?: string) => Promise<Catchupv2Response>;
231
+ getCurrentPmVersion: () => number;
232
+ getState: (() => EditorState) | undefined;
233
+ onCatchupComplete?: (steps: StepJson[]) => void;
232
234
  onStepsAdded: (data: StepsPayload) => void;
233
- catchUpOutofSync: boolean;
234
235
  reason?: CatchupEventReason;
235
236
  sessionId?: string;
236
- onCatchupComplete?: (steps: StepJson[]) => void;
237
- getState: (() => EditorState) | undefined;
237
+ updateMetadata: (metadata: Metadata | undefined) => void;
238
238
  }
239
239
  export type ReconnectionMetadata = {
240
- unconfirmedStepsLength: number | undefined;
241
240
  disconnectionPeriodSeconds: number | undefined;
241
+ unconfirmedStepsLength: number | undefined;
242
242
  };
243
243
  export type ProductInformation = {
244
244
  product: string;
@@ -117,13 +117,13 @@ export declare class DocumentService implements DocumentServiceInterface {
117
117
  to?: number | undefined;
118
118
  };
119
119
  stepMetadata: {
120
- source?: string;
121
- stepId?: string;
122
120
  prevStepId?: string;
123
121
  rebased?: boolean;
124
- traceId?: string;
125
122
  reqId?: string;
126
123
  schemaVersion?: string;
124
+ source?: string;
125
+ stepId?: string;
126
+ traceId?: string;
127
127
  unconfirmedStepAfterRecovery?: boolean;
128
128
  } | undefined;
129
129
  }[];
@@ -155,9 +155,9 @@ export declare class DocumentService implements DocumentServiceInterface {
155
155
  * @example
156
156
  */
157
157
  setup({ getState, onSyncUpError, clientId, }: {
158
+ clientId: number | string | undefined;
158
159
  getState: () => EditorState;
159
160
  onSyncUpError?: SyncUpErrorFunction;
160
- clientId: number | string | undefined;
161
161
  }): this;
162
162
  /**
163
163
  * We can use this function to throttle/delay
@@ -4,34 +4,34 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
4
4
  import type { InternalError } from '../errors/internal-errors';
5
5
  import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
6
6
  export interface DocumentServiceInterface {
7
- setup: (params: {
8
- getState: () => EditorState;
9
- onSyncUpError?: SyncUpErrorFunction;
10
- clientId: number | string | undefined;
11
- }) => this;
12
- updateDocument: (params: {
13
- doc: any;
14
- version: number;
15
- metadata: any;
16
- reserveCursor?: boolean;
17
- }) => void;
7
+ getCurrentPmVersion: () => number;
8
+ getCurrentState: () => Promise<ResolvedEditorState>;
9
+ getFinalAcknowledgedState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState>;
10
+ getIsNamespaceLocked: () => boolean;
11
+ getUnconfirmedSteps: () => readonly ProseMirrorStep[] | undefined;
12
+ onErrorHandled: (error: InternalError) => void;
18
13
  onRestore: (params: {
19
14
  doc: any;
20
- version: number;
21
15
  metadata: any;
16
+ version: number;
22
17
  }) => void;
18
+ onStepRejectedError: () => void;
23
19
  onStepsAdded: (data: {
24
- version: number;
25
20
  steps: any[];
21
+ version: number;
26
22
  }) => void;
27
- onStepRejectedError: () => void;
28
23
  send: (tr: Transaction | null, oldState: EditorState | null, newState: EditorState, sendAnalyticsEvent?: boolean) => void;
29
24
  sendStepsFromCurrentState: (sendAnalyticsEvent?: boolean, reason?: GetResolvedEditorStateReason) => void;
25
+ setup: (params: {
26
+ clientId: number | string | undefined;
27
+ getState: () => EditorState;
28
+ onSyncUpError?: SyncUpErrorFunction;
29
+ }) => this;
30
30
  throttledCatchupv2: () => void;
31
- getCurrentState: () => Promise<ResolvedEditorState>;
32
- getFinalAcknowledgedState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState>;
33
- getIsNamespaceLocked: () => boolean;
34
- getUnconfirmedSteps: () => readonly ProseMirrorStep[] | undefined;
35
- getCurrentPmVersion: () => number;
36
- onErrorHandled: (error: InternalError) => void;
31
+ updateDocument: (params: {
32
+ doc: any;
33
+ metadata: any;
34
+ reserveCursor?: boolean;
35
+ version: number;
36
+ }) => void;
37
37
  }
@@ -13,95 +13,95 @@ export declare enum INTERNAL_ERROR_CODE {
13
13
  OUT_OF_SYNC_CLIENT_DATA_LOSS_EVENT = "OUT_OF_SYNC_CLIENT_DATA_LOSS_EVENT"
14
14
  }
15
15
  type DocumentRecoveryError = {
16
- message: string;
17
16
  data: {
18
17
  code: INTERNAL_ERROR_CODE.DOCUMENT_RESTORE_ERROR;
19
18
  status: number;
20
19
  };
20
+ message: string;
21
21
  };
22
22
  type AddStepsError = {
23
- message: string;
24
23
  data: {
25
24
  code: INTERNAL_ERROR_CODE.ADD_STEPS_ERROR;
26
25
  status: number;
27
26
  };
27
+ message: string;
28
28
  };
29
29
  type OutOfSyncClientDatalossEvent = {
30
- message: string;
31
30
  data: {
31
+ code: INTERNAL_ERROR_CODE.OUT_OF_SYNC_CLIENT_DATA_LOSS_EVENT;
32
32
  meta: {
33
33
  reason?: string;
34
34
  };
35
- code: INTERNAL_ERROR_CODE.OUT_OF_SYNC_CLIENT_DATA_LOSS_EVENT;
36
35
  };
36
+ message: string;
37
37
  };
38
38
  export type CatchUpFailedError = {
39
- message: string;
40
39
  data: {
41
40
  code: INTERNAL_ERROR_CODE.CATCHUP_FAILED;
42
41
  status: number;
43
42
  };
43
+ message: string;
44
44
  };
45
45
  export type TokenPermissionError = {
46
- message: string;
47
46
  data: {
48
47
  code: INTERNAL_ERROR_CODE.TOKEN_PERMISSION_ERROR;
49
- status: number;
50
48
  meta: {
51
49
  originalError?: unknown;
52
50
  reason?: string;
53
51
  };
52
+ status: number;
54
53
  };
54
+ message: string;
55
55
  };
56
56
  export type ReconnectionError = {
57
- message: string;
58
57
  data: {
59
58
  code: INTERNAL_ERROR_CODE.RECONNECTION_ERROR;
60
59
  status: number;
61
60
  };
61
+ message: string;
62
62
  };
63
63
  export type ConnectionError = {
64
- message: string;
65
64
  data: {
66
65
  code: INTERNAL_ERROR_CODE.CONNECTION_ERROR;
67
66
  };
67
+ message: string;
68
68
  };
69
69
  export type ReconnectionNetworkError = {
70
- message: string;
71
70
  data: {
72
71
  code: INTERNAL_ERROR_CODE.RECONNECTION_NETWORK_ISSUE;
73
72
  };
73
+ message: string;
74
74
  };
75
75
  export type DocumentNotFoundError = {
76
- message: string;
77
76
  data: {
78
77
  code: INTERNAL_ERROR_CODE.DOCUMENT_NOT_FOUND;
79
78
  status: number;
80
79
  };
80
+ message: string;
81
81
  };
82
82
  /**
83
83
  * When we try to apply state updates to the editor, if that fails to apply the user can enter an invalid state where no
84
84
  * changes can be saved to NCS.
85
85
  */
86
86
  export type InternalDocumentUpdateFailure = {
87
- message: 'The provider failed to apply changes to the editor';
88
87
  data: {
89
88
  code: INTERNAL_ERROR_CODE.DOCUMENT_UPDATE_ERROR;
90
89
  meta: {
91
- newVersion?: number;
92
90
  editorVersion?: number;
91
+ newVersion?: number;
93
92
  };
94
93
  status: 500;
95
94
  };
95
+ message: 'The provider failed to apply changes to the editor';
96
96
  };
97
97
  /**
98
98
  * When in view only mode, we should not generate any steps whatsoever.
99
99
  */
100
100
  export type ViewOnlyStepsError = {
101
- message: 'Attempted to send steps in view only mode';
102
101
  data: {
103
102
  code: INTERNAL_ERROR_CODE.VIEW_ONLY_STEPS_ERROR;
104
103
  };
104
+ message: 'Attempted to send steps in view only mode';
105
105
  };
106
106
  /**
107
107
  * A union of all possible internal errors, that are mapped to another error if being emitted to the editor.
@@ -19,7 +19,6 @@ export declare enum NCS_ERROR_CODE {
19
19
  PROSEMIRROR_SCHEMA_VALIDATION_ERROR = "PROSEMIRROR_SCHEMA_VALIDATION_ERROR"
20
20
  }
21
21
  type HeadVersionUpdateFailedError = {
22
- message: string;
23
22
  data: {
24
23
  code: NCS_ERROR_CODE.HEAD_VERSION_UPDATE_FAILED;
25
24
  meta: {
@@ -28,17 +27,17 @@ type HeadVersionUpdateFailedError = {
28
27
  };
29
28
  status: number;
30
29
  };
30
+ message: string;
31
31
  };
32
32
  type VersionAlreadyPresentInDynamoError = {
33
- message: string;
34
33
  data: {
35
34
  code: NCS_ERROR_CODE.VERSION_NUMBER_ALREADY_EXISTS;
36
35
  meta: string;
37
36
  status: number;
38
37
  };
38
+ message: string;
39
39
  };
40
40
  type InsufficientEditingPermissionError = {
41
- message: string;
42
41
  data: {
43
42
  code: NCS_ERROR_CODE.INSUFFICIENT_EDITING_PERMISSION;
44
43
  meta: {
@@ -47,65 +46,65 @@ type InsufficientEditingPermissionError = {
47
46
  };
48
47
  status: number;
49
48
  };
49
+ message: string;
50
50
  };
51
51
  type ForbiddenUserTokenError = {
52
- message: string;
53
52
  data: {
54
53
  code: NCS_ERROR_CODE.FORBIDDEN_USER_TOKEN;
55
54
  meta: string;
56
55
  status: number;
57
56
  };
57
+ message: string;
58
58
  };
59
59
  type NCSDocumentNotFoundError = {
60
- message: string;
61
60
  data: {
62
61
  code: NCS_ERROR_CODE.DOCUMENT_NOT_FOUND;
63
62
  status: number;
64
63
  };
64
+ message: string;
65
65
  };
66
66
  type FailedToLoadInitDataError = {
67
- message: string;
68
67
  data: {
69
68
  code: NCS_ERROR_CODE.INIT_DATA_LOAD_FAILED;
70
69
  status: number;
71
70
  };
71
+ message: string;
72
72
  };
73
73
  /**
74
74
  * The backend has retrieved the document successfully, as ADF, but failed to convert it to Prosemirror.
75
75
  * This might be because invalid ADF has been written to a document, as it was not validated correctly.
76
76
  */
77
77
  type ProsemirrorSchemaValidationError = {
78
- message: string;
79
78
  data: {
80
79
  code: NCS_ERROR_CODE.PROSEMIRROR_SCHEMA_VALIDATION_ERROR;
81
80
  status: number;
82
81
  };
82
+ message: string;
83
83
  };
84
84
  type ErrorMappingError = {
85
- message: string;
86
85
  data: {
87
86
  code: NCS_ERROR_CODE.ERROR_MAPPING_ERROR;
88
87
  status: number;
89
88
  };
89
+ message: string;
90
90
  };
91
91
  type InvalidNamespaceDefinedError = {
92
- message: string;
93
92
  data: {
94
93
  code: NCS_ERROR_CODE.NAMESPACE_INVALID;
95
94
  meta: string;
96
95
  status: number;
97
96
  };
97
+ message: string;
98
98
  };
99
99
  type SocketNamespaceNotFoundError = {
100
- message: string;
101
100
  data: {
102
101
  code: NCS_ERROR_CODE.NAMESPACE_NOT_FOUND;
103
102
  meta: string;
104
103
  status: number;
105
104
  };
105
+ message: string;
106
106
  };
107
107
  type TenantInstanceMaintenanceError = {
108
- message: string;
109
108
  data: {
110
109
  code: NCS_ERROR_CODE.TENANT_INSTANCE_MAINTENANCE;
111
110
  meta: {
@@ -114,71 +113,72 @@ type TenantInstanceMaintenanceError = {
114
113
  };
115
114
  status: number;
116
115
  };
116
+ message: string;
117
117
  };
118
118
  type NamespaceLockedError = {
119
- message: string;
120
119
  data: {
121
120
  code: NCS_ERROR_CODE.LOCKED_DOCUMENT;
122
121
  meta: string;
123
122
  status: number;
124
123
  };
124
+ message: string;
125
125
  };
126
126
  type EmptyBroadcastError = {
127
- message: string;
128
127
  data: {
129
128
  code: NCS_ERROR_CODE.EMPTY_BROADCAST;
130
129
  meta: string;
131
130
  status: number;
132
131
  };
132
+ message: string;
133
133
  };
134
134
  type DynamoError = {
135
- message: string;
136
135
  data: {
137
136
  code: NCS_ERROR_CODE.DYNAMO_ERROR;
138
137
  meta: string;
139
138
  status: number;
140
139
  };
140
+ message: string;
141
141
  };
142
142
  type InvalidActivationIdError = {
143
- message: string;
144
143
  data: {
145
144
  code: NCS_ERROR_CODE.INVALID_ACTIVATION_ID;
146
145
  meta: string;
147
146
  status: number;
148
147
  };
148
+ message: string;
149
149
  };
150
150
  type InvalidDocumentAriError = {
151
- message: string;
152
151
  data: {
153
152
  code: NCS_ERROR_CODE.INVALID_DOCUMENT_ARI;
154
153
  meta: string;
155
154
  status: number;
156
155
  };
156
+ message: string;
157
157
  };
158
158
  type InvalidCloudIdError = {
159
- message: string;
160
159
  data: {
161
160
  code: NCS_ERROR_CODE.INVALID_CLOUD_ID;
162
161
  meta: string;
163
162
  status: number;
164
163
  };
164
+ message: string;
165
165
  };
166
166
  /**
167
167
  * The client is trying to send too many messages or messages that are too large. This not expected to be a standard
168
168
  * operating condition and should only ever indicate a frontend bug.
169
169
  */
170
170
  export type RateLimitError = {
171
- message: string;
172
171
  data: {
173
172
  code: NCS_ERROR_CODE.RATE_LIMIT_ERROR;
174
173
  meta: {
175
- rateLimitType: number;
176
174
  maxStepSize: number;
177
- stepSizeCounter: number;
175
+ rateLimitType: number;
178
176
  stepCounter: number;
177
+ stepSizeCounter: number;
179
178
  };
180
179
  status: 500;
181
180
  };
181
+ message: string;
182
182
  };
183
183
  export type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError | RateLimitError | ProsemirrorSchemaValidationError;
184
184
  export {};