@atlaskit/collab-provider 8.8.1 → 8.8.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 +6 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/channel.d.ts +1 -1
- package/dist/types/errors/error-types.d.ts +37 -37
- package/dist/types/feature-flags/types.d.ts +4 -4
- package/dist/types/helpers/const.d.ts +19 -19
- package/dist/types/helpers/utils.d.ts +2 -2
- package/dist/types/metadata/metadata-service.d.ts +1 -1
- package/dist/types/participants/participants-helper.d.ts +5 -5
- package/dist/types/provider/commit-step.d.ts +2 -2
- package/dist/types/provider/index.d.ts +1 -1
- package/dist/types/types.d.ts +27 -27
- package/package.json +11 -3
- package/socket-io-provider/package.json +2 -2
- package/types/package.json +2 -2
- package/version-wrapper/package.json +2 -2
- package/dist/types-ts4.0/analytics/analytics-helper.d.ts +0 -11
- package/dist/types-ts4.0/analytics/performance.d.ts +0 -15
- package/dist/types-ts4.0/analytics/ufo.d.ts +0 -3
- package/dist/types-ts4.0/channel.d.ts +0 -47
- package/dist/types-ts4.0/config.d.ts +0 -5
- package/dist/types-ts4.0/connectivity/network.d.ts +0 -17
- package/dist/types-ts4.0/connectivity/reconnect-helper.d.ts +0 -8
- package/dist/types-ts4.0/connectivity/singleton.d.ts +0 -3
- package/dist/types-ts4.0/disconnected-reason-mapper.d.ts +0 -16
- package/dist/types-ts4.0/document/catchup.d.ts +0 -9
- package/dist/types-ts4.0/document/document-service.d.ts +0 -86
- package/dist/types-ts4.0/document/step-queue-state.d.ts +0 -16
- package/dist/types-ts4.0/emitter.d.ts +0 -19
- package/dist/types-ts4.0/errors/error-code-mapper.d.ts +0 -2
- package/dist/types-ts4.0/errors/error-types.d.ts +0 -443
- package/dist/types-ts4.0/feature-flags/__test__/index.unit.d.ts +0 -1
- package/dist/types-ts4.0/feature-flags/index.d.ts +0 -9
- package/dist/types-ts4.0/feature-flags/types.d.ts +0 -13
- package/dist/types-ts4.0/helpers/const.d.ts +0 -183
- package/dist/types-ts4.0/helpers/utils.d.ts +0 -5
- package/dist/types-ts4.0/index.d.ts +0 -4
- package/dist/types-ts4.0/metadata/metadata-service.d.ts +0 -25
- package/dist/types-ts4.0/participants/participants-helper.d.ts +0 -14
- package/dist/types-ts4.0/participants/participants-service.d.ts +0 -70
- package/dist/types-ts4.0/participants/participants-state.d.ts +0 -13
- package/dist/types-ts4.0/participants/telepointers-helper.d.ts +0 -4
- package/dist/types-ts4.0/provider/commit-step.d.ts +0 -25
- package/dist/types-ts4.0/provider/index.d.ts +0 -162
- package/dist/types-ts4.0/socket-io-provider.d.ts +0 -5
- package/dist/types-ts4.0/types.d.ts +0 -265
- package/dist/types-ts4.0/version-wrapper.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/collab-provider";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "8.8.
|
|
9
|
+
var version = "8.8.2";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
package/dist/types/channel.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare class Channel extends Emitter<ChannelEvent> {
|
|
|
34
34
|
* @throws {NotInitializedError} Channel not initialized
|
|
35
35
|
* @throws {NotConnectedError} Channel not connected
|
|
36
36
|
*/
|
|
37
|
-
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], "timestamp">, callback?: Function
|
|
37
|
+
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], "timestamp">, callback?: Function) => void;
|
|
38
38
|
/**
|
|
39
39
|
* Send metadata to the back-end service over the channel
|
|
40
40
|
* @throws {NotInitializedError} Channel not initialized
|
|
@@ -26,7 +26,7 @@ export declare enum NCS_ERROR_CODE {
|
|
|
26
26
|
INVALID_DOCUMENT_ARI = "INVALID_DOCUMENT_ARI",
|
|
27
27
|
INVALID_CLOUD_ID = "INVALID_CLOUD_ID"
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
type HeadVersionUpdateFailedError = {
|
|
30
30
|
message: string;
|
|
31
31
|
data: {
|
|
32
32
|
code: NCS_ERROR_CODE.HEAD_VERSION_UPDATE_FAILED;
|
|
@@ -37,7 +37,7 @@ declare type HeadVersionUpdateFailedError = {
|
|
|
37
37
|
status: number;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
type VersionAlreadyPresentInDynamoError = {
|
|
41
41
|
message: string;
|
|
42
42
|
data: {
|
|
43
43
|
code: NCS_ERROR_CODE.VERSION_NUMBER_ALREADY_EXISTS;
|
|
@@ -45,7 +45,7 @@ declare type VersionAlreadyPresentInDynamoError = {
|
|
|
45
45
|
status: number;
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
type InsufficientEditingPermissionError = {
|
|
49
49
|
message: string;
|
|
50
50
|
data: {
|
|
51
51
|
code: NCS_ERROR_CODE.INSUFFICIENT_EDITING_PERMISSION;
|
|
@@ -56,7 +56,7 @@ declare type InsufficientEditingPermissionError = {
|
|
|
56
56
|
status: number;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
type ForbiddenUserTokenError = {
|
|
60
60
|
message: string;
|
|
61
61
|
data: {
|
|
62
62
|
code: NCS_ERROR_CODE.FORBIDDEN_USER_TOKEN;
|
|
@@ -64,28 +64,28 @@ declare type ForbiddenUserTokenError = {
|
|
|
64
64
|
status: number;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
type NCSDocumentNotFoundError = {
|
|
68
68
|
message: string;
|
|
69
69
|
data: {
|
|
70
70
|
code: NCS_ERROR_CODE.DOCUMENT_NOT_FOUND;
|
|
71
71
|
status: number;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
|
|
74
|
+
type FailedToLoadInitDataError = {
|
|
75
75
|
message: string;
|
|
76
76
|
data: {
|
|
77
77
|
code: NCS_ERROR_CODE.INIT_DATA_LOAD_FAILED;
|
|
78
78
|
status: number;
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
type ErrorMappingError = {
|
|
82
82
|
message: string;
|
|
83
83
|
data: {
|
|
84
84
|
code: NCS_ERROR_CODE.ERROR_MAPPING_ERROR;
|
|
85
85
|
status: number;
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
type InvalidNamespaceDefinedError = {
|
|
89
89
|
message: string;
|
|
90
90
|
data: {
|
|
91
91
|
code: NCS_ERROR_CODE.NAMESPACE_INVALID;
|
|
@@ -93,7 +93,7 @@ declare type InvalidNamespaceDefinedError = {
|
|
|
93
93
|
status: number;
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
|
-
|
|
96
|
+
type SocketNamespaceNotFoundError = {
|
|
97
97
|
message: string;
|
|
98
98
|
data: {
|
|
99
99
|
code: NCS_ERROR_CODE.NAMESPACE_NOT_FOUND;
|
|
@@ -101,7 +101,7 @@ declare type SocketNamespaceNotFoundError = {
|
|
|
101
101
|
status: number;
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
type TenantInstanceMaintenanceError = {
|
|
105
105
|
message: string;
|
|
106
106
|
data: {
|
|
107
107
|
code: NCS_ERROR_CODE.TENANT_INSTANCE_MAINTENANCE;
|
|
@@ -112,7 +112,7 @@ declare type TenantInstanceMaintenanceError = {
|
|
|
112
112
|
status: number;
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
|
-
|
|
115
|
+
type NamespaceLockedError = {
|
|
116
116
|
message: string;
|
|
117
117
|
data: {
|
|
118
118
|
code: NCS_ERROR_CODE.LOCKED_DOCUMENT;
|
|
@@ -120,7 +120,7 @@ declare type NamespaceLockedError = {
|
|
|
120
120
|
status: number;
|
|
121
121
|
};
|
|
122
122
|
};
|
|
123
|
-
|
|
123
|
+
type EmptyBroadcastError = {
|
|
124
124
|
message: string;
|
|
125
125
|
data: {
|
|
126
126
|
code: NCS_ERROR_CODE.EMPTY_BROADCAST;
|
|
@@ -128,7 +128,7 @@ declare type EmptyBroadcastError = {
|
|
|
128
128
|
status: number;
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
|
-
|
|
131
|
+
type DynamoError = {
|
|
132
132
|
message: string;
|
|
133
133
|
data: {
|
|
134
134
|
code: NCS_ERROR_CODE.DYNAMO_ERROR;
|
|
@@ -136,7 +136,7 @@ declare type DynamoError = {
|
|
|
136
136
|
status: number;
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
|
-
|
|
139
|
+
type InvalidActivationIdError = {
|
|
140
140
|
message: string;
|
|
141
141
|
data: {
|
|
142
142
|
code: NCS_ERROR_CODE.INVALID_ACTIVATION_ID;
|
|
@@ -144,7 +144,7 @@ declare type InvalidActivationIdError = {
|
|
|
144
144
|
status: number;
|
|
145
145
|
};
|
|
146
146
|
};
|
|
147
|
-
|
|
147
|
+
type InvalidDocumentAriError = {
|
|
148
148
|
message: string;
|
|
149
149
|
data: {
|
|
150
150
|
code: NCS_ERROR_CODE.INVALID_DOCUMENT_ARI;
|
|
@@ -152,7 +152,7 @@ declare type InvalidDocumentAriError = {
|
|
|
152
152
|
status: number;
|
|
153
153
|
};
|
|
154
154
|
};
|
|
155
|
-
|
|
155
|
+
type InvalidCloudIdError = {
|
|
156
156
|
message: string;
|
|
157
157
|
data: {
|
|
158
158
|
code: NCS_ERROR_CODE.INVALID_CLOUD_ID;
|
|
@@ -160,29 +160,29 @@ declare type InvalidCloudIdError = {
|
|
|
160
160
|
status: number;
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError;
|
|
164
|
+
type DocumentRecoveryError = {
|
|
165
165
|
message: string;
|
|
166
166
|
data: {
|
|
167
167
|
code: INTERNAL_ERROR_CODE.DOCUMENT_RESTORE_ERROR;
|
|
168
168
|
status: number;
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
|
-
|
|
171
|
+
type AddStepsError = {
|
|
172
172
|
message: string;
|
|
173
173
|
data: {
|
|
174
174
|
code: INTERNAL_ERROR_CODE.ADD_STEPS_ERROR;
|
|
175
175
|
status: number;
|
|
176
176
|
};
|
|
177
177
|
};
|
|
178
|
-
export
|
|
178
|
+
export type CatchUpFailedError = {
|
|
179
179
|
message: string;
|
|
180
180
|
data: {
|
|
181
181
|
code: INTERNAL_ERROR_CODE.CATCHUP_FAILED;
|
|
182
182
|
status: number;
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
|
-
export
|
|
185
|
+
export type TokenPermissionError = {
|
|
186
186
|
message: string;
|
|
187
187
|
data: {
|
|
188
188
|
code: INTERNAL_ERROR_CODE.TOKEN_PERMISSION_ERROR;
|
|
@@ -193,26 +193,26 @@ export declare type TokenPermissionError = {
|
|
|
193
193
|
};
|
|
194
194
|
};
|
|
195
195
|
};
|
|
196
|
-
export
|
|
196
|
+
export type ReconnectionError = {
|
|
197
197
|
message: string;
|
|
198
198
|
data: {
|
|
199
199
|
code: INTERNAL_ERROR_CODE.RECONNECTION_ERROR;
|
|
200
200
|
status: number;
|
|
201
201
|
};
|
|
202
202
|
};
|
|
203
|
-
export
|
|
203
|
+
export type ConnectionError = {
|
|
204
204
|
message: string;
|
|
205
205
|
data: {
|
|
206
206
|
code: INTERNAL_ERROR_CODE.CONNECTION_ERROR;
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
|
-
export
|
|
209
|
+
export type ReconnectionNetworkError = {
|
|
210
210
|
message: string;
|
|
211
211
|
data: {
|
|
212
212
|
code: INTERNAL_ERROR_CODE.RECONNECTION_NETWORK_ISSUE;
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
|
-
export
|
|
215
|
+
export type DocumentNotFoundError = {
|
|
216
216
|
message: string;
|
|
217
217
|
data: {
|
|
218
218
|
code: INTERNAL_ERROR_CODE.DOCUMENT_NOT_FOUND;
|
|
@@ -222,7 +222,7 @@ export declare type DocumentNotFoundError = {
|
|
|
222
222
|
/**
|
|
223
223
|
* A union of all possible internal errors, that are mapped to another error if being emitted to the editor.
|
|
224
224
|
*/
|
|
225
|
-
export
|
|
225
|
+
export type InternalError = NCSErrors | DocumentRecoveryError | AddStepsError | CatchUpFailedError | TokenPermissionError | ReconnectionError | ConnectionError | ReconnectionNetworkError | DocumentNotFoundError;
|
|
226
226
|
export declare enum PROVIDER_ERROR_CODE {
|
|
227
227
|
NO_PERMISSION_ERROR = "NO_PERMISSION_ERROR",
|
|
228
228
|
INVALID_USER_TOKEN = "INVALID_USER_TOKEN",
|
|
@@ -242,7 +242,7 @@ export declare enum PROVIDER_ERROR_CODE {
|
|
|
242
242
|
* @message Message returned to editor, i.e User does not have permissions to access this document or document is not found
|
|
243
243
|
* @recoverable It is recoverable, as we will try to refresh the token.
|
|
244
244
|
*/
|
|
245
|
-
|
|
245
|
+
type InsufficientEditingPermission = {
|
|
246
246
|
code: PROVIDER_ERROR_CODE.NO_PERMISSION_ERROR;
|
|
247
247
|
message: string;
|
|
248
248
|
recoverable: boolean;
|
|
@@ -259,7 +259,7 @@ declare type InsufficientEditingPermission = {
|
|
|
259
259
|
* @message Message returned to editor, i.e. The user token was invalid
|
|
260
260
|
* @recoverable It is recoverable, as we will try to refresh the token.
|
|
261
261
|
*/
|
|
262
|
-
|
|
262
|
+
type InvalidUserToken = {
|
|
263
263
|
code: PROVIDER_ERROR_CODE.INVALID_USER_TOKEN;
|
|
264
264
|
message: string;
|
|
265
265
|
recoverable: boolean;
|
|
@@ -275,7 +275,7 @@ declare type InvalidUserToken = {
|
|
|
275
275
|
* @message Message returned to editor, i.e. The requested document is not found
|
|
276
276
|
* @recoverable It is recoverable, as the provider can try again later.
|
|
277
277
|
*/
|
|
278
|
-
|
|
278
|
+
type DocumentNotFound = {
|
|
279
279
|
code: PROVIDER_ERROR_CODE.DOCUMENT_NOT_FOUND;
|
|
280
280
|
message: string;
|
|
281
281
|
recoverable: boolean;
|
|
@@ -290,7 +290,7 @@ declare type DocumentNotFound = {
|
|
|
290
290
|
* @message Message returned to editor, i.e. The document is currently not available, please try again later
|
|
291
291
|
* @recoverable It is recoverable, as the provider can try again later.
|
|
292
292
|
*/
|
|
293
|
-
|
|
293
|
+
type Locked = {
|
|
294
294
|
code: PROVIDER_ERROR_CODE.LOCKED;
|
|
295
295
|
message: string;
|
|
296
296
|
recoverable: boolean;
|
|
@@ -303,7 +303,7 @@ declare type Locked = {
|
|
|
303
303
|
* @message Message returned to editor, i.e. Collab service is not able to save changes
|
|
304
304
|
* @recoverable It is not recoverable, as we don't want the user to continue editing a document that is not being saved.
|
|
305
305
|
*/
|
|
306
|
-
|
|
306
|
+
type FailToSave = {
|
|
307
307
|
code: PROVIDER_ERROR_CODE.FAIL_TO_SAVE;
|
|
308
308
|
message: string;
|
|
309
309
|
recoverable: boolean;
|
|
@@ -321,7 +321,7 @@ declare type FailToSave = {
|
|
|
321
321
|
* @recoverable It is not recoverable, as the provider has no further options after this.
|
|
322
322
|
* The user will need to refresh the page to try again.
|
|
323
323
|
*/
|
|
324
|
-
|
|
324
|
+
type DocumentNotRestore = {
|
|
325
325
|
code: PROVIDER_ERROR_CODE.DOCUMENT_RESTORE_ERROR;
|
|
326
326
|
message: string;
|
|
327
327
|
recoverable: boolean;
|
|
@@ -338,7 +338,7 @@ declare type DocumentNotRestore = {
|
|
|
338
338
|
* @recoverable It is not recoverable, as the provider cannot do anything to fix it.
|
|
339
339
|
* The user will need to refresh the page to try again.
|
|
340
340
|
*/
|
|
341
|
-
|
|
341
|
+
type InitialisationError = {
|
|
342
342
|
code: PROVIDER_ERROR_CODE.INITIALISATION_ERROR;
|
|
343
343
|
message: string;
|
|
344
344
|
recoverable: boolean;
|
|
@@ -354,7 +354,7 @@ declare type InitialisationError = {
|
|
|
354
354
|
* @message Message returned to editor, i.e. Couldn't reconnect to the collab service due to network issues
|
|
355
355
|
* @recoverable It is recoverable, as the provider will try to reconnect.
|
|
356
356
|
*/
|
|
357
|
-
|
|
357
|
+
type NetworkIssue = {
|
|
358
358
|
code: PROVIDER_ERROR_CODE.NETWORK_ISSUE;
|
|
359
359
|
message: string;
|
|
360
360
|
recoverable: boolean;
|
|
@@ -374,7 +374,7 @@ declare type NetworkIssue = {
|
|
|
374
374
|
* @recoverable It is not recoverable, as the provider cannot do anything to fix it.
|
|
375
375
|
* The service using the provider will need to fix the configuration.
|
|
376
376
|
*/
|
|
377
|
-
|
|
377
|
+
type InvalidProviderConfiguration = {
|
|
378
378
|
code: PROVIDER_ERROR_CODE.INVALID_PROVIDER_CONFIGURATION;
|
|
379
379
|
message: string;
|
|
380
380
|
recoverable: boolean;
|
|
@@ -389,7 +389,7 @@ declare type InvalidProviderConfiguration = {
|
|
|
389
389
|
* @message Message returned to editor, i.e. Collab Provider experienced an unrecoverable error
|
|
390
390
|
* @recoverable It is not recoverable, as the provider cannot do anything to fix it.
|
|
391
391
|
*/
|
|
392
|
-
|
|
392
|
+
type InternalServiceError = {
|
|
393
393
|
code: PROVIDER_ERROR_CODE.INTERNAL_SERVICE_ERROR;
|
|
394
394
|
message: string;
|
|
395
395
|
recoverable: boolean;
|
|
@@ -402,7 +402,7 @@ declare type InternalServiceError = {
|
|
|
402
402
|
/**
|
|
403
403
|
* A union of all possible provider errors that can be emitted back to the editor.
|
|
404
404
|
*/
|
|
405
|
-
export
|
|
405
|
+
export type ProviderError = InsufficientEditingPermission | InvalidUserToken | DocumentNotFound | Locked | FailToSave | DocumentNotRestore | InitialisationError | NetworkIssue | InvalidProviderConfiguration | InternalServiceError;
|
|
406
406
|
declare class CustomError extends Error {
|
|
407
407
|
constructor(message: string, error?: unknown);
|
|
408
408
|
toJSON(): {
|
|
@@ -4,8 +4,8 @@ export interface NCSFeatureFlags {
|
|
|
4
4
|
export interface WithNCSFeatureFlags {
|
|
5
5
|
featureFlags?: NCSFeatureFlags;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type RequiredNCSFeatureFlags = Record<keyof Required<NCSFeatureFlags>, boolean>;
|
|
8
|
+
export type NCSFeatureFlagsMap = Record<keyof Required<NCSFeatureFlags>, string>;
|
|
9
9
|
export declare const supportedProducts: readonly ["confluence"];
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type SupportedProduct = (typeof supportedProducts)[number];
|
|
11
|
+
export type ProductKeys = Record<SupportedProduct, NCSFeatureFlagsMap>;
|
|
@@ -21,7 +21,7 @@ export declare enum ADD_STEPS_TYPE {
|
|
|
21
21
|
REJECTED = "REJECTED",
|
|
22
22
|
ERROR = "ERROR"
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export type ErrorAnalyticsEvent = {
|
|
25
25
|
eventAction: EVENT_ACTION.ERROR;
|
|
26
26
|
attributes: {
|
|
27
27
|
errorMessage: string;
|
|
@@ -33,7 +33,7 @@ export declare type ErrorAnalyticsEvent = {
|
|
|
33
33
|
error: unknown;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
type InvalidateTokenAnalyticsEvent = {
|
|
37
37
|
eventAction: EVENT_ACTION.INVALIDATE_TOKEN;
|
|
38
38
|
attributes: {
|
|
39
39
|
eventStatus: EVENT_STATUS.SUCCESS;
|
|
@@ -41,7 +41,7 @@ declare type InvalidateTokenAnalyticsEvent = {
|
|
|
41
41
|
usedCachedToken?: boolean;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
type AddStepsSuccessAnalyticsEvent = {
|
|
45
45
|
eventAction: EVENT_ACTION.ADD_STEPS;
|
|
46
46
|
attributes: {
|
|
47
47
|
documentAri: string;
|
|
@@ -53,7 +53,7 @@ declare type AddStepsSuccessAnalyticsEvent = {
|
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
type AddStepsFailureAnalyticsEvent = {
|
|
57
57
|
eventAction: EVENT_ACTION.ADD_STEPS;
|
|
58
58
|
attributes: {
|
|
59
59
|
documentAri: string;
|
|
@@ -62,7 +62,7 @@ declare type AddStepsFailureAnalyticsEvent = {
|
|
|
62
62
|
latency?: number;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
type ReInitDocFailAnalyticsEvent = {
|
|
66
66
|
eventAction: EVENT_ACTION.REINITIALISE_DOCUMENT;
|
|
67
67
|
attributes: {
|
|
68
68
|
documentAri: string;
|
|
@@ -70,7 +70,7 @@ declare type ReInitDocFailAnalyticsEvent = {
|
|
|
70
70
|
numUnconfirmedSteps: number;
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
|
-
|
|
73
|
+
type ReInitDocSuccessAnalyticsEvent = {
|
|
74
74
|
eventAction: EVENT_ACTION.REINITIALISE_DOCUMENT;
|
|
75
75
|
attributes: {
|
|
76
76
|
documentAri: string;
|
|
@@ -78,7 +78,7 @@ declare type ReInitDocSuccessAnalyticsEvent = {
|
|
|
78
78
|
numUnconfirmedSteps: number;
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
type ConnectionSuccessAnalyticsEvent = {
|
|
82
82
|
eventAction: EVENT_ACTION.CONNECTION;
|
|
83
83
|
attributes: {
|
|
84
84
|
documentAri: string;
|
|
@@ -86,7 +86,7 @@ declare type ConnectionSuccessAnalyticsEvent = {
|
|
|
86
86
|
latency?: number;
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
type ConnectionFailureAnalyticsEvent = {
|
|
90
90
|
eventAction: EVENT_ACTION.CONNECTION;
|
|
91
91
|
attributes: {
|
|
92
92
|
documentAri: string;
|
|
@@ -94,7 +94,7 @@ declare type ConnectionFailureAnalyticsEvent = {
|
|
|
94
94
|
latency?: number;
|
|
95
95
|
};
|
|
96
96
|
};
|
|
97
|
-
|
|
97
|
+
type CatchUpSuccessAnalyticsEvent = {
|
|
98
98
|
eventAction: EVENT_ACTION.CATCHUP;
|
|
99
99
|
attributes: {
|
|
100
100
|
documentAri: string;
|
|
@@ -102,7 +102,7 @@ declare type CatchUpSuccessAnalyticsEvent = {
|
|
|
102
102
|
latency?: number;
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
|
-
|
|
105
|
+
type CatchUpFailureAnalyticsEvent = {
|
|
106
106
|
eventAction: EVENT_ACTION.CATCHUP;
|
|
107
107
|
attributes: {
|
|
108
108
|
documentAri: string;
|
|
@@ -110,7 +110,7 @@ declare type CatchUpFailureAnalyticsEvent = {
|
|
|
110
110
|
latency?: number;
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
|
-
|
|
113
|
+
type DocumentInitSuccessAnalyticsEvent = {
|
|
114
114
|
eventAction: EVENT_ACTION.DOCUMENT_INIT;
|
|
115
115
|
attributes: {
|
|
116
116
|
documentAri: string;
|
|
@@ -119,7 +119,7 @@ declare type DocumentInitSuccessAnalyticsEvent = {
|
|
|
119
119
|
resetReason?: string;
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
|
-
|
|
122
|
+
type UpdateParticipantsSuccessAnalyticsEvent = {
|
|
123
123
|
eventAction: EVENT_ACTION.UPDATE_PARTICIPANTS;
|
|
124
124
|
attributes: {
|
|
125
125
|
documentAri?: string;
|
|
@@ -127,7 +127,7 @@ declare type UpdateParticipantsSuccessAnalyticsEvent = {
|
|
|
127
127
|
participants: number;
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
|
-
|
|
130
|
+
type CommitUnconfirmedStepsSuccessAnalyticsEvent = {
|
|
131
131
|
eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS;
|
|
132
132
|
attributes: {
|
|
133
133
|
documentAri: string;
|
|
@@ -136,7 +136,7 @@ declare type CommitUnconfirmedStepsSuccessAnalyticsEvent = {
|
|
|
136
136
|
numUnconfirmedSteps?: number;
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
|
-
|
|
139
|
+
type CommitUnconfirmedStepsFailureAnalyticsEvent = {
|
|
140
140
|
eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS;
|
|
141
141
|
attributes: {
|
|
142
142
|
documentAri: string;
|
|
@@ -145,7 +145,7 @@ declare type CommitUnconfirmedStepsFailureAnalyticsEvent = {
|
|
|
145
145
|
numUnconfirmedSteps?: number;
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
|
-
|
|
148
|
+
type PublishPageSuccessAnalyticsEvent = {
|
|
149
149
|
eventAction: EVENT_ACTION.PUBLISH_PAGE;
|
|
150
150
|
attributes: {
|
|
151
151
|
documentAri: string;
|
|
@@ -153,7 +153,7 @@ declare type PublishPageSuccessAnalyticsEvent = {
|
|
|
153
153
|
latency?: number;
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
type PublishPageFailureAnalyticsEvent = {
|
|
157
157
|
eventAction: EVENT_ACTION.PUBLISH_PAGE;
|
|
158
158
|
attributes: {
|
|
159
159
|
documentAri: string;
|
|
@@ -161,7 +161,7 @@ declare type PublishPageFailureAnalyticsEvent = {
|
|
|
161
161
|
latency?: number;
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
|
-
|
|
164
|
+
type GetCurrentStateSuccessAnalyticsEvent = {
|
|
165
165
|
eventAction: EVENT_ACTION.GET_CURRENT_STATE;
|
|
166
166
|
attributes: {
|
|
167
167
|
documentAri: string;
|
|
@@ -169,7 +169,7 @@ declare type GetCurrentStateSuccessAnalyticsEvent = {
|
|
|
169
169
|
latency?: number;
|
|
170
170
|
};
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
type GetCurrentStateFailureAnalyticsEvent = {
|
|
173
173
|
eventAction: EVENT_ACTION.GET_CURRENT_STATE;
|
|
174
174
|
attributes: {
|
|
175
175
|
documentAri: string;
|
|
@@ -177,7 +177,7 @@ declare type GetCurrentStateFailureAnalyticsEvent = {
|
|
|
177
177
|
latency?: number;
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
|
-
export
|
|
180
|
+
export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent;
|
|
181
181
|
export declare const ACK_MAX_TRY = 30;
|
|
182
182
|
export declare const CONFLUENCE = "confluence";
|
|
183
183
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProductInformation } from '../types';
|
|
2
2
|
export declare const createLogger: (prefix: string, color?: string) => (msg: string, data?: any) => void;
|
|
3
3
|
export declare function sleep(ms: number): Promise<unknown>;
|
|
4
|
-
export declare const getProduct: (productInfo?: ProductInformation
|
|
5
|
-
export declare const getSubProduct: (productInfo?: ProductInformation
|
|
4
|
+
export declare const getProduct: (productInfo?: ProductInformation) => string;
|
|
5
|
+
export declare const getSubProduct: (productInfo?: ProductInformation) => string;
|
|
@@ -9,7 +9,7 @@ export declare class MetadataService {
|
|
|
9
9
|
/**
|
|
10
10
|
* Called when a metadata is changed externally from other clients/backend.
|
|
11
11
|
*/
|
|
12
|
-
onMetadataChanged: (metadata?: Metadata
|
|
12
|
+
onMetadataChanged: (metadata?: Metadata) => void;
|
|
13
13
|
setTitle(title: string, broadcast?: boolean): void;
|
|
14
14
|
setEditorWidth(editorWidth: string, broadcast?: boolean): void;
|
|
15
15
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { CollabEventPresenceData, CollabParticipant } from '@atlaskit/editor-common/collab';
|
|
2
2
|
import type { CollabEventTelepointerData, PresencePayload } from '../types';
|
|
3
3
|
export declare const PARTICIPANT_UPDATE_INTERVAL: number;
|
|
4
|
-
export
|
|
4
|
+
export type ProviderParticipant = CollabParticipant & {
|
|
5
5
|
userId: string;
|
|
6
6
|
clientId: number | string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
8
|
+
export type ParticipantsMap = Map<string, ProviderParticipant>;
|
|
9
|
+
export type PresenceEmit = (evt: 'presence', data: CollabEventPresenceData) => void;
|
|
10
|
+
export type TelepointerEmit = (evt: 'telepointer', data: CollabEventTelepointerData) => void;
|
|
11
|
+
export type GetUserType = ((userId: string) => Promise<Pick<ProviderParticipant, 'name' | 'avatar' | 'userId'>>) | undefined;
|
|
12
12
|
export declare const createParticipantFromPayload: (payload: PresencePayload & {
|
|
13
13
|
userId: string;
|
|
14
14
|
}, getUser: GetUserType) => Promise<ProviderParticipant>;
|
|
@@ -4,7 +4,7 @@ import type { Step as ProseMirrorStep } from 'prosemirror-transform';
|
|
|
4
4
|
import AnalyticsHelper from '../analytics/analytics-helper';
|
|
5
5
|
import type { InternalError } from '../errors/error-types';
|
|
6
6
|
export declare const commitStep: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, }: {
|
|
7
|
-
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], "timestamp">, callback?: Function
|
|
7
|
+
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], "timestamp">, callback?: Function) => void;
|
|
8
8
|
steps: readonly ProseMirrorStep[];
|
|
9
9
|
version: number;
|
|
10
10
|
userId: string;
|
|
@@ -14,7 +14,7 @@ export declare const commitStep: ({ broadcast, steps, version, userId, clientId,
|
|
|
14
14
|
analyticsHelper?: AnalyticsHelper | undefined;
|
|
15
15
|
}) => void;
|
|
16
16
|
export declare const throttledCommitStep: import("lodash").DebouncedFunc<({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, }: {
|
|
17
|
-
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], "timestamp">, callback?: Function
|
|
17
|
+
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], "timestamp">, callback?: Function) => void;
|
|
18
18
|
steps: readonly ProseMirrorStep[];
|
|
19
19
|
version: number;
|
|
20
20
|
userId: string;
|
|
@@ -5,7 +5,7 @@ import type { ResolvedEditorState } from '@atlaskit/editor-common/collab';
|
|
|
5
5
|
import type { CollabEditProvider, CollabEvents, CollabEventTelepointerData, Config, Metadata } from '../types';
|
|
6
6
|
import type { SyncUpErrorFunction } from '@atlaskit/editor-common/types';
|
|
7
7
|
export declare const MAX_STEP_REJECTED_ERROR = 15;
|
|
8
|
-
|
|
8
|
+
type BaseEvents = Pick<CollabEditProvider<CollabEvents>, 'setup' | 'send' | 'sendMessage'>;
|
|
9
9
|
export declare class Provider extends Emitter<CollabEvents> implements BaseEvents {
|
|
10
10
|
private channel;
|
|
11
11
|
private config;
|