@atlaskit/collab-provider 8.8.0 → 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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 8.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
8
+
9
+ ## 8.8.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`c0f3b955ee6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c0f3b955ee6) - remove the deprecated analytics field 'ttlEnabled'
14
+
3
15
  ## 8.8.0
4
16
 
5
17
  ### Minor Changes
@@ -151,8 +151,7 @@ var Channel = /*#__PURE__*/function (_Emitter) {
151
151
  // TODO: detect when document init fails and fire corresponding event for it
152
152
  _const.EVENT_STATUS.SUCCESS, {
153
153
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
154
- resetReason: data === null || data === void 0 ? void 0 : data.resetReason,
155
- ttlEnabled: data === null || data === void 0 ? void 0 : data.ttlEnabled
154
+ resetReason: data === null || data === void 0 ? void 0 : data.resetReason
156
155
  });
157
156
  var doc = data.doc,
158
157
  version = data.version,
@@ -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.0";
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('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -119,8 +119,7 @@ export class Channel extends Emitter {
119
119
  // TODO: detect when document init fails and fire corresponding event for it
120
120
  EVENT_STATUS.SUCCESS, {
121
121
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
122
- resetReason: data === null || data === void 0 ? void 0 : data.resetReason,
123
- ttlEnabled: data === null || data === void 0 ? void 0 : data.ttlEnabled
122
+ resetReason: data === null || data === void 0 ? void 0 : data.resetReason
124
123
  });
125
124
  const {
126
125
  doc,
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "8.8.0";
2
+ export const version = "8.8.2";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -144,8 +144,7 @@ export var Channel = /*#__PURE__*/function (_Emitter) {
144
144
  // TODO: detect when document init fails and fire corresponding event for it
145
145
  EVENT_STATUS.SUCCESS, {
146
146
  latency: measure === null || measure === void 0 ? void 0 : measure.duration,
147
- resetReason: data === null || data === void 0 ? void 0 : data.resetReason,
148
- ttlEnabled: data === null || data === void 0 ? void 0 : data.ttlEnabled
147
+ resetReason: data === null || data === void 0 ? void 0 : data.resetReason
149
148
  });
150
149
  var doc = data.doc,
151
150
  version = data.version,
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "8.8.0";
2
+ export var version = "8.8.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -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 | undefined) => void;
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
- declare type HeadVersionUpdateFailedError = {
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
- declare type VersionAlreadyPresentInDynamoError = {
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
- declare type InsufficientEditingPermissionError = {
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
- declare type ForbiddenUserTokenError = {
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
- declare type NCSDocumentNotFoundError = {
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
- declare type FailedToLoadInitDataError = {
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
- declare type ErrorMappingError = {
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
- declare type InvalidNamespaceDefinedError = {
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
- declare type SocketNamespaceNotFoundError = {
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
- declare type TenantInstanceMaintenanceError = {
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
- declare type NamespaceLockedError = {
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
- declare type EmptyBroadcastError = {
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
- declare type DynamoError = {
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
- declare type InvalidActivationIdError = {
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
- declare type InvalidDocumentAriError = {
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
- declare type InvalidCloudIdError = {
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
- declare type NCSErrors = HeadVersionUpdateFailedError | VersionAlreadyPresentInDynamoError | InsufficientEditingPermissionError | ForbiddenUserTokenError | NCSDocumentNotFoundError | FailedToLoadInitDataError | ErrorMappingError | InvalidNamespaceDefinedError | SocketNamespaceNotFoundError | TenantInstanceMaintenanceError | NamespaceLockedError | EmptyBroadcastError | DynamoError | InvalidActivationIdError | InvalidDocumentAriError | InvalidCloudIdError;
164
- declare type DocumentRecoveryError = {
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
- declare type AddStepsError = {
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 declare type CatchUpFailedError = {
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 declare type TokenPermissionError = {
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 declare type ReconnectionError = {
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 declare type ConnectionError = {
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 declare type ReconnectionNetworkError = {
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 declare type DocumentNotFoundError = {
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 declare type InternalError = NCSErrors | DocumentRecoveryError | AddStepsError | CatchUpFailedError | TokenPermissionError | ReconnectionError | ConnectionError | ReconnectionNetworkError | DocumentNotFoundError;
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
- declare type InsufficientEditingPermission = {
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
- declare type InvalidUserToken = {
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
- declare type DocumentNotFound = {
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
- declare type Locked = {
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
- declare type FailToSave = {
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
- declare type DocumentNotRestore = {
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
- declare type InitialisationError = {
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
- declare type NetworkIssue = {
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
- declare type InvalidProviderConfiguration = {
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
- declare type InternalServiceError = {
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 declare type ProviderError = InsufficientEditingPermission | InvalidUserToken | DocumentNotFound | Locked | FailToSave | DocumentNotRestore | InitialisationError | NetworkIssue | InvalidProviderConfiguration | InternalServiceError;
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 declare type RequiredNCSFeatureFlags = Record<keyof Required<NCSFeatureFlags>, boolean>;
8
- export declare type NCSFeatureFlagsMap = Record<keyof Required<NCSFeatureFlags>, string>;
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 declare type SupportedProduct = (typeof supportedProducts)[number];
11
- export declare type ProductKeys = Record<SupportedProduct, NCSFeatureFlagsMap>;
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 declare type ErrorAnalyticsEvent = {
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
- declare type InvalidateTokenAnalyticsEvent = {
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
- declare type AddStepsSuccessAnalyticsEvent = {
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
- declare type AddStepsFailureAnalyticsEvent = {
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
- declare type ReInitDocFailAnalyticsEvent = {
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
- declare type ReInitDocSuccessAnalyticsEvent = {
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
- declare type ConnectionSuccessAnalyticsEvent = {
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
- declare type ConnectionFailureAnalyticsEvent = {
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
- declare type CatchUpSuccessAnalyticsEvent = {
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
- declare type CatchUpFailureAnalyticsEvent = {
105
+ type CatchUpFailureAnalyticsEvent = {
106
106
  eventAction: EVENT_ACTION.CATCHUP;
107
107
  attributes: {
108
108
  documentAri: string;
@@ -110,17 +110,16 @@ declare type CatchUpFailureAnalyticsEvent = {
110
110
  latency?: number;
111
111
  };
112
112
  };
113
- declare type DocumentInitSuccessAnalyticsEvent = {
113
+ type DocumentInitSuccessAnalyticsEvent = {
114
114
  eventAction: EVENT_ACTION.DOCUMENT_INIT;
115
115
  attributes: {
116
116
  documentAri: string;
117
117
  eventStatus: EVENT_STATUS.SUCCESS;
118
118
  latency?: number;
119
119
  resetReason?: string;
120
- ttlEnabled?: boolean;
121
120
  };
122
121
  };
123
- declare type UpdateParticipantsSuccessAnalyticsEvent = {
122
+ type UpdateParticipantsSuccessAnalyticsEvent = {
124
123
  eventAction: EVENT_ACTION.UPDATE_PARTICIPANTS;
125
124
  attributes: {
126
125
  documentAri?: string;
@@ -128,7 +127,7 @@ declare type UpdateParticipantsSuccessAnalyticsEvent = {
128
127
  participants: number;
129
128
  };
130
129
  };
131
- declare type CommitUnconfirmedStepsSuccessAnalyticsEvent = {
130
+ type CommitUnconfirmedStepsSuccessAnalyticsEvent = {
132
131
  eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS;
133
132
  attributes: {
134
133
  documentAri: string;
@@ -137,7 +136,7 @@ declare type CommitUnconfirmedStepsSuccessAnalyticsEvent = {
137
136
  numUnconfirmedSteps?: number;
138
137
  };
139
138
  };
140
- declare type CommitUnconfirmedStepsFailureAnalyticsEvent = {
139
+ type CommitUnconfirmedStepsFailureAnalyticsEvent = {
141
140
  eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS;
142
141
  attributes: {
143
142
  documentAri: string;
@@ -146,7 +145,7 @@ declare type CommitUnconfirmedStepsFailureAnalyticsEvent = {
146
145
  numUnconfirmedSteps?: number;
147
146
  };
148
147
  };
149
- declare type PublishPageSuccessAnalyticsEvent = {
148
+ type PublishPageSuccessAnalyticsEvent = {
150
149
  eventAction: EVENT_ACTION.PUBLISH_PAGE;
151
150
  attributes: {
152
151
  documentAri: string;
@@ -154,7 +153,7 @@ declare type PublishPageSuccessAnalyticsEvent = {
154
153
  latency?: number;
155
154
  };
156
155
  };
157
- declare type PublishPageFailureAnalyticsEvent = {
156
+ type PublishPageFailureAnalyticsEvent = {
158
157
  eventAction: EVENT_ACTION.PUBLISH_PAGE;
159
158
  attributes: {
160
159
  documentAri: string;
@@ -162,7 +161,7 @@ declare type PublishPageFailureAnalyticsEvent = {
162
161
  latency?: number;
163
162
  };
164
163
  };
165
- declare type GetCurrentStateSuccessAnalyticsEvent = {
164
+ type GetCurrentStateSuccessAnalyticsEvent = {
166
165
  eventAction: EVENT_ACTION.GET_CURRENT_STATE;
167
166
  attributes: {
168
167
  documentAri: string;
@@ -170,7 +169,7 @@ declare type GetCurrentStateSuccessAnalyticsEvent = {
170
169
  latency?: number;
171
170
  };
172
171
  };
173
- declare type GetCurrentStateFailureAnalyticsEvent = {
172
+ type GetCurrentStateFailureAnalyticsEvent = {
174
173
  eventAction: EVENT_ACTION.GET_CURRENT_STATE;
175
174
  attributes: {
176
175
  documentAri: string;
@@ -178,7 +177,7 @@ declare type GetCurrentStateFailureAnalyticsEvent = {
178
177
  latency?: number;
179
178
  };
180
179
  };
181
- export declare type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent;
180
+ export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent;
182
181
  export declare const ACK_MAX_TRY = 30;
183
182
  export declare const CONFLUENCE = "confluence";
184
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 | undefined) => string;
5
- export declare const getSubProduct: (productInfo?: ProductInformation | undefined) => string;
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 | undefined) => void;
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 declare type ProviderParticipant = CollabParticipant & {
4
+ export type ProviderParticipant = CollabParticipant & {
5
5
  userId: string;
6
6
  clientId: number | string;
7
7
  };
8
- export declare type ParticipantsMap = Map<string, ProviderParticipant>;
9
- export declare type PresenceEmit = (evt: 'presence', data: CollabEventPresenceData) => void;
10
- export declare type TelepointerEmit = (evt: 'telepointer', data: CollabEventTelepointerData) => void;
11
- export declare type GetUserType = ((userId: string) => Promise<Pick<ProviderParticipant, 'name' | 'avatar' | 'userId'>>) | undefined;
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 | undefined) => void;
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 | undefined) => void;
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
- declare type BaseEvents = Pick<CollabEditProvider<CollabEvents>, 'setup' | 'send' | 'sendMessage'>;
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;
@@ -53,7 +53,7 @@ export interface InitAndAuthData {
53
53
  need404?: boolean;
54
54
  token?: string;
55
55
  }
56
- export declare type AuthCallback = (cb: (data: InitAndAuthData) => void) => void;
56
+ export type AuthCallback = (cb: (data: InitAndAuthData) => void) => void;
57
57
  interface SimpleEventEmitter {
58
58
  on(event: string, fn: Function): SimpleEventEmitter;
59
59
  }
@@ -64,13 +64,13 @@ export interface Socket extends SimpleEventEmitter {
64
64
  close(): Socket;
65
65
  io?: Manager;
66
66
  }
67
- export declare type LifecycleEvents = 'save' | 'restore';
68
- export declare type EventHandler = () => void;
67
+ export type LifecycleEvents = 'save' | 'restore';
68
+ export type EventHandler = () => void;
69
69
  export interface Lifecycle {
70
70
  on(event: LifecycleEvents, handler: EventHandler): void;
71
71
  }
72
- export declare type CollabConnectedPayload = CollabEventConnectionData;
73
- export declare type CollabConnectingPayload = CollabEventConnectingData;
72
+ export type CollabConnectedPayload = CollabEventConnectionData;
73
+ export type CollabConnectingPayload = CollabEventConnectingData;
74
74
  export interface CollabDisconnectedPayload {
75
75
  reason: DisconnectReason;
76
76
  sid: string;
@@ -78,7 +78,7 @@ export interface CollabDisconnectedPayload {
78
78
  /**
79
79
  * @deprecated Use ProviderError type instead
80
80
  */
81
- export declare type CollabErrorPayload = ProviderError;
81
+ export type CollabErrorPayload = ProviderError;
82
82
  export interface CollabInitPayload extends CollabEventInitData {
83
83
  doc: any;
84
84
  version: number;
@@ -90,10 +90,10 @@ export interface CollabDataPayload extends CollabEventRemoteData {
90
90
  json: StepJson[];
91
91
  userIds: (number | string)[];
92
92
  }
93
- export declare type CollabTelepointerPayload = CollabEventTelepointerData;
94
- export declare type CollabPresencePayload = CollabEventPresenceData;
95
- export declare type CollabMetadataPayload = Metadata;
96
- export declare type CollabLocalStepsPayload = {
93
+ export type CollabTelepointerPayload = CollabEventTelepointerData;
94
+ export type CollabPresencePayload = CollabEventPresenceData;
95
+ export type CollabMetadataPayload = Metadata;
96
+ export type CollabLocalStepsPayload = {
97
97
  steps: readonly Step[];
98
98
  };
99
99
  export interface CollabEvents {
@@ -112,7 +112,7 @@ export interface CollabEvents {
112
112
  export interface Metadata {
113
113
  [key: string]: string | number | boolean;
114
114
  }
115
- export declare type InitPayload = {
115
+ export type InitPayload = {
116
116
  doc: any;
117
117
  version: number;
118
118
  userId?: string;
@@ -124,27 +124,27 @@ export declare type InitPayload = {
124
124
  * @param {string} sessionId socket.id from NCS
125
125
  * @param data event specific data from NCS
126
126
  */
127
- export declare type BroadcastIncomingPayload = {
127
+ export type BroadcastIncomingPayload = {
128
128
  sessionId?: string;
129
129
  timestamp?: number;
130
130
  data: PresencePayload | TelepointerPayload | StepsPayload | any;
131
131
  };
132
- export declare type PresencePayload = {
132
+ export type PresencePayload = {
133
133
  sessionId: string;
134
134
  userId: string | undefined;
135
135
  clientId: number | string;
136
136
  timestamp: number;
137
137
  };
138
- export declare type TelepointerPayload = PresencePayload & {
138
+ export type TelepointerPayload = PresencePayload & {
139
139
  selection: CollabSendableSelection;
140
140
  };
141
- declare type MarkJson = {
141
+ type MarkJson = {
142
142
  type: string;
143
143
  attrs: {
144
144
  [key: string]: any;
145
145
  };
146
146
  };
147
- declare type NodeJson = {
147
+ type NodeJson = {
148
148
  type: string;
149
149
  attrs: {
150
150
  [key: string]: any;
@@ -153,12 +153,12 @@ declare type NodeJson = {
153
153
  marks: MarkJson[];
154
154
  text?: string;
155
155
  };
156
- declare type SliceJson = {
156
+ type SliceJson = {
157
157
  content: NodeJson[];
158
158
  openStart: number;
159
159
  openEnd: number;
160
160
  };
161
- export declare type StepJson = {
161
+ export type StepJson = {
162
162
  stepType?: string;
163
163
  from?: number;
164
164
  to?: number;
@@ -172,29 +172,29 @@ export declare enum AcknowledgementResponseTypes {
172
172
  SUCCESS = "SUCCESS",
173
173
  ERROR = "ERROR"
174
174
  }
175
- export declare type AcknowledgementSuccessPayload = {
175
+ export type AcknowledgementSuccessPayload = {
176
176
  type: AcknowledgementResponseTypes.SUCCESS;
177
177
  };
178
- export declare type AcknowledgementPayload = AcknowledgementSuccessPayload | AcknowledgementErrorPayload;
179
- export declare type AddStepAcknowledgementSuccessPayload = {
178
+ export type AcknowledgementPayload = AcknowledgementSuccessPayload | AcknowledgementErrorPayload;
179
+ export type AddStepAcknowledgementSuccessPayload = {
180
180
  type: AcknowledgementResponseTypes.SUCCESS;
181
181
  version: number;
182
182
  };
183
- export declare type AcknowledgementErrorPayload = {
183
+ export type AcknowledgementErrorPayload = {
184
184
  type: AcknowledgementResponseTypes.ERROR;
185
185
  error: InternalError;
186
186
  };
187
- export declare type AddStepAcknowledgementPayload = AddStepAcknowledgementSuccessPayload | AcknowledgementErrorPayload;
188
- export declare type StepsPayload = {
187
+ export type AddStepAcknowledgementPayload = AddStepAcknowledgementSuccessPayload | AcknowledgementErrorPayload;
188
+ export type StepsPayload = {
189
189
  version: number;
190
190
  steps: StepJson[];
191
191
  };
192
- export declare type NamespaceStatus = {
192
+ export type NamespaceStatus = {
193
193
  isLocked: boolean;
194
194
  timestamp: number;
195
195
  waitTimeInMs?: number;
196
196
  };
197
- export declare type ChannelEvent = {
197
+ export type ChannelEvent = {
198
198
  connected: {
199
199
  sid: string;
200
200
  initialized: boolean;
@@ -233,7 +233,7 @@ export interface CatchupOptions {
233
233
  updateDocument: ({ doc, version, metadata, reserveCursor, }: CollabInitPayload) => void;
234
234
  updateMetadata: (metadata: Metadata | undefined) => void;
235
235
  }
236
- export declare type ProductInformation = {
236
+ export type ProductInformation = {
237
237
  product: string;
238
238
  subProduct?: string;
239
239
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,14 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.5 <4.9": {
17
+ "*": [
18
+ "dist/types-ts4.5/*",
19
+ "dist/types-ts4.5/index.d.ts"
20
+ ]
21
+ }
22
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.ts",
17
25
  "atlassian": {
@@ -56,13 +64,13 @@
56
64
  "devDependencies": {
57
65
  "@atlaskit/adf-schema": "^25.6.0",
58
66
  "@atlaskit/analytics-listeners": "^8.7.0",
59
- "@atlaskit/editor-test-helpers": "^18.2.0",
67
+ "@atlaskit/editor-test-helpers": "^18.3.0",
60
68
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
61
69
  "@types/prosemirror-model": "^1.11.0",
62
70
  "@types/prosemirror-state": "^1.2.0",
63
71
  "prosemirror-model": "1.14.3",
64
72
  "prosemirror-state": "1.3.4",
65
- "typescript": "4.5.5"
73
+ "typescript": "~4.9.5"
66
74
  },
67
75
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
68
76
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/socket-io-provider.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/socket-io-provider.d.ts"
11
+ "../dist/types-ts4.5/socket-io-provider.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/types.d.ts"
11
+ "../dist/types-ts4.5/types.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/version-wrapper.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/version-wrapper.d.ts"
11
+ "../dist/types-ts4.5/version-wrapper.d.ts"
12
12
  ]
13
13
  }
14
14
  }