@fluidframework/debugger 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419

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.
Files changed (110) hide show
  1. package/.eslintrc.js +9 -10
  2. package/CHANGELOG.md +117 -0
  3. package/README.md +33 -33
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/debugger.api.md +157 -0
  7. package/dist/debugger-alpha.d.ts +36 -0
  8. package/dist/debugger-beta.d.ts +35 -0
  9. package/dist/debugger-public.d.ts +35 -0
  10. package/dist/debugger-untrimmed.d.ts +193 -0
  11. package/dist/{fluidDebugger.js → fluidDebugger.cjs} +12 -4
  12. package/dist/fluidDebugger.cjs.map +1 -0
  13. package/dist/fluidDebugger.d.ts +8 -2
  14. package/dist/fluidDebugger.d.ts.map +1 -1
  15. package/dist/{fluidDebuggerController.js → fluidDebuggerController.cjs} +29 -56
  16. package/dist/fluidDebuggerController.cjs.map +1 -0
  17. package/dist/fluidDebuggerController.d.ts +6 -2
  18. package/dist/fluidDebuggerController.d.ts.map +1 -1
  19. package/dist/{fluidDebuggerUi.js → fluidDebuggerUi.cjs} +45 -50
  20. package/dist/fluidDebuggerUi.cjs.map +1 -0
  21. package/dist/fluidDebuggerUi.d.ts +9 -0
  22. package/dist/fluidDebuggerUi.d.ts.map +1 -1
  23. package/dist/index.cjs +14 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/{messageSchema.js → messageSchema.cjs} +1 -12
  28. package/dist/messageSchema.cjs.map +1 -0
  29. package/dist/messageSchema.d.ts.map +1 -1
  30. package/dist/{sanitize.js → sanitize.cjs} +2 -2
  31. package/dist/sanitize.cjs.map +1 -0
  32. package/dist/{sanitizer.js → sanitizer.cjs} +29 -34
  33. package/dist/sanitizer.cjs.map +1 -0
  34. package/dist/sanitizer.d.ts.map +1 -1
  35. package/dist/tsdoc-metadata.json +11 -0
  36. package/lib/debugger-alpha.d.mts +36 -0
  37. package/lib/debugger-beta.d.mts +35 -0
  38. package/lib/debugger-public.d.mts +35 -0
  39. package/lib/debugger-untrimmed.d.mts +193 -0
  40. package/lib/{fluidDebugger.d.ts → fluidDebugger.d.mts} +8 -2
  41. package/lib/fluidDebugger.d.mts.map +1 -0
  42. package/lib/{fluidDebugger.js → fluidDebugger.mjs} +11 -3
  43. package/lib/fluidDebugger.mjs.map +1 -0
  44. package/lib/{fluidDebuggerController.d.ts → fluidDebuggerController.d.mts} +7 -3
  45. package/lib/fluidDebuggerController.d.mts.map +1 -0
  46. package/lib/{fluidDebuggerController.js → fluidDebuggerController.mjs} +20 -47
  47. package/lib/fluidDebuggerController.mjs.map +1 -0
  48. package/lib/{fluidDebuggerUi.d.ts → fluidDebuggerUi.d.mts} +9 -0
  49. package/lib/fluidDebuggerUi.d.mts.map +1 -0
  50. package/lib/{fluidDebuggerUi.js → fluidDebuggerUi.mjs} +44 -49
  51. package/lib/fluidDebuggerUi.mjs.map +1 -0
  52. package/lib/index.d.mts +8 -0
  53. package/lib/index.d.mts.map +1 -0
  54. package/lib/index.mjs +8 -0
  55. package/lib/index.mjs.map +1 -0
  56. package/lib/messageSchema.d.mts.map +1 -0
  57. package/lib/{messageSchema.js → messageSchema.mjs} +1 -12
  58. package/lib/messageSchema.mjs.map +1 -0
  59. package/lib/{sanitize.js → sanitize.mjs} +2 -16
  60. package/lib/sanitize.mjs.map +1 -0
  61. package/lib/{sanitizer.d.ts → sanitizer.d.mts} +0 -14
  62. package/lib/sanitizer.d.mts.map +1 -0
  63. package/lib/{sanitizer.js → sanitizer.mjs} +19 -42
  64. package/lib/sanitizer.mjs.map +1 -0
  65. package/lib/test/types/validateDebuggerPrevious.generated.d.mts +2 -0
  66. package/lib/test/types/validateDebuggerPrevious.generated.d.mts.map +1 -0
  67. package/lib/test/types/{validateDebuggerPrevious.js → validateDebuggerPrevious.generated.mjs} +5 -5
  68. package/lib/test/types/validateDebuggerPrevious.generated.mjs.map +1 -0
  69. package/package.json +76 -44
  70. package/prettier.config.cjs +8 -0
  71. package/src/fluidDebugger.ts +38 -30
  72. package/src/fluidDebuggerController.ts +353 -323
  73. package/src/fluidDebuggerUi.ts +316 -293
  74. package/src/index.ts +3 -3
  75. package/src/messageSchema.ts +356 -367
  76. package/src/sanitize.ts +29 -29
  77. package/src/sanitizer.ts +702 -651
  78. package/tsconfig.json +13 -15
  79. package/dist/fluidDebugger.js.map +0 -1
  80. package/dist/fluidDebuggerController.js.map +0 -1
  81. package/dist/fluidDebuggerUi.js.map +0 -1
  82. package/dist/index.js +0 -20
  83. package/dist/index.js.map +0 -1
  84. package/dist/messageSchema.js.map +0 -1
  85. package/dist/sanitize.js.map +0 -1
  86. package/dist/sanitizer.js.map +0 -1
  87. package/images/Screenshot1.jpg +0 -0
  88. package/images/Screenshot2.jpg +0 -0
  89. package/lib/fluidDebugger.d.ts.map +0 -1
  90. package/lib/fluidDebugger.js.map +0 -1
  91. package/lib/fluidDebuggerController.d.ts.map +0 -1
  92. package/lib/fluidDebuggerController.js.map +0 -1
  93. package/lib/fluidDebuggerUi.d.ts.map +0 -1
  94. package/lib/fluidDebuggerUi.js.map +0 -1
  95. package/lib/index.d.ts +0 -8
  96. package/lib/index.d.ts.map +0 -1
  97. package/lib/index.js +0 -8
  98. package/lib/index.js.map +0 -1
  99. package/lib/messageSchema.d.ts.map +0 -1
  100. package/lib/messageSchema.js.map +0 -1
  101. package/lib/sanitize.js.map +0 -1
  102. package/lib/sanitizer.d.ts.map +0 -1
  103. package/lib/sanitizer.js.map +0 -1
  104. package/lib/test/types/validateDebuggerPrevious.d.ts +0 -2
  105. package/lib/test/types/validateDebuggerPrevious.d.ts.map +0 -1
  106. package/lib/test/types/validateDebuggerPrevious.js.map +0 -1
  107. package/tsconfig.esnext.json +0 -7
  108. /package/lib/{messageSchema.d.ts → messageSchema.d.mts} +0 -0
  109. /package/lib/{sanitize.d.ts → sanitize.d.mts} +0 -0
  110. /package/lib/{sanitize.d.ts.map → sanitize.d.mts.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitizer.cjs","sourceRoot":"","sources":["../src/sanitizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;;;;;;;;;;;;GAaG;AAEH,sDAAwC;AACxC,2DAAoD;AAEpD,uDAWyB;AAEzB,IAAK,QAMJ;AAND,WAAK,QAAQ;IACZ,6CAAO,CAAA;IACP,yCAAK,CAAA;IACL,uCAAI,CAAA;IACJ,qDAAW,CAAA;IACX,2CAAM,CAAA;AACP,CAAC,EANI,QAAQ,KAAR,QAAQ,QAMZ;AAED,sEAAsE;AACtE,uBAAuB;AACvB,MAAM,WAAW,GAAG;IACnB,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,GAAG,EAAE;QACd,OAAO,kBAAkB,CAAC;IAC3B,CAAC;CACD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,kBAAkB;IAoBvB,YACU,gBAAuD,EACvD,KAAc;QADd,qBAAgB,GAAhB,gBAAgB,CAAuC;QACvD,UAAK,GAAL,KAAK,CAAS;QArBxB;;;;WAIG;QACK,aAAQ,GAAG,IAAI,KAAK,EAAO,CAAC;QACpC;;;WAGG;QACK,0BAAqB,GAAG,IAAI,KAAK,EAAO,CAAC;QACzC,gBAAW,GAAG,KAAK,CAAC;QAC5B;;;;WAIG;QACK,uBAAkB,GAAG,CAAC,CAAC;IAK5B,CAAC;IAEJ,QAAQ,CAAC,GAAQ;QAChB,IAAI,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACnB;IACF,CAAC;IAED,UAAU,CAAC,OAAY;QACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE5B,IAAI,MAAM,CAAC;QACX,IAAI;YACH,MAAM,GAAG,IAAI,CAAC,KAA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O,CAAC,CAAC;wBAC3B,MAAM;qBACN;oBACD,KAAK,MAAM,CAAC;oBACZ,KAAK,OAAO,CAAC;oBACb,KAAK,UAAU,CAAC;oBAChB,KAAK,WAAW,CAAC;oBACjB,KAAK,YAAY,CAAC;oBAClB,KAAK,aAAa;wBACjB,MAAM;oBACP;wBACC,IAAI,CAAC,QAAQ,CAAC,sBAAsB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;iBACrD;YACF,CAAC,CAAC,CAAC;YAEH,8DAA8D;YAC9D,IAAA,mBAAM,EACL,CAAC,IAAI,CAAC,cAAc,CAAC,mBAAmB,EAAE,EAC1C,KAAK,CAAC,+CAA+C,CACrD,CAAC;SACF;QAAC,OAAO,KAAK,EAAE;YACf,IAAI,CAAC,QAAQ,CAAC,yCAAyC,GAAG,EAAE,CAAC,CAAC;YAC9D,MAAM,KAAK,CAAC;SACZ;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;CACD;AA1hBD,8BA0hBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * This tool cleans up a message.json file downloaded through fluid-fetch to remove\n * user content and user identifying information. Enough information can be retained\n * to allow loading through Fluid Preview, or everything can be scrubbed so that only\n * replay-tool can read the result. Anonymous identifying information such as client\n * IDs are always retained. Object keys are NOT scrubbed, including those that are\n * nested within values (only leaf values are scrubbed).\n *\n * Note: While user content/information is scrubbed, it should not be assumed to be\n * fully anonymized because certain meta-information (such as word lengths and\n * consistent replacement) are preserved.\n *\n * Messages must match known structures when scrubbing for Fluid Preview.\n */\n\nimport * as Validator from \"jsonschema\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tattachContentsSchema,\n\tchunkedOpContentsSchema,\n\tjoinContentsSchema,\n\tjoinDataSchema,\n\topContentsMapSchema,\n\topContentsSchema,\n\topContentsMergeTreeDeltaOpSchema,\n\topContentsMergeTreeGroupOpSchema,\n\topContentsRegisterCollectionSchema,\n\tproposeContentsSchema,\n} from \"./messageSchema\";\n\nenum TextType {\n\tGeneric,\n\tEmail,\n\tName,\n\tFluidObject,\n\tMapKey,\n}\n\n// Workaround to jsonschema package not supporting \"false\" as a schema\n// that matches nothing\nconst falseResult = {\n\tvalid: false,\n\ttoString: () => {\n\t\treturn \"Unmatched format\";\n\t},\n};\n\n/**\n * Class that takes chunkedOp messages and can provide their concatenated\n * contents along with re-write sanitized content in-place back into the\n * messages. Assumes sanitized messages are always less than or equal in\n * size to the original message.\n */\nclass ChunkedOpProcessor {\n\t/**\n\t * Message references so we can replace their contents in-place. These can\n\t * be top-level chunkedOp messages, or top-level op messages with a chunkedOp\n\t * within the contents\n\t */\n\tprivate messages = new Array<any>();\n\t/**\n\t * The messages' parsed contents for processing. Should parallel the\n\t * messages member\n\t */\n\tprivate parsedMessageContents = new Array<any>();\n\tprivate writtenBack = false;\n\t/**\n\t * keep track of the total starting length to make sure we don't somehow end\n\t * up with more content than we started with (meaning we may not be able to\n\t * write it back)\n\t */\n\tprivate concatenatedLength = 0;\n\n\tconstructor(\n\t\treadonly validateSchemaFn: (object: any, schema: any) => boolean,\n\t\treadonly debug: boolean,\n\t) {}\n\n\tdebugMsg(msg: any) {\n\t\tif (this.debug) {\n\t\t\tconsole.error(msg);\n\t\t}\n\t}\n\n\taddMessage(message: any): void {\n\t\tthis.messages.push(message);\n\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(message.contents);\n\t\t\tif (message.type === \"op\") {\n\t\t\t\t// nested within a regular op\n\t\t\t\t// need to go deeper to get the desired contents\n\t\t\t\tparsed = parsed.contents;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthis.debugMsg(e);\n\t\t\tthis.debugMsg(message.contents);\n\t\t}\n\t\tthis.validateSchemaFn(parsed, chunkedOpContentsSchema);\n\t\tthis.parsedMessageContents.push(parsed);\n\t}\n\n\thasAllMessages(): boolean {\n\t\tconst lastMsgContents = this.parsedMessageContents[this.parsedMessageContents.length - 1];\n\t\treturn (\n\t\t\tlastMsgContents.chunkId !== undefined &&\n\t\t\tlastMsgContents.chunkId === lastMsgContents.totalChunks\n\t\t);\n\t}\n\n\t/**\n\t * @returns The concatenated contents of all the messages parsed as json\n\t */\n\tgetConcatenatedContents(): any {\n\t\tconst contentsString = this.parsedMessageContents.reduce(\n\t\t\t(previousValue: string, currentValue: any) => {\n\t\t\t\treturn previousValue + (currentValue.contents as string);\n\t\t\t},\n\t\t\t\"\",\n\t\t);\n\n\t\tthis.concatenatedLength = contentsString.length;\n\t\ttry {\n\t\t\treturn JSON.parse(contentsString);\n\t\t} catch (e) {\n\t\t\tthis.debugMsg(contentsString);\n\t\t\tthis.debugMsg(e);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Write back sanitized contents into the messages. The contents are\n\t * stringified, split up, and written in place to the messages that\n\t * were added earlier. The number of messages is preserved.\n\t * @param contents - Sanitized contents to write back\n\t */\n\twriteSanitizedContents(contents: any): void {\n\t\t// Write back a chunk size equal to the original\n\t\tconst chunkSize = this.parsedMessageContents[0].contents.length;\n\n\t\tlet stringified: string;\n\t\ttry {\n\t\t\tstringified = JSON.stringify(contents);\n\t\t\tassert(\n\t\t\t\tstringified.length <= this.concatenatedLength,\n\t\t\t\t0x089 /* \"Stringified length of chunk contents > total starting length\" */,\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tthis.debugMsg(e);\n\t\t\tthrow e;\n\t\t}\n\n\t\tfor (let i = 0; i < this.messages.length; i++) {\n\t\t\tconst substring = stringified.substring(i * chunkSize, (i + 1) * chunkSize);\n\n\t\t\tconst parsedContents = this.parsedMessageContents[i];\n\t\t\tparsedContents.contents = substring;\n\t\t\tconst message = this.messages[i];\n\n\t\t\tlet stringifiedParsedContents;\n\t\t\ttry {\n\t\t\t\t// for nested chunkedOps, we need to recreate the extra nesting layer\n\t\t\t\t// we removed earlier when adding the message\n\t\t\t\tif (message.type === \"op\") {\n\t\t\t\t\tconst nestingLayer = {\n\t\t\t\t\t\ttype: \"chunkedOp\",\n\t\t\t\t\t\tcontents: parsedContents,\n\t\t\t\t\t};\n\t\t\t\t\tstringifiedParsedContents = JSON.stringify(nestingLayer);\n\t\t\t\t} else {\n\t\t\t\t\tstringifiedParsedContents = JSON.stringify(parsedContents);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tthis.debugMsg(e);\n\t\t\t}\n\n\t\t\tmessage.contents = stringifiedParsedContents;\n\t\t}\n\n\t\tthis.writtenBack = true;\n\t}\n\n\treset(): void {\n\t\tassert(\n\t\t\tthis.writtenBack,\n\t\t\t0x08a /* \"resetting ChunkedOpProcessor that never wrote back its contents\" */,\n\t\t);\n\t\tthis.messages = new Array<any>();\n\t\tthis.parsedMessageContents = new Array<any>();\n\t\tthis.writtenBack = false;\n\t\tthis.concatenatedLength = 0;\n\t}\n\n\tisPendingProcessing(): boolean {\n\t\treturn this.messages.length !== 0;\n\t}\n}\n\nexport class Sanitizer {\n\treadonly validator = new Validator.Validator();\n\t// Represents the keys used to store Fluid object identifiers, snapshot info,\n\t// and other string fields that should not be replaced in contents blobs to\n\t// ensure the messages are still usable\n\treadonly defaultExcludedKeys = new Set<string>();\n\t// Represents the keys used by merge-tree ops their \"seg\" property, where other\n\t// keys represent user information\n\treadonly mergeTreeExcludedKeys = new Set<string>();\n\t// Map of user information to what it was replaced with. Used to ensure the same\n\t// data have the same replacements\n\treadonly replacementMap = new Map<string, string>();\n\n\t/**\n\t * Validate that the provided message matches the provided schema.\n\t * For a full scrub, warn and continue (scrubber should fully sanitize unexpected\n\t * fields for ops), otherwise throw an error because we cannot be sure user\n\t * information is being sufficiently sanitized.\n\t */\n\tobjectMatchesSchema = (object: any, schema: any): boolean => {\n\t\tconst result = schema === false ? falseResult : this.validator.validate(object, schema);\n\t\tif (!result.valid) {\n\t\t\tconst errorMsg = `Bad msg fmt:\\n${result.toString()}\\n${JSON.stringify(\n\t\t\t\tobject,\n\t\t\t\tundefined,\n\t\t\t\t2,\n\t\t\t)}`;\n\n\t\t\tif (this.fullScrub || this.noBail) {\n\t\t\t\tthis.debugMsg(errorMsg);\n\t\t\t} else {\n\t\t\t\tthrow new Error(errorMsg);\n\t\t\t}\n\t\t}\n\t\treturn result.valid;\n\t};\n\n\treadonly chunkProcessor = new ChunkedOpProcessor(this.objectMatchesSchema, this.debug);\n\n\tconstructor(\n\t\treadonly messages: ISequencedDocumentMessage[],\n\t\treadonly fullScrub: boolean,\n\t\treadonly noBail: boolean,\n\t\treadonly debug: boolean = false,\n\t) {\n\t\tthis.defaultExcludedKeys.add(\"type\");\n\t\tthis.defaultExcludedKeys.add(\"id\");\n\t\tthis.defaultExcludedKeys.add(\"pkg\");\n\t\tthis.defaultExcludedKeys.add(\"snapshotFormatVersion\");\n\t\tthis.defaultExcludedKeys.add(\"packageVersion\");\n\t\tthis.mergeTreeExcludedKeys.add(\"nodeType\");\n\t}\n\n\tdebugMsg(msg: any) {\n\t\tif (this.debug) {\n\t\t\tconsole.error(msg);\n\t\t}\n\t}\n\n\tisFluidObjectKey(key: string): boolean {\n\t\treturn key === \"type\" || key === \"id\";\n\t}\n\n\tgetRandomText(len: number): string {\n\t\tlet str = \"\";\n\t\twhile (str.length < len) {\n\t\t\tstr = str + Math.random().toString(36).substring(2);\n\t\t}\n\t\treturn str.substr(0, len);\n\t}\n\n\treadonly wordTokenRegex = /\\S+/g;\n\n\treadonly replaceRandomTextFn = (match: string): string => {\n\t\tif (this.replacementMap.has(match)) {\n\t\t\treturn this.replacementMap.get(match)!;\n\t\t}\n\n\t\tconst replacement = this.getRandomText(match.length);\n\t\tthis.replacementMap.set(match, replacement);\n\t\treturn replacement;\n\t};\n\n\t/**\n\t * Replace text with garbage. FluidObject types are not replaced when not under\n\t * full scrub mode. All other text is replaced consistently.\n\t */\n\treplaceText(input?: string, type: TextType = TextType.Generic): string | undefined {\n\t\tif (input === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (type === TextType.FluidObject) {\n\t\t\tif (this.replacementMap.has(input)) {\n\t\t\t\treturn this.replacementMap.get(input)!;\n\t\t\t}\n\n\t\t\tconst replacement = this.fullScrub ? this.getRandomText(input.length) : input;\n\n\t\t\tthis.replacementMap.set(input, replacement);\n\t\t\treturn replacement;\n\t\t}\n\n\t\treturn input.replace(this.wordTokenRegex, this.replaceRandomTextFn);\n\t}\n\n\treplaceArray(input: any[]): any[] {\n\t\tfor (let i = 0; i < input.length; i++) {\n\t\t\tconst value = input[i];\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tinput[i] = this.replaceText(value);\n\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\tinput[i] = this.replaceArray(value);\n\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\tinput[i] = this.replaceObject(value);\n\t\t\t}\n\t\t}\n\t\treturn input;\n\t}\n\n\t/**\n\t * (sort of) recurses down the values of a JSON object to sanitize all its strings\n\t * (only checks strings, arrays, and objects)\n\t * @param input - The object to sanitize\n\t * @param excludedKeys - object keys for which to skip replacement when not in fullScrub\n\t */\n\treplaceObject(\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tinput: object | null,\n\t\texcludedKeys: Set<string> = this.defaultExcludedKeys,\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t): object | null {\n\t\t// File might contain actual nulls\n\t\tif (input === null || input === undefined) {\n\t\t\treturn input;\n\t\t}\n\n\t\tconst keys = Object.keys(input);\n\t\tkeys.forEach((key) => {\n\t\t\tif (this.fullScrub || !excludedKeys.has(key)) {\n\t\t\t\tconst value = input[key];\n\t\t\t\tif (typeof value === \"string\") {\n\t\t\t\t\tinput[key] = this.replaceText(\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tthis.isFluidObjectKey(key) ? TextType.FluidObject : TextType.Generic,\n\t\t\t\t\t);\n\t\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t\tinput[key] = this.replaceArray(value);\n\t\t\t\t} else if (typeof value === \"object\") {\n\t\t\t\t\tinput[key] = this.replaceObject(value, excludedKeys);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn input;\n\t}\n\n\t/**\n\t * Replacement on an unknown type or a parsed root level object\n\t * without a key\n\t * @param input - The object to sanitize\n\t * @param excludedKeys - object keys for which to skip replacement when not in fullScrub\n\t */\n\treplaceAny(input: any, excludedKeys: Set<string> = this.defaultExcludedKeys): any {\n\t\tif (input === null || input === undefined) {\n\t\t\treturn input;\n\t\t}\n\n\t\tif (typeof input === \"string\") {\n\t\t\treturn this.replaceText(input);\n\t\t} else if (Array.isArray(input)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn this.replaceArray(input);\n\t\t} else if (typeof input === \"object\") {\n\t\t\treturn this.replaceObject(input, excludedKeys);\n\t\t}\n\n\t\t// Don't run replacement on any other types\n\t\treturn input;\n\t}\n\n\tfixJoin(message: any) {\n\t\tif (!this.objectMatchesSchema(message.contents, joinContentsSchema)) {\n\t\t\tmessage.contents = this.replaceAny(message.contents);\n\t\t}\n\n\t\ttry {\n\t\t\tlet data = JSON.parse(message.data);\n\t\t\tif (!this.objectMatchesSchema(data, joinDataSchema)) {\n\t\t\t\tdata = this.replaceAny(data);\n\t\t\t} else {\n\t\t\t\tconst user = data.detail.user;\n\t\t\t\tuser.id = this.replaceText(user.id, TextType.Email);\n\t\t\t\tuser.email = this.replaceText(user.email, TextType.Email);\n\t\t\t\tuser.name = this.replaceText(user.name, TextType.Name);\n\t\t\t}\n\n\t\t\tmessage.data = JSON.stringify(data);\n\t\t} catch (e) {\n\t\t\tthis.debugMsg(e);\n\t\t}\n\t}\n\n\tfixPropose(message: any) {\n\t\tif (!this.objectMatchesSchema(message.contents, proposeContentsSchema)) {\n\t\t\tmessage.contents = this.replaceAny(message.contents);\n\t\t} else {\n\t\t\tif (typeof message.contents === \"string\") {\n\t\t\t\ttry {\n\t\t\t\t\tconst data = JSON.parse(message.contents);\n\t\t\t\t\tif (this.fullScrub) {\n\t\t\t\t\t\tconst pkg = data.value?.package;\n\t\t\t\t\t\tif (pkg?.name) {\n\t\t\t\t\t\t\tpkg.name = this.replaceText(pkg.name, TextType.FluidObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (Array.isArray(pkg?.fluid?.browser?.umd?.files)) {\n\t\t\t\t\t\t\tpkg.fluid.browser.umd.files = this.replaceArray(\n\t\t\t\t\t\t\t\tpkg.fluid.browser.umd.files,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tthis.debugMsg(e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.fullScrub) {\n\t\t\t\t\tmessage.contents.value = this.replaceText(\n\t\t\t\t\t\tmessage.contents.value,\n\t\t\t\t\t\tTextType.FluidObject,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfixAttachEntries(entries: any[]) {\n\t\tentries.forEach((element) => {\n\t\t\t// Tree type\n\t\t\tif (element.value.entries) {\n\t\t\t\tthis.fixAttachEntries(element.value.entries);\n\t\t\t} else {\n\t\t\t\t// Blob (leaf) type\n\t\t\t\ttry {\n\t\t\t\t\tif (typeof element.value.contents === \"string\") {\n\t\t\t\t\t\tlet data = JSON.parse(element.value.contents);\n\t\t\t\t\t\tdata = this.replaceObject(data);\n\t\t\t\t\t\telement.value.contents = JSON.stringify(data);\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tthis.debugMsg(e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Fix the content of an attach in place\n\t * @param contents - contents object to fix\n\t */\n\tfixAttachContents(contents: any): any {\n\t\tassert(\n\t\t\ttypeof contents === \"object\",\n\t\t\t0x08b /* \"Unexpected type on contents for fix of an attach!\" */,\n\t\t);\n\t\tif (!this.objectMatchesSchema(contents, attachContentsSchema)) {\n\t\t\tthis.replaceObject(contents);\n\t\t} else {\n\t\t\tif (this.fullScrub) {\n\t\t\t\tcontents.id = this.replaceText(contents.id, TextType.FluidObject);\n\t\t\t\tcontents.type = this.replaceText(contents.type, TextType.FluidObject);\n\t\t\t}\n\n\t\t\tthis.fixAttachEntries(contents.snapshot.entries);\n\t\t}\n\t}\n\n\t/**\n\t * Fix an attach message at the root level or a ContainerMessageType attach. Attach\n\t * messages found within an op message should instead have their contents parsed out\n\t * and sent to fixAttachContents.\n\t * @param message - The attach message to fix\n\t * @param withinOp - If the message is from within an op message (as opposed to being\n\t * an attach message at the root level). Root level attach messages have \"snapshot\"\n\t * under a \"contents\" key, whereas attach messages from within an op message have it\n\t * under a \"content\" key\n\t */\n\tfixAttach(message: any) {\n\t\t// Handle case where contents is stringified json\n\t\tif (typeof message.contents === \"string\") {\n\t\t\ttry {\n\t\t\t\tconst data = JSON.parse(message.contents);\n\t\t\t\tthis.fixAttachContents(data);\n\t\t\t\tmessage.contents = JSON.stringify(data);\n\t\t\t} catch (e) {\n\t\t\t\tthis.debugMsg(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.fixAttachContents(message.contents);\n\t\t}\n\t}\n\n\tfixDeltaOp(deltaOp: any) {\n\t\tdeltaOp.seg =\n\t\t\ttypeof deltaOp.seg === \"string\"\n\t\t\t\t? this.replaceText(deltaOp.seg)\n\t\t\t\t: this.replaceObject(deltaOp.seg, this.mergeTreeExcludedKeys);\n\t}\n\n\t/**\n\t * Fix the contents object for an op message. Does not do extra type handling. Does\n\t * not handle special container message types like \"attach\", \"component\", and\n\t * \"chunkedOp\" (these should be handled by the caller)\n\t * @param contents - The contents object for an op message. If it was a string in the\n\t * message, it must have been converted to an object first\n\t */\n\tfixOpContentsObject(contents: any) {\n\t\t// do replacement\n\t\tif (!this.objectMatchesSchema(contents, opContentsSchema)) {\n\t\t\tthis.replaceAny(contents);\n\t\t} else {\n\t\t\tif (this.fullScrub) {\n\t\t\t\tcontents.address = this.replaceText(contents.address, TextType.FluidObject);\n\t\t\t}\n\n\t\t\tconst innerContent = contents.contents.content;\n\t\t\tassert(\n\t\t\t\tinnerContent !== undefined,\n\t\t\t\t0x08c /* \"innerContent for fixing op contents is undefined!\" */,\n\t\t\t);\n\t\t\tif (contents.contents.type === \"attach\") {\n\t\t\t\t// attach op\n\t\t\t\t// handle case where inner content is stringified json\n\t\t\t\tif (typeof contents.contents.content === \"string\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst data = JSON.parse(contents.contents.content);\n\t\t\t\t\t\tthis.fixAttachContents(data);\n\t\t\t\t\t\tcontents.contents.content = JSON.stringify(data);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tthis.debugMsg(e);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.fixAttachContents(contents.contents.content);\n\t\t\t\t}\n\t\t\t} else if (this.validator.validate(innerContent, opContentsMapSchema).valid) {\n\t\t\t\t// map op\n\t\t\t\tif (this.fullScrub) {\n\t\t\t\t\tinnerContent.address = this.replaceText(\n\t\t\t\t\t\tinnerContent.address,\n\t\t\t\t\t\tTextType.FluidObject,\n\t\t\t\t\t);\n\t\t\t\t\tinnerContent.contents.key = this.replaceText(\n\t\t\t\t\t\tinnerContent.contents.key,\n\t\t\t\t\t\tTextType.MapKey,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (innerContent.contents.value !== undefined) {\n\t\t\t\t\tinnerContent.contents.value.value = this.replaceAny(\n\t\t\t\t\t\tinnerContent.contents.value.value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tthis.validator.validate(innerContent, opContentsMergeTreeGroupOpSchema).valid\n\t\t\t) {\n\t\t\t\t// merge tree group op\n\t\t\t\tif (this.fullScrub) {\n\t\t\t\t\tinnerContent.address = this.replaceText(\n\t\t\t\t\t\tinnerContent.address,\n\t\t\t\t\t\tTextType.FluidObject,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tinnerContent.contents.ops.forEach((deltaOp) => {\n\t\t\t\t\tthis.fixDeltaOp(deltaOp);\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\tthis.validator.validate(innerContent, opContentsMergeTreeDeltaOpSchema).valid\n\t\t\t) {\n\t\t\t\t// merge tree delta op\n\t\t\t\tif (this.fullScrub) {\n\t\t\t\t\tinnerContent.address = this.replaceText(\n\t\t\t\t\t\tinnerContent.address,\n\t\t\t\t\t\tTextType.FluidObject,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthis.fixDeltaOp(innerContent.contents);\n\t\t\t} else if (\n\t\t\t\tthis.validator.validate(innerContent, opContentsRegisterCollectionSchema).valid\n\t\t\t) {\n\t\t\t\t// register collection op\n\t\t\t\tif (this.fullScrub) {\n\t\t\t\t\tinnerContent.address = this.replaceText(\n\t\t\t\t\t\tinnerContent.address,\n\t\t\t\t\t\tTextType.FluidObject,\n\t\t\t\t\t);\n\t\t\t\t\tinnerContent.contents.key = this.replaceText(\n\t\t\t\t\t\tinnerContent.contents.key,\n\t\t\t\t\t\tTextType.MapKey,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (innerContent.contents.value !== undefined) {\n\t\t\t\t\tinnerContent.contents.value.value = this.replaceAny(\n\t\t\t\t\t\tinnerContent.contents.value.value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// message contents don't match any known op format\n\t\t\t\tthis.objectMatchesSchema(contents, false);\n\t\t\t}\n\t\t}\n\t}\n\n\tfixOp(message: any) {\n\t\t// handle case where contents is stringified json\n\t\tlet msgContents;\n\t\tif (typeof message.contents === \"string\") {\n\t\t\ttry {\n\t\t\t\tmsgContents = JSON.parse(message.contents);\n\t\t\t} catch (e) {\n\t\t\t\tthis.debugMsg(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tmsgContents = message.contents;\n\t\t}\n\n\t\t// handle container message types\n\t\tswitch (msgContents.type) {\n\t\t\tcase \"attach\": {\n\t\t\t\t// this one is like a regular attach op, except its contents aren't nested as deep\n\t\t\t\t// run fixAttach directly and return\n\t\t\t\tthis.fixAttach(msgContents);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"component\": {\n\t\t\t\t// this one functionally nests its contents one layer deeper\n\t\t\t\t// bring up the contents object and continue as usual\n\t\t\t\tthis.fixOpContentsObject(msgContents.contents);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"chunkedOp\": {\n\t\t\t\t// this is a (regular?) op split into multiple parts due to size, e.g. because it\n\t\t\t\t// has an attached image, and where the chunkedOp is within the top-level op's contents\n\t\t\t\t// (as opposed to being at the top-level). The contents of the chunks need to be\n\t\t\t\t// concatenated to form the complete stringified json object\n\t\t\t\t// Early return here to skip re-stringify because no changes are made until the last\n\t\t\t\t// chunk, and the ChunkedOpProcessor will handle everything at that point\n\t\t\t\treturn this.fixChunkedOp(message);\n\t\t\t}\n\t\t\tcase \"blobAttach\": {\n\t\t\t\t// TODO: handle this properly once blob api is used\n\t\t\t\tthis.debugMsg(\"TODO: blobAttach ops are skipped/unhandled\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t// A regular op\n\t\t\t\tthis.fixOpContentsObject(msgContents);\n\t\t\t}\n\t\t}\n\n\t\t// re-stringify the json if needed\n\t\tif (typeof message.contents === \"string\") {\n\t\t\ttry {\n\t\t\t\tmessage.contents = JSON.stringify(msgContents);\n\t\t\t} catch (e) {\n\t\t\t\tthis.debugMsg(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param message - The top-level chunkedOp message or a top-level op message\n\t * with a chunkedOp inside its contents\n\t */\n\tfixChunkedOp(message: any) {\n\t\tthis.chunkProcessor.addMessage(message);\n\t\tif (!this.chunkProcessor.hasAllMessages()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst contents = this.chunkProcessor.getConcatenatedContents();\n\t\tthis.fixOpContentsObject(contents);\n\n\t\tthis.chunkProcessor.writeSanitizedContents(contents);\n\t\tthis.chunkProcessor.reset();\n\t}\n\n\tsanitize(): ISequencedDocumentMessage[] {\n\t\tlet seq = 0;\n\n\t\ttry {\n\t\t\tthis.messages.map((message) => {\n\t\t\t\tseq = message.sequenceNumber;\n\t\t\t\t// message types from protocol-definitions' protocol.ts\n\t\t\t\tswitch (message.type) {\n\t\t\t\t\tcase \"join\": {\n\t\t\t\t\t\tthis.fixJoin(message);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"propose\": {\n\t\t\t\t\t\tthis.fixPropose(message);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"attach\": {\n\t\t\t\t\t\tthis.fixAttach(message);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"op\": {\n\t\t\t\t\t\tthis.fixOp(message);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"chunkedOp\": {\n\t\t\t\t\t\tthis.fixChunkedOp(message);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"noop\":\n\t\t\t\t\tcase \"leave\":\n\t\t\t\t\tcase \"noClient\":\n\t\t\t\t\tcase \"summarize\":\n\t\t\t\t\tcase \"summaryAck\":\n\t\t\t\t\tcase \"summaryNack\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthis.debugMsg(`Unexpected op type ${message.type}`);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// make sure we don't miss an incomplete chunked op at the end\n\t\t\tassert(\n\t\t\t\t!this.chunkProcessor.isPendingProcessing(),\n\t\t\t\t0x08d /* \"After sanitize, pending incomplete ops!\" */,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tthis.debugMsg(`Error while processing sequenceNumber ${seq}`);\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn this.messages;\n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,YAAY,GAAE,GAAG,CAAC,MAAM,CAA4B,GAAG,GAAG;IAkBjF,OAAO,CAAC,OAAO,EAAE,GAAG;IAsBpB,UAAU,CAAC,OAAO,EAAE,GAAG;IAgCvB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;IAoB/B;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG;IAiBrC;;;;;;;;;OASG;IACH,SAAS,CAAC,OAAO,EAAE,GAAG;IAgBtB,UAAU,CAAC,OAAO,EAAE,GAAG;IAOvB;;;;;;OAMG;IACH,mBAAmB,CAAC,QAAQ,EAAE,GAAG;IA+FjC,KAAK,CAAC,OAAO,EAAE,GAAG;IA2DlB;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,GAAG;IAazB,QAAQ,IAAI,yBAAyB,EAAE;CAoDvC"}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.38.3"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,36 @@
1
+ import { Deferred } from '@fluidframework/core-utils';
2
+ import { IDocumentService } from '@fluidframework/driver-definitions';
3
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
4
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
5
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
6
+ import { ISnapshotTree } from '@fluidframework/protocol-definitions';
7
+ import { IVersion } from '@fluidframework/protocol-definitions';
8
+ import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
9
+ import { ReplayController } from '@fluidframework/replay-driver';
10
+
11
+ /* Excluded from this release type: DebuggerUI */
12
+
13
+ /* Excluded from this release type: debuggerUIFactory */
14
+
15
+ /* Excluded from this release type: DebugReplayController */
16
+
17
+ /**
18
+ * @alpha
19
+ */
20
+ export declare namespace FluidDebugger {
21
+ /* Excluded from this release type: createFromService */
22
+ /**
23
+ * @alpha
24
+ */
25
+ export function createFromServiceFactory(documentServiceFactory: IDocumentServiceFactory): Promise<IDocumentServiceFactory>;
26
+ }
27
+
28
+ /* Excluded from this release type: IDebuggerController */
29
+
30
+ /* Excluded from this release type: IDebuggerUI */
31
+
32
+ /* Excluded from this release type: ReadDocumentStorageServiceBase */
33
+
34
+ /* Excluded from this release type: ReplayController */
35
+
36
+ export { }
@@ -0,0 +1,35 @@
1
+ import { Deferred } from '@fluidframework/core-utils';
2
+ import { IDocumentService } from '@fluidframework/driver-definitions';
3
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
4
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
5
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
6
+ import { ISnapshotTree } from '@fluidframework/protocol-definitions';
7
+ import { IVersion } from '@fluidframework/protocol-definitions';
8
+ import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
9
+ import { ReplayController } from '@fluidframework/replay-driver';
10
+
11
+ /* Excluded from this release type: DebuggerUI */
12
+
13
+ /* Excluded from this release type: debuggerUIFactory */
14
+
15
+ /* Excluded from this release type: DebugReplayController */
16
+
17
+ /* Excluded from this release type: Deferred */
18
+
19
+ /* Excluded from this release type: FluidDebugger */
20
+
21
+ /* Excluded from this release type: IDebuggerController */
22
+
23
+ /* Excluded from this release type: IDebuggerUI */
24
+
25
+ /* Excluded from this release type: IDocumentService */
26
+
27
+ /* Excluded from this release type: IDocumentServiceFactory */
28
+
29
+ /* Excluded from this release type: IDocumentStorageService */
30
+
31
+ /* Excluded from this release type: ReadDocumentStorageServiceBase */
32
+
33
+ /* Excluded from this release type: ReplayController */
34
+
35
+ export { }
@@ -0,0 +1,35 @@
1
+ import { Deferred } from '@fluidframework/core-utils';
2
+ import { IDocumentService } from '@fluidframework/driver-definitions';
3
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
4
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
5
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
6
+ import { ISnapshotTree } from '@fluidframework/protocol-definitions';
7
+ import { IVersion } from '@fluidframework/protocol-definitions';
8
+ import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
9
+ import { ReplayController } from '@fluidframework/replay-driver';
10
+
11
+ /* Excluded from this release type: DebuggerUI */
12
+
13
+ /* Excluded from this release type: debuggerUIFactory */
14
+
15
+ /* Excluded from this release type: DebugReplayController */
16
+
17
+ /* Excluded from this release type: Deferred */
18
+
19
+ /* Excluded from this release type: FluidDebugger */
20
+
21
+ /* Excluded from this release type: IDebuggerController */
22
+
23
+ /* Excluded from this release type: IDebuggerUI */
24
+
25
+ /* Excluded from this release type: IDocumentService */
26
+
27
+ /* Excluded from this release type: IDocumentServiceFactory */
28
+
29
+ /* Excluded from this release type: IDocumentStorageService */
30
+
31
+ /* Excluded from this release type: ReadDocumentStorageServiceBase */
32
+
33
+ /* Excluded from this release type: ReplayController */
34
+
35
+ export { }
@@ -0,0 +1,193 @@
1
+ import { Deferred } from '@fluidframework/core-utils';
2
+ import { IDocumentService } from '@fluidframework/driver-definitions';
3
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
4
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
5
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
6
+ import { ISnapshotTree } from '@fluidframework/protocol-definitions';
7
+ import { IVersion } from '@fluidframework/protocol-definitions';
8
+ import { ReadDocumentStorageServiceBase } from '@fluidframework/replay-driver';
9
+ import { ReplayController } from '@fluidframework/replay-driver';
10
+
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare class DebuggerUI {
15
+ private readonly controller;
16
+ private readonly debuggerWindow;
17
+ static create(controller: IDebuggerController): DebuggerUI | null;
18
+ private static formatDate;
19
+ protected selector?: HTMLSelectElement;
20
+ protected versionText: HTMLDivElement;
21
+ protected buttonOps?: HTMLButtonElement;
22
+ protected text1?: HTMLDivElement;
23
+ protected text2?: HTMLDivElement;
24
+ protected text3?: HTMLDivElement;
25
+ protected lastOpText?: HTMLDivElement;
26
+ protected wasVersionSelected: boolean;
27
+ protected versions: IVersion[];
28
+ protected documentClosed: boolean;
29
+ protected constructor(controller: IDebuggerController, debuggerWindow: Window);
30
+ private attachDownloadOpsListener;
31
+ addVersions(versions: IVersion[]): void;
32
+ updateVersion(index: number, version: IVersion, seqNumber: number): void;
33
+ versionSelected(seqNumber: number, version: IVersion | string): void;
34
+ disableNextOpButton(disable: boolean): void;
35
+ updateNextOpText(ops: ISequencedDocumentMessage[]): void;
36
+ updateVersionText(versionCount: number): void;
37
+ updateLastOpText(lastKnownOp: number, stillLoading: boolean): void;
38
+ private download;
39
+ }
40
+
41
+ /**
42
+ * @internal
43
+ */
44
+ export declare type debuggerUIFactory = (controller: IDebuggerController) => IDebuggerUI | null;
45
+
46
+ /**
47
+ * Replay controller that uses pop-up window to control op playback
48
+ * @internal
49
+ */
50
+ export declare class DebugReplayController extends ReplayController implements IDebuggerController {
51
+ static create(createUi: debuggerUIFactory): DebugReplayController | null;
52
+ protected static readonly WindowClosedSeq = -1;
53
+ protected static seqFromTree(documentStorageService: IDocumentStorageService, tree: ISnapshotTree | null): Promise<number>;
54
+ protected ui: IDebuggerUI;
55
+ protected stepsDeferred?: Deferred<number>;
56
+ protected startSeqDeferred: Deferred<number>;
57
+ protected retryFetchOpsOnEndOfFile: boolean;
58
+ protected documentService?: IDocumentService;
59
+ protected documentStorageService?: IDocumentStorageService;
60
+ protected versions: IVersion[];
61
+ protected stepsToPlay: number;
62
+ protected lastOpReached: boolean;
63
+ protected versionCount: number;
64
+ protected storage?: ReadDocumentStorageServiceBase;
65
+ private shouldUseController;
66
+ connectToUi(ui: IDebuggerUI): void;
67
+ onClose(): void;
68
+ onVersionSelection(version: IVersion): Promise<void>;
69
+ onOpButtonClick(steps: number): void;
70
+ onSnapshotFileSelection(file: File): void;
71
+ onDownloadOpsButtonClick(anonymize: boolean): Promise<string>;
72
+ private fetchOpsFromDeltaStorage;
73
+ fetchTo(currentOp: number): number | undefined;
74
+ isSelectionMade(): boolean;
75
+ downloadVersionInfo(documentStorageService: IDocumentStorageService, prevRequest: Promise<void>, index: number, version: IVersion): Promise<void>;
76
+ initStorage(documentService: IDocumentService): Promise<boolean>;
77
+ readBlob(blobId: string): Promise<ArrayBufferLike>;
78
+ getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
79
+ getSnapshotTree(versionRequested?: IVersion): Promise<ISnapshotTree | null>;
80
+ getStartingOpSequence(): Promise<number>;
81
+ /**
82
+ * Return true if we are done processing ops
83
+ */
84
+ isDoneFetch(currentOp: number, lastTimeStamp?: number): boolean;
85
+ replay(emitter: (op: ISequencedDocumentMessage[]) => void, fetchedOps: ISequencedDocumentMessage[]): Promise<void>;
86
+ protected resolveStorage(seq: number, storage: ReadDocumentStorageServiceBase, version: IVersion | string): void;
87
+ }
88
+
89
+ /**
90
+ * @alpha
91
+ */
92
+ export declare namespace FluidDebugger {
93
+ /**
94
+ * Creates document service wrapper that pops up Debugger window and allows user to play ops one by one.
95
+ * User can chose to start with any snapshot
96
+ * If pop-ups are disabled, we continue without debugger.
97
+ * @param documentService - original document service to use to fetch ops / snapshots.
98
+ * @internal
99
+ */
100
+ export function createFromService(documentService: IDocumentService): Promise<IDocumentService>;
101
+ /**
102
+ * @alpha
103
+ */
104
+ export function createFromServiceFactory(documentServiceFactory: IDocumentServiceFactory): Promise<IDocumentServiceFactory>;
105
+ }
106
+
107
+ /**
108
+ * @internal
109
+ */
110
+ export declare interface IDebuggerController {
111
+ /**
112
+ * Initialization. UI layers calls into controller to connect the two.
113
+ * @param ui - UI layer
114
+ */
115
+ connectToUi(ui: IDebuggerUI): any;
116
+ /**
117
+ * Called by UI layer when debugger window is closed by user
118
+ * If called before user makes selection of snapshot/file, original
119
+ * document service is returned to loader (instead of debugger service) and normal document load continues.
120
+ */
121
+ onClose(): void;
122
+ /**
123
+ * UI Layer notifies about selection of version to continue.
124
+ * On successful load, versionSelected() is called.
125
+ * @param version - Snapshot version to start from.
126
+ */
127
+ onVersionSelection(version: IVersion): void;
128
+ /**
129
+ * UI Layer notifies about selection of version to continue.
130
+ * On successful load, versionSelected() is called.
131
+ * @param version - File to load snapshot from
132
+ */
133
+ onSnapshotFileSelection(file: File): void;
134
+ /**
135
+ * "next op" button is clicked in the UI
136
+ * @param steps - number of ops to play.
137
+ */
138
+ onOpButtonClick(steps: number): void;
139
+ /**
140
+ * "Download ops" option is clicked in the UI. Returns JSON of the full opStream when available.
141
+ * @param anonymize - anonymize the ops json using the sanitization tool
142
+ */
143
+ onDownloadOpsButtonClick(anonymize: boolean): Promise<string>;
144
+ }
145
+
146
+ /**
147
+ * @internal
148
+ */
149
+ export declare interface IDebuggerUI {
150
+ /**
151
+ * Version information is provided.
152
+ * Expect updates (information about seq#, timestamp) through updateVersion() calls
153
+ */
154
+ addVersions(version: IVersion[]): void;
155
+ /**
156
+ * Call when new version is downloaded from storage
157
+ * Expect multiple callbacks.
158
+ */
159
+ updateVersion(index: number, version: IVersion, seqNumber: number): void;
160
+ /**
161
+ * Called in response to successful onVersionSelection() or onSnapshotFileSelection() call
162
+ * and provides extra information about selection.
163
+ * It expected that UI layer would change its mode as result of this call, i.e. switch to
164
+ * displaying op playback controls (if this is supported)
165
+ * Note: There maybe no call to versionSelected() in response to onSnapshotFileSelection() call
166
+ * if file does not exist, has wrong name of wrong format.
167
+ * @param version - version, file name, or undefined if playing ops.
168
+ */
169
+ versionSelected(seqNumber: number, version: IVersion | string): void;
170
+ /**
171
+ * Called by controller in response to new ops being downloaded
172
+ * Called with disable = true if there are no (currently) ops to play
173
+ */
174
+ disableNextOpButton(disable: boolean): void;
175
+ /**
176
+ * Called by controller when new ops arrive (or we are done playing previous batch)
177
+ * Indicates next batch of ops that would be played when UI calls controller's onOpButtonClick()
178
+ * Called with ops=[] when there are no ops to play.
179
+ */
180
+ updateNextOpText(ops: ISequencedDocumentMessage[]): void;
181
+ /**
182
+ * Called periodically when new versions are downloaded from server
183
+ */
184
+ updateVersionText(versionsLeft: number): void;
185
+ /**
186
+ * Called periodically to notify about last known op
187
+ * @param lastKnownOp - seq number of last known op. -1 if can't play ops in this mode (load from file)
188
+ * @param stillLoading - true if we did not reach yet the end of the stream
189
+ */
190
+ updateLastOpText(lastKnownOp: number, stillLoading: boolean): void;
191
+ }
192
+
193
+ export { }
@@ -3,15 +3,21 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IDocumentService, IDocumentServiceFactory } from "@fluidframework/driver-definitions";
6
- import { ReplayDocumentServiceFactory } from "@fluidframework/replay-driver";
6
+ /**
7
+ * @alpha
8
+ */
7
9
  export declare namespace FluidDebugger {
8
10
  /**
9
11
  * Creates document service wrapper that pops up Debugger window and allows user to play ops one by one.
10
12
  * User can chose to start with any snapshot
11
13
  * If pop-ups are disabled, we continue without debugger.
12
14
  * @param documentService - original document service to use to fetch ops / snapshots.
15
+ * @internal
13
16
  */
14
17
  function createFromService(documentService: IDocumentService): Promise<IDocumentService>;
15
- function createFromServiceFactory(documentServiceFactory: IDocumentServiceFactory): Promise<IDocumentServiceFactory | ReplayDocumentServiceFactory>;
18
+ /**
19
+ * @alpha
20
+ */
21
+ function createFromServiceFactory(documentServiceFactory: IDocumentServiceFactory): Promise<IDocumentServiceFactory>;
16
22
  }
17
23
  //# sourceMappingURL=fluidDebugger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluidDebugger.d.ts","sourceRoot":"","sources":["../src/fluidDebugger.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,oCAAoC;AAK9F;;GAEG;AAEH,yBAAiB,aAAa,CAAC;IAC9B;;;;;;OAMG;IACH,SAAsB,iBAAiB,CACtC,eAAe,EAAE,gBAAgB,GAC/B,OAAO,CAAC,gBAAgB,CAAC,CAM3B;IAED;;OAEG;IACH,SAAsB,wBAAwB,CAC7C,sBAAsB,EAAE,uBAAuB,GAC7C,OAAO,CAAC,uBAAuB,CAAC,CAMlC;CAQD"}
@@ -3,8 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ReplayDocumentService, ReplayDocumentServiceFactory } from "@fluidframework/replay-driver";
6
- import { DebugReplayController } from "./fluidDebuggerController";
7
- import { DebuggerUI } from "./fluidDebuggerUi";
6
+ import { DebugReplayController } from "./fluidDebuggerController.mjs";
7
+ import { DebuggerUI } from "./fluidDebuggerUi.mjs";
8
+ /**
9
+ * @alpha
10
+ */
11
+ // eslint-disable-next-line @typescript-eslint/no-namespace
8
12
  export var FluidDebugger;
9
13
  (function (FluidDebugger) {
10
14
  /**
@@ -12,6 +16,7 @@ export var FluidDebugger;
12
16
  * User can chose to start with any snapshot
13
17
  * If pop-ups are disabled, we continue without debugger.
14
18
  * @param documentService - original document service to use to fetch ops / snapshots.
19
+ * @internal
15
20
  */
16
21
  async function createFromService(documentService) {
17
22
  const controller = createFluidDebugger();
@@ -21,6 +26,9 @@ export var FluidDebugger;
21
26
  return ReplayDocumentService.create(documentService, controller);
22
27
  }
23
28
  FluidDebugger.createFromService = createFromService;
29
+ /**
30
+ * @alpha
31
+ */
24
32
  async function createFromServiceFactory(documentServiceFactory) {
25
33
  const controller = createFluidDebugger();
26
34
  if (!controller) {
@@ -35,4 +43,4 @@ export var FluidDebugger;
35
43
  */
36
44
  const createFluidDebugger = () => DebugReplayController.create((controller) => DebuggerUI.create(controller));
37
45
  })(FluidDebugger || (FluidDebugger = {}));
38
- //# sourceMappingURL=fluidDebugger.js.map
46
+ //# sourceMappingURL=fluidDebugger.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluidDebugger.mjs","sourceRoot":"","sources":["../src/fluidDebugger.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B;OAC5F,EAAE,qBAAqB,EAAE;OACzB,EAAE,UAAU,EAAE;AAErB;;GAEG;AACH,2DAA2D;AAC3D,MAAM,KAAW,aAAa,CAqC7B;AArCD,WAAiB,aAAa;IAC7B;;;;;;OAMG;IACI,KAAK,UAAU,iBAAiB,CACtC,eAAiC;QAEjC,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC;QACzC,IAAI,CAAC,UAAU,EAAE;YAChB,OAAO,eAAe,CAAC;SACvB;QACD,OAAO,qBAAqB,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IAClE,CAAC;IARqB,+BAAiB,oBAQtC,CAAA;IAED;;OAEG;IACI,KAAK,UAAU,wBAAwB,CAC7C,sBAA+C;QAE/C,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC;QACzC,IAAI,CAAC,UAAU,EAAE;YAChB,OAAO,sBAAsB,CAAC;SAC9B;QACD,OAAO,IAAI,4BAA4B,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;IAC7E,CAAC;IARqB,sCAAwB,2BAQ7C,CAAA;IAED;;;OAGG;IACH,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAChC,qBAAqB,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAC9E,CAAC,EArCgB,aAAa,KAAb,aAAa,QAqC7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentService, IDocumentServiceFactory } from \"@fluidframework/driver-definitions\";\nimport { ReplayDocumentService, ReplayDocumentServiceFactory } from \"@fluidframework/replay-driver\";\nimport { DebugReplayController } from \"./fluidDebuggerController\";\nimport { DebuggerUI } from \"./fluidDebuggerUi\";\n\n/**\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace FluidDebugger {\n\t/**\n\t * Creates document service wrapper that pops up Debugger window and allows user to play ops one by one.\n\t * User can chose to start with any snapshot\n\t * If pop-ups are disabled, we continue without debugger.\n\t * @param documentService - original document service to use to fetch ops / snapshots.\n\t * @internal\n\t */\n\texport async function createFromService(\n\t\tdocumentService: IDocumentService,\n\t): Promise<IDocumentService> {\n\t\tconst controller = createFluidDebugger();\n\t\tif (!controller) {\n\t\t\treturn documentService;\n\t\t}\n\t\treturn ReplayDocumentService.create(documentService, controller);\n\t}\n\n\t/**\n\t * @alpha\n\t */\n\texport async function createFromServiceFactory(\n\t\tdocumentServiceFactory: IDocumentServiceFactory,\n\t): Promise<IDocumentServiceFactory> {\n\t\tconst controller = createFluidDebugger();\n\t\tif (!controller) {\n\t\t\treturn documentServiceFactory;\n\t\t}\n\t\treturn new ReplayDocumentServiceFactory(documentServiceFactory, controller);\n\t}\n\n\t/**\n\t * Binds DebuggerUI & DebugReplayController together\n\t * These classes do not know each other and talk through interfaces\n\t */\n\tconst createFluidDebugger = () =>\n\t\tDebugReplayController.create((controller) => DebuggerUI.create(controller));\n}\n"]}
@@ -2,14 +2,18 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Deferred } from "@fluidframework/common-utils";
5
+ import { Deferred } from "@fluidframework/core-utils";
6
6
  import { IDocumentService, IDocumentStorageService } from "@fluidframework/driver-definitions";
7
7
  import { ISequencedDocumentMessage, ISnapshotTree, IVersion } from "@fluidframework/protocol-definitions";
8
8
  import { ReadDocumentStorageServiceBase, ReplayController } from "@fluidframework/replay-driver";
9
- import { IDebuggerController, IDebuggerUI } from "./fluidDebuggerUi";
10
- export declare type debuggerUIFactory = (controller: IDebuggerController) => IDebuggerUI | null;
9
+ import { IDebuggerController, IDebuggerUI } from "./fluidDebuggerUi.mjs";
10
+ /**
11
+ * @internal
12
+ */
13
+ export type debuggerUIFactory = (controller: IDebuggerController) => IDebuggerUI | null;
11
14
  /**
12
15
  * Replay controller that uses pop-up window to control op playback
16
+ * @internal
13
17
  */
14
18
  export declare class DebugReplayController extends ReplayController implements IDebuggerController {
15
19
  static create(createUi: debuggerUIFactory): DebugReplayController | null;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluidDebuggerController.d.ts","sourceRoot":"","sources":["../src/fluidDebuggerController.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAU,QAAQ,EAAE,MAAM,4BAA4B;OACtD,EACN,gBAAgB,EAChB,uBAAuB,EAEvB,MAAM,oCAAoC;OAEpC,EAEN,yBAAyB,EACzB,aAAa,EACb,QAAQ,EACR,MAAM,sCAAsC;OACtC,EAGN,8BAA8B,EAC9B,gBAAgB,EAEhB,MAAM,+BAA+B;OAC/B,EAAE,mBAAmB,EAAE,WAAW,EAAE;AAG3C;;GAEG;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,mBAAmB,KAAK,WAAW,GAAG,IAAI,CAAC;AAExF;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,gBAAiB,YAAW,mBAAmB;WAE3E,MAAM,CAAC,QAAQ,EAAE,iBAAiB,GAAG,qBAAqB,GAAG,IAAI;IAW/E,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,MAAM;qBAExB,WAAW,CACjC,sBAAsB,EAAE,uBAAuB,EAC/C,IAAI,EAAE,aAAa,GAAG,IAAI,GACxB,OAAO,CAAC,MAAM,CAAC;IAalB,SAAS,CAAC,EAAE,EAAE,WAAW,CAA8B;IACvD,SAAS,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,SAAS,CAAC,gBAAgB,mBAA0B;IAGpD,SAAS,CAAC,wBAAwB,UAAS;IAE3C,SAAS,CAAC,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAC7C,SAAS,CAAC,sBAAsB,CAAC,EAAE,uBAAuB,CAAC;IAC3D,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAM;IACpC,SAAS,CAAC,W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