@atlaskit/collab-provider 10.7.0 → 10.7.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,19 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 10.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 10.7.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#116044](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116044)
14
+ [`927dd6876fbca`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/927dd6876fbca) -
15
+ Fix obfuscated doc logging for onRestore
16
+
3
17
  ## 10.7.0
4
18
 
5
19
  ### Minor Changes
@@ -322,7 +322,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
322
322
  var obfuscatedDoc;
323
323
  if (currentState) {
324
324
  try {
325
- obfuscatedDoc = (0, _utils.getDocAdfWithObfuscation)(currentState.content);
325
+ obfuscatedDoc = (0, _utils.getDocAdfWithObfuscationFromJSON)(currentState.content);
326
326
  } catch (error) {
327
327
  obfuscatedDoc = 'Failed to obfuscate doc';
328
328
  }
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.isAIProviderID = exports.getSubProduct = exports.getStepsAdfWithObfuscation = exports.getStepUGCFreeDetails = exports.getStepTypes = exports.getStepPositions = exports.getProduct = exports.getObfuscatedSteps = exports.getDocAdfWithObfuscation = exports.createLogger = void 0;
7
+ exports.isAIProviderID = exports.getSubProduct = exports.getStepsAdfWithObfuscation = exports.getStepUGCFreeDetails = exports.getStepTypes = exports.getStepPositions = exports.getProduct = exports.getObfuscatedSteps = exports.getDocAdfWithObfuscationFromJSON = exports.getDocAdfWithObfuscation = exports.createLogger = void 0;
8
8
  exports.logObfuscatedSteps = logObfuscatedSteps;
9
9
  exports.sleep = sleep;
10
10
  exports.toObfuscatedSteps = toObfuscatedSteps;
@@ -138,6 +138,13 @@ var getDocAdfWithObfuscation = exports.getDocAdfWithObfuscation = function getDo
138
138
  }
139
139
  return scrubbedDoc;
140
140
  };
141
+ var getDocAdfWithObfuscationFromJSON = exports.getDocAdfWithObfuscationFromJSON = function getDocAdfWithObfuscationFromJSON(docJson) {
142
+ var scrubbedDoc = (0, _scrub.scrubAdf)(docJson);
143
+ if (!scrubbedDoc) {
144
+ return null;
145
+ }
146
+ return scrubbedDoc;
147
+ };
141
148
  var getStepPositions = exports.getStepPositions = function getStepPositions(stepJson) {
142
149
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, stepWithFromTo(stepJson) && {
143
150
  from: stepJson.from,
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/collab-provider";
8
- var version = exports.version = "10.7.0";
8
+ var version = exports.version = "10.7.2";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -6,7 +6,7 @@ import { JSONTransformer } from '@atlaskit/editor-json-transformer';
6
6
  import throttle from 'lodash/throttle';
7
7
  import { MEASURE_NAME, startMeasure, stopMeasure } from '../analytics/performance';
8
8
  import { INTERNAL_ERROR_CODE } from '../errors/internal-errors';
9
- import { createLogger, getDocAdfWithObfuscation, getObfuscatedSteps, getStepUGCFreeDetails, sleep } from '../helpers/utils';
9
+ import { createLogger, getDocAdfWithObfuscationFromJSON, getObfuscatedSteps, getStepUGCFreeDetails, sleep } from '../helpers/utils';
10
10
  import { MAX_STEP_REJECTED_ERROR, MAX_STEP_REJECTED_ERROR_AGGRESSIVE } from '../provider';
11
11
  import { commitStepQueue } from '../provider/commit-step';
12
12
  import { catchupv2 } from './catchupv2';
@@ -289,7 +289,7 @@ export class DocumentService {
289
289
  let obfuscatedDoc;
290
290
  if (currentState) {
291
291
  try {
292
- obfuscatedDoc = getDocAdfWithObfuscation(currentState.content);
292
+ obfuscatedDoc = getDocAdfWithObfuscationFromJSON(currentState.content);
293
293
  } catch (error) {
294
294
  obfuscatedDoc = 'Failed to obfuscate doc';
295
295
  }
@@ -112,6 +112,13 @@ export const getDocAdfWithObfuscation = doc => {
112
112
  }
113
113
  return scrubbedDoc;
114
114
  };
115
+ export const getDocAdfWithObfuscationFromJSON = docJson => {
116
+ const scrubbedDoc = scrubAdf(docJson);
117
+ if (!scrubbedDoc) {
118
+ return null;
119
+ }
120
+ return scrubbedDoc;
121
+ };
115
122
  export const getStepPositions = stepJson => {
116
123
  return {
117
124
  ...(stepWithFromTo(stepJson) && {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "10.7.0";
2
+ export const version = "10.7.2";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -12,7 +12,7 @@ import { JSONTransformer } from '@atlaskit/editor-json-transformer';
12
12
  import throttle from 'lodash/throttle';
13
13
  import { MEASURE_NAME, startMeasure, stopMeasure } from '../analytics/performance';
14
14
  import { INTERNAL_ERROR_CODE } from '../errors/internal-errors';
15
- import { createLogger, getDocAdfWithObfuscation, getObfuscatedSteps, getStepUGCFreeDetails, sleep } from '../helpers/utils';
15
+ import { createLogger, getDocAdfWithObfuscationFromJSON, getObfuscatedSteps, getStepUGCFreeDetails, sleep } from '../helpers/utils';
16
16
  import { MAX_STEP_REJECTED_ERROR, MAX_STEP_REJECTED_ERROR_AGGRESSIVE } from '../provider';
17
17
  import { commitStepQueue } from '../provider/commit-step';
18
18
  import { catchupv2 } from './catchupv2';
@@ -315,7 +315,7 @@ export var DocumentService = /*#__PURE__*/function () {
315
315
  var obfuscatedDoc;
316
316
  if (currentState) {
317
317
  try {
318
- obfuscatedDoc = getDocAdfWithObfuscation(currentState.content);
318
+ obfuscatedDoc = getDocAdfWithObfuscationFromJSON(currentState.content);
319
319
  } catch (error) {
320
320
  obfuscatedDoc = 'Failed to obfuscate doc';
321
321
  }
@@ -128,6 +128,13 @@ export var getDocAdfWithObfuscation = function getDocAdfWithObfuscation(doc) {
128
128
  }
129
129
  return scrubbedDoc;
130
130
  };
131
+ export var getDocAdfWithObfuscationFromJSON = function getDocAdfWithObfuscationFromJSON(docJson) {
132
+ var scrubbedDoc = scrubAdf(docJson);
133
+ if (!scrubbedDoc) {
134
+ return null;
135
+ }
136
+ return scrubbedDoc;
137
+ };
131
138
  export var getStepPositions = function getStepPositions(stepJson) {
132
139
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, stepWithFromTo(stepJson) && {
133
140
  from: stepJson.from,
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "10.7.0";
2
+ export var version = "10.7.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -5,6 +5,7 @@ import { CatchupEventReason } from '../helpers/const';
5
5
  import type { MetadataService } from '../metadata/metadata-service';
6
6
  import type { Catchupv2Response, ChannelEvent, ReconcileResponse, ReconnectionMetadata, StepsPayload } from '../types';
7
7
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
8
+ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
8
9
  import type { InternalError } from '../errors/internal-errors';
9
10
  import type { ParticipantsService } from '../participants/participants-service';
10
11
  import { type DocumentServiceInterface } from './interface-document-service';
@@ -80,7 +81,7 @@ export declare class DocumentService implements DocumentServiceInterface {
80
81
  * Called when we receive steps from the service
81
82
  */
82
83
  onStepsAdded: (data: StepsPayload) => void;
83
- obfuscateStepsAndState: (unconfirmedSteps: readonly ProseMirrorStep[] | undefined, currentState?: ResolvedEditorState) => {
84
+ obfuscateStepsAndState: (unconfirmedSteps: readonly ProseMirrorStep[] | undefined, currentState?: ResolvedEditorState<JSONDocNode>) => {
84
85
  obfuscatedSteps: string | {
85
86
  stepType: {
86
87
  type: string;
@@ -3,6 +3,7 @@ import type { ProductInformation } from '../types';
3
3
  import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
4
4
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { StepJson } from '@atlaskit/editor-common/collab';
6
+ import { type JSONDocNode } from '@atlaskit/editor-json-transformer';
6
7
  import { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
7
8
  import { CustomError } from '../errors/custom-errors';
8
9
  export declare const createLogger: (prefix: string, color?: string) => (msg: string, data?: any) => void;
@@ -22,6 +23,7 @@ export declare const getStepTypes: (stepJson: StepJson) => {
22
23
  };
23
24
  export declare const getStepsAdfWithObfuscation: (stepJson: StepJson) => ADFEntity[] | null;
24
25
  export declare const getDocAdfWithObfuscation: (doc: ProseMirrorNode) => ADFEntity | null;
26
+ export declare const getDocAdfWithObfuscationFromJSON: (docJson: JSONDocNode) => ADFEntity | null;
25
27
  export declare const getStepPositions: (stepJson: StepJson) => {
26
28
  pos?: number | undefined;
27
29
  insert?: number | undefined;
@@ -5,6 +5,7 @@ import { CatchupEventReason } from '../helpers/const';
5
5
  import type { MetadataService } from '../metadata/metadata-service';
6
6
  import type { Catchupv2Response, ChannelEvent, ReconcileResponse, ReconnectionMetadata, StepsPayload } from '../types';
7
7
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
8
+ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
8
9
  import type { InternalError } from '../errors/internal-errors';
9
10
  import type { ParticipantsService } from '../participants/participants-service';
10
11
  import { type DocumentServiceInterface } from './interface-document-service';
@@ -80,7 +81,7 @@ export declare class DocumentService implements DocumentServiceInterface {
80
81
  * Called when we receive steps from the service
81
82
  */
82
83
  onStepsAdded: (data: StepsPayload) => void;
83
- obfuscateStepsAndState: (unconfirmedSteps: readonly ProseMirrorStep[] | undefined, currentState?: ResolvedEditorState) => {
84
+ obfuscateStepsAndState: (unconfirmedSteps: readonly ProseMirrorStep[] | undefined, currentState?: ResolvedEditorState<JSONDocNode>) => {
84
85
  obfuscatedSteps: string | {
85
86
  stepType: {
86
87
  type: string;
@@ -3,6 +3,7 @@ import type { ProductInformation } from '../types';
3
3
  import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
4
4
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { StepJson } from '@atlaskit/editor-common/collab';
6
+ import { type JSONDocNode } from '@atlaskit/editor-json-transformer';
6
7
  import { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
7
8
  import { CustomError } from '../errors/custom-errors';
8
9
  export declare const createLogger: (prefix: string, color?: string) => (msg: string, data?: any) => void;
@@ -22,6 +23,7 @@ export declare const getStepTypes: (stepJson: StepJson) => {
22
23
  };
23
24
  export declare const getStepsAdfWithObfuscation: (stepJson: StepJson) => ADFEntity[] | null;
24
25
  export declare const getDocAdfWithObfuscation: (doc: ProseMirrorNode) => ADFEntity | null;
26
+ export declare const getDocAdfWithObfuscationFromJSON: (docJson: JSONDocNode) => ADFEntity | null;
25
27
  export declare const getStepPositions: (stepJson: StepJson) => {
26
28
  pos?: number | undefined;
27
29
  insert?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "10.7.0",
3
+ "version": "10.7.2",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,15 +34,15 @@
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-utils": "^19.18.0",
36
36
  "@atlaskit/analytics-gas-types": "^5.1.0",
37
- "@atlaskit/analytics-listeners": "^8.15.0",
38
- "@atlaskit/editor-common": "^99.17.0",
37
+ "@atlaskit/analytics-listeners": "^9.0.0",
38
+ "@atlaskit/editor-common": "^100.0.0",
39
39
  "@atlaskit/editor-json-transformer": "^8.23.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
41
  "@atlaskit/feature-gate-js-client": "^4.25.0",
42
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
43
  "@atlaskit/prosemirror-collab": "^0.14.0",
44
- "@atlaskit/react-ufo": "^2.16.0",
45
- "@atlaskit/ufo": "^0.3.0",
44
+ "@atlaskit/react-ufo": "^3.0.0",
45
+ "@atlaskit/ufo": "^0.4.0",
46
46
  "@atlaskit/util-service-support": "^6.2.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "eventemitter2": "^4.1.0",