@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.
@@ -37,29 +37,29 @@ export declare enum ADD_STEPS_TYPE {
37
37
  ERROR = "ERROR"
38
38
  }
39
39
  export type DocumentUpdateErrorAttributes = {
40
- isDocTruthy?: boolean;
41
- editorVersion?: number;
42
- newVersion?: number;
40
+ caller?: string;
43
41
  docHasContent?: boolean;
42
+ editorVersion?: number;
44
43
  isDocContentValid?: boolean;
45
- caller?: string;
44
+ isDocTruthy?: boolean;
45
+ newVersion?: number;
46
46
  };
47
47
  export type CantSyncUpErrorAttributes = {
48
48
  unconfirmedStepsInfo: string;
49
49
  };
50
50
  export type ErrorAnalyticsEvent = {
51
- eventAction: EVENT_ACTION.ERROR;
52
51
  attributes: {
52
+ documentAri?: string;
53
+ errorCode?: string;
53
54
  errorMessage: string;
54
- originalErrorMessage: string | undefined;
55
55
  errorName?: string;
56
- errorCode?: string;
57
- errorStatus?: string;
58
56
  errorStack?: string;
59
- documentAri?: string;
57
+ errorStatus?: string;
60
58
  mappedError?: ProviderError;
59
+ originalErrorMessage: string | undefined;
61
60
  subProduct?: string;
62
61
  } & DocumentUpdateErrorAttributes;
62
+ eventAction: EVENT_ACTION.ERROR;
63
63
  nonPrivacySafeAttributes?: {
64
64
  error: unknown;
65
65
  };
@@ -69,247 +69,247 @@ export type BaseActionAnalyticsEventAttributes = {
69
69
  subProduct?: string;
70
70
  };
71
71
  type InvalidateTokenAnalyticsEvent = {
72
- eventAction: EVENT_ACTION.INVALIDATE_TOKEN;
73
72
  attributes: {
74
73
  eventStatus: EVENT_STATUS.SUCCESS;
75
74
  reason?: string;
76
75
  usedCachedToken?: boolean;
77
76
  } & BaseActionAnalyticsEventAttributes;
77
+ eventAction: EVENT_ACTION.INVALIDATE_TOKEN;
78
78
  };
79
79
  type AddStepsSuccessAnalyticsEvent = {
80
- eventAction: EVENT_ACTION.ADD_STEPS;
81
80
  attributes: {
82
81
  eventStatus: EVENT_STATUS.SUCCESS;
83
- type: ADD_STEPS_TYPE.ACCEPTED;
84
82
  latency?: number;
85
83
  stepType?: {
86
84
  [key: string]: number;
87
85
  };
86
+ type: ADD_STEPS_TYPE.ACCEPTED;
88
87
  } & BaseActionAnalyticsEventAttributes;
88
+ eventAction: EVENT_ACTION.ADD_STEPS;
89
89
  };
90
90
  type AddStepsFailureAnalyticsEvent = {
91
- eventAction: EVENT_ACTION.ADD_STEPS;
92
91
  attributes: {
93
92
  eventStatus: EVENT_STATUS.FAILURE;
94
- type: ADD_STEPS_TYPE.REJECTED | ADD_STEPS_TYPE.ERROR;
95
93
  latency?: number;
94
+ type: ADD_STEPS_TYPE.REJECTED | ADD_STEPS_TYPE.ERROR;
96
95
  } & BaseActionAnalyticsEventAttributes;
96
+ eventAction: EVENT_ACTION.ADD_STEPS;
97
97
  };
98
98
  type ReInitDocFailAnalyticsEvent = {
99
- eventAction: EVENT_ACTION.REINITIALISE_DOCUMENT;
100
99
  attributes: {
101
100
  eventStatus: EVENT_STATUS.FAILURE;
102
101
  numUnconfirmedSteps: number;
103
102
  triggeredByCatchup?: boolean;
104
103
  } & BaseActionAnalyticsEventAttributes;
104
+ eventAction: EVENT_ACTION.REINITIALISE_DOCUMENT;
105
105
  };
106
106
  type ReInitDocSuccessAnalyticsEvent = {
107
- eventAction: EVENT_ACTION.REINITIALISE_DOCUMENT;
108
107
  attributes: {
109
108
  eventStatus: EVENT_STATUS.SUCCESS;
110
109
  numUnconfirmedSteps: number;
111
110
  triggeredByCatchup?: boolean;
112
111
  } & BaseActionAnalyticsEventAttributes;
112
+ eventAction: EVENT_ACTION.REINITIALISE_DOCUMENT;
113
113
  };
114
114
  type ConnectionSuccessAnalyticsEvent = {
115
- eventAction: EVENT_ACTION.CONNECTION;
116
115
  attributes: {
117
116
  eventStatus: EVENT_STATUS.SUCCESS;
118
117
  latency?: number;
119
118
  } & BaseActionAnalyticsEventAttributes;
119
+ eventAction: EVENT_ACTION.CONNECTION;
120
120
  };
121
121
  type ConnectionFailureAnalyticsEvent = {
122
- eventAction: EVENT_ACTION.CONNECTION;
123
122
  attributes: {
124
123
  eventStatus: EVENT_STATUS.FAILURE;
125
124
  latency?: number;
126
125
  } & BaseActionAnalyticsEventAttributes;
126
+ eventAction: EVENT_ACTION.CONNECTION;
127
127
  };
128
128
  type CatchUpSuccessAnalyticsEvent = {
129
- eventAction: EVENT_ACTION.CATCHUP;
130
129
  attributes: {
131
130
  eventStatus: EVENT_STATUS.SUCCESS;
132
131
  latency?: number;
133
132
  } & BaseActionAnalyticsEventAttributes;
133
+ eventAction: EVENT_ACTION.CATCHUP;
134
134
  };
135
135
  type CatchUpFailureAnalyticsEvent = {
136
- eventAction: EVENT_ACTION.CATCHUP;
137
136
  attributes: {
138
137
  eventStatus: EVENT_STATUS.FAILURE;
139
138
  latency?: number;
140
139
  } & BaseActionAnalyticsEventAttributes;
140
+ eventAction: EVENT_ACTION.CATCHUP;
141
141
  };
142
142
  type CatchUpDroppedStepsEvent = {
143
- eventAction: EVENT_ACTION.DROPPED_STEPS;
144
143
  attributes: {
145
144
  numOfDroppedSteps: number;
146
145
  } & BaseActionAnalyticsEventAttributes;
146
+ eventAction: EVENT_ACTION.DROPPED_STEPS;
147
147
  };
148
148
  type DocumentInitSuccessAnalyticsEvent = {
149
- eventAction: EVENT_ACTION.DOCUMENT_INIT;
150
149
  attributes: {
151
150
  eventStatus: EVENT_STATUS.SUCCESS;
151
+ hasTitle: boolean;
152
152
  latency?: number;
153
153
  resetReason?: string;
154
- hasTitle: boolean;
155
154
  } & BaseActionAnalyticsEventAttributes;
155
+ eventAction: EVENT_ACTION.DOCUMENT_INIT;
156
156
  };
157
157
  type UpdateParticipantsSuccessAnalyticsEvent = {
158
- eventAction: EVENT_ACTION.UPDATE_PARTICIPANTS;
159
158
  attributes: {
160
159
  eventStatus: EVENT_STATUS.SUCCESS;
161
160
  participants: number;
162
161
  } & BaseActionAnalyticsEventAttributes;
162
+ eventAction: EVENT_ACTION.UPDATE_PARTICIPANTS;
163
163
  };
164
164
  type CommitUnconfirmedStepsSuccessAnalyticsEvent = {
165
- eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS;
166
165
  attributes: {
167
166
  eventStatus: EVENT_STATUS.SUCCESS;
168
167
  latency?: number;
169
168
  numUnconfirmedSteps?: number;
170
169
  } & BaseActionAnalyticsEventAttributes;
170
+ eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS;
171
171
  };
172
172
  type CommitUnconfirmedStepsFailureAnalyticsEvent = {
173
- eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS;
174
173
  attributes: {
175
174
  eventStatus: EVENT_STATUS.FAILURE;
176
175
  latency?: number;
177
176
  numUnconfirmedSteps?: number;
178
177
  } & BaseActionAnalyticsEventAttributes;
178
+ eventAction: EVENT_ACTION.COMMIT_UNCONFIRMED_STEPS;
179
179
  };
180
180
  type PublishPageSuccessAnalyticsEvent = {
181
- eventAction: EVENT_ACTION.PUBLISH_PAGE;
182
181
  attributes: {
183
182
  eventStatus: EVENT_STATUS.SUCCESS;
184
183
  latency?: number;
185
184
  } & BaseActionAnalyticsEventAttributes;
185
+ eventAction: EVENT_ACTION.PUBLISH_PAGE;
186
186
  };
187
187
  type PublishPageFailureAnalyticsEvent = {
188
- eventAction: EVENT_ACTION.PUBLISH_PAGE;
189
188
  attributes: {
190
189
  eventStatus: EVENT_STATUS.FAILURE;
191
190
  latency?: number;
192
191
  } & BaseActionAnalyticsEventAttributes;
192
+ eventAction: EVENT_ACTION.PUBLISH_PAGE;
193
193
  };
194
194
  type GetCurrentStateSuccessAnalyticsEvent = {
195
- eventAction: EVENT_ACTION.GET_CURRENT_STATE;
196
195
  attributes: {
197
196
  eventStatus: EVENT_STATUS.SUCCESS;
198
197
  latency?: number;
199
198
  } & BaseActionAnalyticsEventAttributes;
199
+ eventAction: EVENT_ACTION.GET_CURRENT_STATE;
200
200
  };
201
201
  type GetCurrentStateFailureAnalyticsEvent = {
202
- eventAction: EVENT_ACTION.GET_CURRENT_STATE;
203
202
  attributes: {
204
203
  eventStatus: EVENT_STATUS.FAILURE;
205
204
  latency?: number;
206
205
  } & BaseActionAnalyticsEventAttributes;
206
+ eventAction: EVENT_ACTION.GET_CURRENT_STATE;
207
207
  };
208
208
  type SendStepsRetryAnalyticsEvent = {
209
- eventAction: EVENT_ACTION.SEND_STEPS_RETRY;
210
209
  attributes: {
211
- eventStatus: EVENT_STATUS.INFO;
212
210
  count: number;
211
+ eventStatus: EVENT_STATUS.INFO;
213
212
  } & BaseActionAnalyticsEventAttributes;
213
+ eventAction: EVENT_ACTION.SEND_STEPS_RETRY;
214
214
  };
215
215
  type CatchupAfterMaxSendStepsRetryAnalyticsEvent = {
216
- eventAction: EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY;
217
216
  attributes: {
218
217
  eventStatus: EVENT_STATUS.INFO;
219
218
  } & BaseActionAnalyticsEventAttributes;
219
+ eventAction: EVENT_ACTION.CATCHUP_AFTER_MAX_SEND_STEPS_RETRY;
220
220
  };
221
221
  type WebsocketMessageVolumeMetricEvent = {
222
- eventAction: EVENT_ACTION.WEBSOCKET_MESSAGE_VOLUME_METRIC;
223
222
  attributes: {
224
223
  eventStatus: EVENT_STATUS.INFO;
225
224
  messageCount: number;
226
225
  messageSize: number;
227
226
  } & BaseActionAnalyticsEventAttributes;
227
+ eventAction: EVENT_ACTION.WEBSOCKET_MESSAGE_VOLUME_METRIC;
228
228
  };
229
229
  type ProviderInitializedAnalyticsEvent = {
230
- eventAction: EVENT_ACTION.PROVIDER_INITIALIZED;
231
230
  attributes: {
232
231
  eventStatus: EVENT_STATUS.INFO;
233
- isPreinitializing: boolean;
234
232
  isBuffered?: boolean;
233
+ isPreinitializing: boolean;
235
234
  } & BaseActionAnalyticsEventAttributes;
235
+ eventAction: EVENT_ACTION.PROVIDER_INITIALIZED;
236
236
  };
237
237
  type ProviderSetupAnalyticsEvent = {
238
- eventAction: EVENT_ACTION.PROVIDER_SETUP;
239
238
  attributes: {
240
239
  eventStatus: EVENT_STATUS.INFO;
241
- isPreinitializing: boolean;
242
240
  hasState: boolean;
241
+ isPreinitializing: boolean;
243
242
  } & BaseActionAnalyticsEventAttributes;
243
+ eventAction: EVENT_ACTION.PROVIDER_SETUP;
244
244
  };
245
245
  type ProviderHasUnconfirmedStepsAnalyticsEvent = {
246
- eventAction: EVENT_ACTION.HAS_UNCONFIRMED_STEPS;
247
246
  attributes: {
248
247
  numUnconfirmedSteps: number;
249
248
  } & BaseActionAnalyticsEventAttributes;
249
+ eventAction: EVENT_ACTION.HAS_UNCONFIRMED_STEPS;
250
250
  };
251
251
  type UpdateDocumentAnalyticsEvent = {
252
- eventAction: EVENT_ACTION.UPDATE_DOCUMENT;
253
252
  attributes: {
254
- eventStatus: EVENT_STATUS.SUCCESS;
255
- newVersion: number;
256
- editorVersion: number;
257
- isDocTruthy: boolean;
258
253
  docHasContent: boolean;
254
+ editorVersion: number;
255
+ eventStatus: EVENT_STATUS.SUCCESS;
259
256
  isDocContentValid: boolean;
257
+ isDocTruthy: boolean;
258
+ newVersion: number;
260
259
  } & BaseActionAnalyticsEventAttributes;
260
+ eventAction: EVENT_ACTION.UPDATE_DOCUMENT;
261
261
  };
262
262
  type ReconnectionAnalyticsEvent = {
263
- eventAction: EVENT_ACTION.RECONNECTION;
264
263
  attributes: {
265
- eventStatus: EVENT_STATUS.SUCCESS;
266
264
  disconnectionPeriodSeconds: number;
265
+ eventStatus: EVENT_STATUS.SUCCESS;
267
266
  } & BaseActionAnalyticsEventAttributes;
267
+ eventAction: EVENT_ACTION.RECONNECTION;
268
268
  };
269
269
  type OutOfSyncAnalyticsEvent = {
270
- eventAction: EVENT_ACTION.OUT_OF_SYNC;
271
270
  attributes: {
271
+ catchupReason: CatchupEventReason | undefined;
272
272
  eventStatus: EVENT_STATUS.FAILURE;
273
- obfuscatedSteps: {
274
- [key: string]: number;
275
- }[];
276
273
  obfuscatedDoc: {
277
274
  [key: string]: number;
278
275
  };
279
- catchupReason: CatchupEventReason | undefined;
276
+ obfuscatedSteps: {
277
+ [key: string]: number;
278
+ }[];
280
279
  } & BaseActionAnalyticsEventAttributes;
280
+ eventAction: EVENT_ACTION.OUT_OF_SYNC;
281
281
  };
282
282
  type StepsRebasedAnalyticsEvent = {
283
- eventAction: EVENT_ACTION.STEPS_REBASED;
284
283
  attributes: {
284
+ clientID: 'string';
285
285
  eventStatus: EVENT_STATUS.INFO;
286
- obfuscatedUnconfirmedSteps: {
286
+ obfuscatedRebasedSteps: {
287
287
  [key: string]: number;
288
288
  }[];
289
289
  obfuscatedRemoteSteps: {
290
290
  [key: string]: number;
291
291
  }[];
292
- obfuscatedRebasedSteps: {
292
+ obfuscatedUnconfirmedSteps: {
293
293
  [key: string]: number;
294
294
  }[];
295
- clientID: 'string';
296
295
  userId: 'string';
297
- versionBefore: 'string';
298
296
  versionAfter: 'string';
297
+ versionBefore: 'string';
299
298
  } & BaseActionAnalyticsEventAttributes;
299
+ eventAction: EVENT_ACTION.STEPS_REBASED;
300
300
  };
301
301
  type PollingFallbackAnalyticsEvent = {
302
- eventAction: EVENT_ACTION.POLLING_FALLBACK;
303
302
  attributes: {
304
303
  eventStatus: EVENT_STATUS.INFO;
305
304
  url: 'string';
306
305
  } & BaseActionAnalyticsEventAttributes;
306
+ eventAction: EVENT_ACTION.POLLING_FALLBACK;
307
307
  };
308
308
  type ProcessStepsAnalyticsEvent = {
309
- eventAction: EVENT_ACTION.PROCESS_STEPS;
310
309
  attributes: {
311
310
  eventStatus: EVENT_STATUS.SUCCESS;
312
311
  } & BaseActionAnalyticsEventAttributes;
312
+ eventAction: EVENT_ACTION.PROCESS_STEPS;
313
313
  };
314
314
  export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent | SendStepsRetryAnalyticsEvent | CatchupAfterMaxSendStepsRetryAnalyticsEvent | CatchUpDroppedStepsEvent | WebsocketMessageVolumeMetricEvent | ProviderInitializedAnalyticsEvent | ProviderSetupAnalyticsEvent | ProviderHasUnconfirmedStepsAnalyticsEvent | UpdateDocumentAnalyticsEvent | ReconnectionAnalyticsEvent | OutOfSyncAnalyticsEvent | StepsRebasedAnalyticsEvent | PollingFallbackAnalyticsEvent | ProcessStepsAnalyticsEvent;
315
315
  export declare const ACK_MAX_TRY = 60;
@@ -12,9 +12,9 @@ export declare const isAIProviderID: (id: string) => boolean;
12
12
  export declare const getProduct: (productInfo?: ProductInformation) => string;
13
13
  export declare const getSubProduct: (productInfo?: ProductInformation) => string;
14
14
  export type UGCFreeStepDetails = {
15
- type: string;
16
15
  contentTypes: string;
17
16
  stepSizeInBytes?: number;
17
+ type: string;
18
18
  };
19
19
  export declare const getStepUGCFreeDetails: (step: ProseMirrorStep) => UGCFreeStepDetails;
20
20
  export declare const getStepTypes: (stepJson: StepJson) => {
@@ -47,13 +47,13 @@ export declare const getObfuscatedSteps: (steps: StepJson[], endIndex?: number |
47
47
  to?: number | undefined;
48
48
  };
49
49
  stepMetadata: {
50
- source?: string;
51
- stepId?: string;
52
50
  prevStepId?: string;
53
51
  rebased?: boolean;
54
- traceId?: string;
55
52
  reqId?: string;
56
53
  schemaVersion?: string;
54
+ source?: string;
55
+ stepId?: string;
56
+ traceId?: string;
57
57
  unconfirmedStepAfterRecovery?: boolean;
58
58
  } | undefined;
59
59
  }[];
@@ -50,12 +50,12 @@ export declare class ParticipantsService {
50
50
  constructor(analyticsHelper: AnalyticsHelper | undefined, participantsState: ParticipantsState | undefined, emit: (evt: 'presence' | 'telepointer' | 'disconnected' | 'presence:changed', data: CollabEventPresenceData | CollabTelepointerPayload | CollabEventDisconnectedData | CollabPresenceActivityChangePayload) => void, getUser: GetUserType, batchProps: BatchProps | undefined, channelBroadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], 'timestamp'>, callback?: Function) => void, sendPresenceJoined: () => void, getPresenceData: () => PresenceData, setUserId: (id: string) => void, getAIProviderActiveIds?: (() => string[]) | undefined, fetchAnonymousAsset?: FetchAnonymousAsset | undefined);
51
51
  sendPresenceActivityChanged: () => void;
52
52
  sendAIProviderChanged: (payload: {
53
- userId: string;
54
- sessionId: string;
55
- clientId: string | number;
56
- providerId?: string;
57
53
  action: "add" | "remove";
54
+ clientId: string | number;
58
55
  permit?: UserPermitType;
56
+ providerId?: string;
57
+ sessionId: string;
58
+ userId: string;
59
59
  }) => void;
60
60
  private buildAIProviderPresencePayload;
61
61
  private sendAIProviderParticipantUpdated;
@@ -21,16 +21,16 @@ export declare class CommitStepService {
21
21
  */
22
22
  constructor(broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], 'timestamp'>, callback?: Function) => void, analyticsHelper: AnalyticsHelper | undefined, emit: (evt: keyof CollabEvents, data: any) => void, onErrorHandled: (error: InternalError) => void);
23
23
  commitStepQueue({ steps, version, userId, clientId, onStepsAdded, __livePage, hasRecovered, collabMode, reason, lockSteps, }: {
24
- steps: readonly ProseMirrorStep[];
25
- version: number;
26
- userId: string;
27
- clientId: number | string;
28
- onStepsAdded: (data: StepsPayload) => void;
29
24
  __livePage: boolean;
30
- hasRecovered: boolean;
25
+ clientId: number | string;
31
26
  collabMode: string;
32
- reason?: GetResolvedEditorStateReason;
27
+ hasRecovered: boolean;
33
28
  lockSteps: (stepOrigins?: readonly Transaction[]) => void;
29
+ onStepsAdded: (data: StepsPayload) => void;
30
+ reason?: GetResolvedEditorStateReason;
31
+ steps: readonly ProseMirrorStep[];
32
+ userId: string;
33
+ version: number;
34
34
  }): void;
35
35
  private isExpandChangeStep;
36
36
  private sendSuccessAnalytics;
@@ -67,8 +67,8 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
67
67
  * @throws {ProviderInitialisationError} Something went wrong during provider initialisation
68
68
  */
69
69
  setup({ getState, editorApi, onSyncUpError, }: {
70
- getState: () => EditorState;
71
70
  editorApi?: any;
71
+ getState: () => EditorState;
72
72
  onSyncUpError?: SyncUpErrorFunction;
73
73
  }): this;
74
74
  setupForPresenceOnly(clientId: string): this;