@fluidframework/debugger 2.91.0 → 2.93.0
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 +8 -0
- package/README.md +1 -1
- package/dist/fluidDebugger.d.ts +1 -1
- package/dist/fluidDebugger.d.ts.map +1 -1
- package/dist/fluidDebugger.js.map +1 -1
- package/dist/fluidDebuggerController.d.ts +4 -3
- package/dist/fluidDebuggerController.d.ts.map +1 -1
- package/dist/fluidDebuggerController.js +4 -4
- package/dist/fluidDebuggerController.js.map +1 -1
- package/dist/fluidDebuggerUi.d.ts +1 -1
- package/dist/fluidDebuggerUi.d.ts.map +1 -1
- package/dist/fluidDebuggerUi.js +25 -25
- package/dist/fluidDebuggerUi.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/messageSchema.d.ts +1 -1
- package/dist/messageSchema.d.ts.map +1 -1
- package/dist/messageSchema.js.map +1 -1
- package/dist/public.d.ts +1 -1
- package/dist/sanitize.js.map +1 -1
- package/dist/sanitizer.d.ts +1 -1
- package/dist/sanitizer.d.ts.map +1 -1
- package/dist/sanitizer.js +52 -50
- package/dist/sanitizer.js.map +1 -1
- package/eslint.config.mts +13 -4
- package/internal.d.ts +1 -1
- package/legacy.d.ts +1 -1
- package/lib/fluidDebugger.d.ts +1 -1
- package/lib/fluidDebugger.d.ts.map +1 -1
- package/lib/fluidDebugger.js.map +1 -1
- package/lib/fluidDebuggerController.d.ts +4 -3
- package/lib/fluidDebuggerController.d.ts.map +1 -1
- package/lib/fluidDebuggerController.js +4 -4
- package/lib/fluidDebuggerController.js.map +1 -1
- package/lib/fluidDebuggerUi.d.ts +1 -1
- package/lib/fluidDebuggerUi.d.ts.map +1 -1
- package/lib/fluidDebuggerUi.js +25 -25
- package/lib/fluidDebuggerUi.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/messageSchema.d.ts +1 -1
- package/lib/messageSchema.d.ts.map +1 -1
- package/lib/messageSchema.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/sanitize.js.map +1 -1
- package/lib/sanitizer.d.ts +1 -1
- package/lib/sanitizer.d.ts.map +1 -1
- package/lib/sanitizer.js +52 -50
- package/lib/sanitizer.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +16 -26
- package/src/fluidDebugger.ts +1 -1
- package/src/fluidDebuggerController.ts +10 -8
- package/src/fluidDebuggerUi.ts +26 -26
- package/src/index.ts +2 -2
- package/src/messageSchema.ts +1 -1
- package/src/sanitize.ts +1 -1
- package/src/sanitizer.ts +49 -47
- package/tsconfig.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidDebuggerUi.js","sourceRoot":"","sources":["../src/fluidDebuggerUi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAuG7D,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;QAgBnB,CAAC;AAET,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;QAepB,CAAC;AAET;;GAEG;AACH,MAAM,OAAO,UAAU;IACf,MAAM,CAAC,MAAM,CAAC,UAA+B;QACnD,IACC,OAAO,MAAM,KAAK,QAAQ;YAC1B,MAAM,KAAK,IAAI;YACf,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ;YACnC,MAAM,CAAC,QAAQ,IAAI,IAAI,EACtB,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;YACtE,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CACjC,EAAE,EACF,EAAE,EACF,4FAA4F,CAC5F,CAAC;QACF,IAAI,CAAC,cAA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MAAM,IAAI,GAAG,YAAY;YACxB,CAAC,CAAC,4BAA4B,WAAW,EAAE;YAC3C,CAAC,CAAC,4BAA4B,WAAW,EAAE,CAAC;QAC7C,IAAI,CAAC,UAAW,CAAC,WAAW,GAAG,IAAI,CAAC;IACrC,CAAC;IAEO,QAAQ,CAAC,QAAgB,EAAE,IAAY;QAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,iCAAiC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1F,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE3C,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAEnC,OAAO,CAAC,KAAK,EAAE,CAAC;QAEhB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIVersion,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * @internal\n */\nexport interface IDebuggerUI {\n\t/**\n\t * Version information is provided.\n\t * Expect updates (information about seq#, timestamp) through updateVersion() calls\n\t */\n\taddVersions(version: IVersion[]): void;\n\n\t/**\n\t * Call when new version is downloaded from storage\n\t * Expect multiple callbacks.\n\t */\n\tupdateVersion(index: number, version: IVersion, seqNumber: number): void;\n\n\t/**\n\t * Called in response to successful onVersionSelection() or onSnapshotFileSelection() call\n\t * and provides extra information about selection.\n\t * It expected that UI layer would change its mode as result of this call, i.e. switch to\n\t * displaying op playback controls (if this is supported)\n\t * Note: There maybe no call to versionSelected() in response to onSnapshotFileSelection() call\n\t * if file does not exist, has wrong name of wrong format.\n\t * @param version - version, file name, or undefined if playing ops.\n\t */\n\tversionSelected(seqNumber: number, version: IVersion | string): void;\n\n\t/**\n\t * Called by controller in response to new ops being downloaded\n\t * Called with disable = true if there are no (currently) ops to play\n\t */\n\tdisableNextOpButton(disable: boolean): void;\n\n\t/**\n\t * Called by controller when new ops arrive (or we are done playing previous batch)\n\t * Indicates next batch of ops that would be played when UI calls controller's onOpButtonClick()\n\t * Called with ops=[] when there are no ops to play.\n\t */\n\tupdateNextOpText(ops: ISequencedDocumentMessage[]): void;\n\n\t/**\n\t * Called periodically when new versions are downloaded from server\n\t */\n\tupdateVersionText(versionsLeft: number): void;\n\n\t/**\n\t * Called periodically to notify about last known op\n\t * @param lastKnownOp - seq number of last known op. -1 if can't play ops in this mode (load from file)\n\t * @param stillLoading - true if we did not reach yet the end of the stream\n\t */\n\tupdateLastOpText(lastKnownOp: number, stillLoading: boolean): void;\n}\n\n/**\n * @internal\n */\nexport interface IDebuggerController {\n\t/**\n\t * Initialization. UI layers calls into controller to connect the two.\n\t * @param ui - UI layer\n\t */\n\tconnectToUi(ui: IDebuggerUI);\n\n\t/**\n\t * Called by UI layer when debugger window is closed by user\n\t * If called before user makes selection of snapshot/file, original\n\t * document service is returned to loader (instead of debugger service) and normal document load continues.\n\t */\n\tonClose(): void;\n\n\t/**\n\t * UI Layer notifies about selection of version to continue.\n\t * On successful load, versionSelected() is called.\n\t * @param version - Snapshot version to start from.\n\t */\n\tonVersionSelection(version: IVersion): void;\n\n\t/**\n\t * UI Layer notifies about selection of version to continue.\n\t * On successful load, versionSelected() is called.\n\t * @param version - File to load snapshot from\n\t */\n\tonSnapshotFileSelection(file: File): void;\n\n\t/**\n\t * \"next op\" button is clicked in the UI\n\t * @param steps - number of ops to play.\n\t */\n\tonOpButtonClick(steps: number): void;\n\n\t/**\n\t * \"Download ops\" option is clicked in the UI. Returns JSON of the full opStream when available.\n\t * @param anonymize - anonymize the ops json using the sanitization tool\n\t */\n\tonDownloadOpsButtonClick(anonymize: boolean): Promise<string>;\n}\n\nconst debuggerWindowHtml = `<Title>Fluid Debugger</Title>\n<body>\n<h3>Fluid Debugger</h3>\nPlease select snapshot or file to start with<br/>\nClose debugger window to proceed to live document<br/><br/>\n<select style='width:250px' id='selector'>\n</select>\n \n<button id='buttonVers' style='width:60px'>Go</button><br/>\n<input id='file' type='file' value='Load from file'/>\n<br/><br/>\n<h4>Download the current document's ops</h4>\n<input type='checkbox' id='anonymize' value='Anonymize'>\n<label for='anonymize'>Anonymize</label>\n<button type='button' id='downloadOps'>Download ops</button>\n<br/><br/><div id='versionText'></div>\n</body>`;\n\nconst debuggerWindowHtml2 = `<Title>Fluid Debugger</Title>\n<body>\n<h3>Fluid Debugger</h3>\n<div id='versionText'></div>\n<div id='lastOp'></div>\n<br/>\nStep to move: <input type='number' id='steps' value='1' min='1' style='width:50px'/>\n <button id='buttonOps' style='width:60px'>Go</button>\n<br/><br/>\n<div id='text1'></div><div id='text2'></div><div id='text3'></div>\n<br/>\n<h4>Download the current document's ops</h4>\n<input type='checkbox' id='anonymize' value='Anonymize'>\n<label for='anonymize'>Anonymize</label>\n<button type='button' id='downloadOps'>Download ops</button>\n</body>`;\n\n/**\n * @internal\n */\nexport class DebuggerUI {\n\tpublic static create(controller: IDebuggerController): DebuggerUI | null {\n\t\tif (\n\t\t\ttypeof window !== \"object\" ||\n\t\t\twindow === null ||\n\t\t\ttypeof window.document !== \"object\" ||\n\t\t\twindow.document == null\n\t\t) {\n\t\t\tconsole.log(\"Can't create debugger window - not running in browser!\");\n\t\t\treturn null;\n\t\t}\n\n\t\tconst debuggerWindow = window.open(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"width=400,height=400,resizable=yes,location=no,menubar=no,titlebar=no,status=no,toolbar=no\",\n\t\t);\n\t\tif (!debuggerWindow) {\n\t\t\tconsole.error(\n\t\t\t\t\"Can't create debugger window - please enable pop-up windows in your browser!\",\n\t\t\t);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn new DebuggerUI(controller, debuggerWindow);\n\t}\n\n\tprivate static formatDate(date: number): string {\n\t\t// Alternative - without timezone\n\t\t// new Date().toLocaleString('default', { timeZone: 'UTC'}));\n\t\t// new Date().toLocaleString('default', { year: 'numeric', month: 'short',\n\t\t// day: 'numeric', hour: '2-digit', minute: 'numeric', second: 'numeric' }));\n\t\treturn new Date(date).toUTCString();\n\t}\n\n\tprotected selector?: HTMLSelectElement;\n\tprotected versionText: HTMLDivElement;\n\n\tprotected buttonOps?: HTMLButtonElement;\n\tprotected text1?: HTMLDivElement;\n\tprotected text2?: HTMLDivElement;\n\tprotected text3?: HTMLDivElement;\n\tprotected lastOpText?: HTMLDivElement;\n\tprotected wasVersionSelected = false;\n\tprotected versions: IVersion[] = [];\n\n\tprotected documentClosed = false;\n\n\tprotected constructor(\n\t\tprivate readonly controller: IDebuggerController,\n\t\tprivate readonly debuggerWindow: Window,\n\t) {\n\t\tconst doc = this.debuggerWindow.document;\n\t\tdoc.write(debuggerWindowHtml);\n\n\t\twindow.addEventListener(\n\t\t\t\"beforeunload\",\n\t\t\t(e) => {\n\t\t\t\tthis.documentClosed = true;\n\t\t\t\tthis.debuggerWindow.close();\n\t\t\t},\n\t\t\tfalse,\n\t\t);\n\n\t\tthis.debuggerWindow.addEventListener(\n\t\t\t\"beforeunload\",\n\t\t\t(e) => {\n\t\t\t\tif (!this.documentClosed) {\n\t\t\t\t\tthis.controller.onClose();\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t);\n\n\t\tthis.selector = doc.getElementById(\"selector\") as HTMLSelectElement;\n\n\t\tconst buttonVers = doc.getElementById(\"buttonVers\") as HTMLDivElement;\n\t\tbuttonVers.onclick = () => {\n\t\t\tconst index = this.selector!.selectedIndex;\n\t\t\t// TODO Why are we non null asserting here\n\t\t\tcontroller.onVersionSelection(this.versions[index]!);\n\t\t};\n\n\t\tconst fileSnapshot = doc.getElementById(\"file\") as HTMLInputElement;\n\t\tfileSnapshot.addEventListener(\n\t\t\t\"change\",\n\t\t\t() => {\n\t\t\t\tconst files = fileSnapshot.files;\n\t\t\t\tif (files) {\n\t\t\t\t\t// TODO Why are we non null asserting here\n\t\t\t\t\tcontroller.onSnapshotFileSelection(files[0]!);\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t);\n\n\t\tconst opDownloadButton = doc.getElementById(\"downloadOps\") as HTMLElement;\n\t\tconst anonymizeCheckbox = doc.getElementById(\"anonymize\") as HTMLInputElement;\n\t\tthis.attachDownloadOpsListener(opDownloadButton, anonymizeCheckbox);\n\n\t\tthis.versionText = doc.getElementById(\"versionText\") as HTMLDivElement;\n\t\tthis.versionText.textContent = \"Fetching snapshots, please wait...\";\n\n\t\tcontroller.connectToUi(this);\n\t}\n\n\tprivate attachDownloadOpsListener(element: HTMLElement, anonymize: HTMLInputElement): void {\n\t\telement.addEventListener(\"click\", () => {\n\t\t\tthis.controller\n\t\t\t\t.onDownloadOpsButtonClick(anonymize.checked)\n\t\t\t\t.then((opJson) => {\n\t\t\t\t\tthis.download(\"opStream.json\", opJson);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(`Error downloading ops: ${error}`);\n\t\t\t\t});\n\t\t});\n\t}\n\n\tpublic addVersions(versions: IVersion[]): void {\n\t\tif (this.selector) {\n\t\t\tthis.versions = versions;\n\t\t\tfor (const version of versions) {\n\t\t\t\tconst option = document.createElement(\"option\");\n\t\t\t\toption.text =\n\t\t\t\t\tversion.date !== undefined\n\t\t\t\t\t\t? `id = ${version.id}, time = ${version.date}`\n\t\t\t\t\t\t: `id = ${version.id}`;\n\t\t\t\tthis.selector.add(option);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic updateVersion(index: number, version: IVersion, seqNumber: number): void {\n\t\tif (this.selector) {\n\t\t\tconst option = this.selector[index] as HTMLOptionElement;\n\t\t\toption.text = `${option.text}, seq = ${seqNumber}`;\n\t\t\tthis.selector[index] = option;\n\t\t}\n\t}\n\n\tpublic versionSelected(seqNumber: number, version: IVersion | string): void {\n\t\tconst text =\n\t\t\ttypeof version === \"string\"\n\t\t\t\t? `Playing ${version} file`\n\t\t\t\t: `Playing from ${version.id}, seq# ${seqNumber}`;\n\n\t\tthis.wasVersionSelected = true;\n\t\tthis.selector = undefined;\n\n\t\tconst doc = this.debuggerWindow.document;\n\t\tdoc.open();\n\t\tdoc.write(debuggerWindowHtml2);\n\t\tdoc.close();\n\n\t\tthis.lastOpText = doc.getElementById(\"lastOp\") as HTMLDivElement;\n\t\tthis.text1 = doc.getElementById(\"text1\") as HTMLDivElement;\n\t\tthis.text2 = doc.getElementById(\"text2\") as HTMLDivElement;\n\t\tthis.text3 = doc.getElementById(\"text3\") as HTMLDivElement;\n\n\t\tconst steps = doc.getElementById(\"steps\") as HTMLInputElement;\n\t\tthis.buttonOps = doc.getElementById(\"buttonOps\") as HTMLButtonElement;\n\t\tthis.buttonOps.disabled = true;\n\t\tthis.buttonOps.onclick = () => {\n\t\t\tthis.controller.onOpButtonClick(Number(steps.value));\n\t\t};\n\n\t\tthis.versionText = doc.getElementById(\"versionText\") as HTMLDivElement;\n\t\tthis.versionText.textContent = text;\n\n\t\tconst opDownloadButton = doc.getElementById(\"downloadOps\") as HTMLElement;\n\t\tconst anonymizeCheckbox = doc.getElementById(\"anonymize\") as HTMLInputElement;\n\t\tthis.attachDownloadOpsListener(opDownloadButton, anonymizeCheckbox);\n\t}\n\n\tpublic disableNextOpButton(disable: boolean): void {\n\t\tassert(!!this.buttonOps, 0x088 /* \"Missing button ops button!\" */);\n\t\tthis.buttonOps.disabled = disable;\n\t}\n\n\tpublic updateNextOpText(ops: ISequencedDocumentMessage[]): void {\n\t\tif (ops.length === 0) {\n\t\t\tthis.text1!.textContent = \"\";\n\t\t\tthis.text2!.textContent = \"\";\n\t\t\tthis.text3!.textContent = \"\";\n\t\t} else {\n\t\t\t// Non null asserting here because of the length check above\n\t\t\tconst op = ops[0]!;\n\t\t\tconst seq = op.sequenceNumber;\n\t\t\tconst date = DebuggerUI.formatDate(op.timestamp);\n\t\t\tthis.text1!.textContent = `Next op seq#: ${seq}`;\n\t\t\tthis.text2!.textContent = `Type: ${op.type}`;\n\t\t\tthis.text3!.textContent = `${date}`;\n\t\t}\n\t}\n\n\tpublic updateVersionText(versionCount: number): void {\n\t\tif (!this.wasVersionSelected) {\n\t\t\tconst text =\n\t\t\t\tversionCount === 0 ? \"\" : `Fetching information about ${versionCount} snapshots...`;\n\t\t\tthis.versionText.textContent = text;\n\t\t}\n\t}\n\n\tpublic updateLastOpText(lastKnownOp: number, stillLoading: boolean): void {\n\t\tconst text = stillLoading\n\t\t\t? `Last op (still loading): ${lastKnownOp}`\n\t\t\t: `Document's last op seq#: ${lastKnownOp}`;\n\t\tthis.lastOpText!.textContent = text;\n\t}\n\n\tprivate download(filename: string, data: string): void {\n\t\tconst element = document.createElement(\"a\");\n\t\telement.setAttribute(\"href\", `data:text/plain;charset=utf-8,${encodeURIComponent(data)}`);\n\t\telement.setAttribute(\"download\", filename);\n\n\t\telement.style.display = \"none\";\n\t\tdocument.body.appendChild(element);\n\n\t\telement.click();\n\n\t\tdocument.body.removeChild(element);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fluidDebuggerUi.js","sourceRoot":"","sources":["../src/fluidDebuggerUi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAuG7D,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;QAgBnB,CAAC;AAET,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;QAepB,CAAC;AAET;;GAEG;AACH,MAAM,OAAO,UAAU;IACf,MAAM,CAAC,MAAM,CAAC,UAA+B;QACnD,IACC,OAAO,MAAM,KAAK,QAAQ;YAC1B,MAAM,KAAK,IAAI;YACf,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ;YACnC,MAAM,CAAC,QAAQ,K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CAAC,kBAAkB,EAAE,CAAC;YAC9B,MAAM,IAAI,GACT,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,8BAA8B,YAAY,eAAe,CAAC;YACrF,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;QACrC,CAAC;IACF,CAAC;IAEM,gBAAgB,CAAC,WAAmB,EAAE,YAAqB;QACjE,MAAM,IAAI,GAAG,YAAY;YACxB,CAAC,CAAC,4BAA4B,WAAW,EAAE;YAC3C,CAAC,CAAC,4BAA4B,WAAW,EAAE,CAAC;QAC7C,IAAI,CAAC,UAAW,CAAC,WAAW,GAAG,IAAI,CAAC;IACrC,CAAC;IAEO,QAAQ,CAAC,QAAgB,EAAE,IAAY;QAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC5C,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,iCAAiC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1F,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE3C,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAE9B,OAAO,CAAC,KAAK,EAAE,CAAC;QAEhB,OAAO,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIVersion,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * @internal\n */\nexport interface IDebuggerUI {\n\t/**\n\t * Version information is provided.\n\t * Expect updates (information about seq#, timestamp) through updateVersion() calls\n\t */\n\taddVersions(version: IVersion[]): void;\n\n\t/**\n\t * Call when new version is downloaded from storage\n\t * Expect multiple callbacks.\n\t */\n\tupdateVersion(index: number, version: IVersion, seqNumber: number): void;\n\n\t/**\n\t * Called in response to successful onVersionSelection() or onSnapshotFileSelection() call\n\t * and provides extra information about selection.\n\t * It expected that UI layer would change its mode as result of this call, i.e. switch to\n\t * displaying op playback controls (if this is supported)\n\t * Note: There maybe no call to versionSelected() in response to onSnapshotFileSelection() call\n\t * if file does not exist, has wrong name of wrong format.\n\t * @param version - version, file name, or undefined if playing ops.\n\t */\n\tversionSelected(seqNumber: number, version: IVersion | string): void;\n\n\t/**\n\t * Called by controller in response to new ops being downloaded\n\t * Called with disable = true if there are no (currently) ops to play\n\t */\n\tdisableNextOpButton(disable: boolean): void;\n\n\t/**\n\t * Called by controller when new ops arrive (or we are done playing previous batch)\n\t * Indicates next batch of ops that would be played when UI calls controller's onOpButtonClick()\n\t * Called with ops=[] when there are no ops to play.\n\t */\n\tupdateNextOpText(ops: ISequencedDocumentMessage[]): void;\n\n\t/**\n\t * Called periodically when new versions are downloaded from server\n\t */\n\tupdateVersionText(versionsLeft: number): void;\n\n\t/**\n\t * Called periodically to notify about last known op\n\t * @param lastKnownOp - seq number of last known op. -1 if can't play ops in this mode (load from file)\n\t * @param stillLoading - true if we did not reach yet the end of the stream\n\t */\n\tupdateLastOpText(lastKnownOp: number, stillLoading: boolean): void;\n}\n\n/**\n * @internal\n */\nexport interface IDebuggerController {\n\t/**\n\t * Initialization. UI layers calls into controller to connect the two.\n\t * @param ui - UI layer\n\t */\n\tconnectToUi(ui: IDebuggerUI);\n\n\t/**\n\t * Called by UI layer when debugger window is closed by user\n\t * If called before user makes selection of snapshot/file, original\n\t * document service is returned to loader (instead of debugger service) and normal document load continues.\n\t */\n\tonClose(): void;\n\n\t/**\n\t * UI Layer notifies about selection of version to continue.\n\t * On successful load, versionSelected() is called.\n\t * @param version - Snapshot version to start from.\n\t */\n\tonVersionSelection(version: IVersion): void;\n\n\t/**\n\t * UI Layer notifies about selection of version to continue.\n\t * On successful load, versionSelected() is called.\n\t * @param version - File to load snapshot from\n\t */\n\tonSnapshotFileSelection(file: File): void;\n\n\t/**\n\t * \"next op\" button is clicked in the UI\n\t * @param steps - number of ops to play.\n\t */\n\tonOpButtonClick(steps: number): void;\n\n\t/**\n\t * \"Download ops\" option is clicked in the UI. Returns JSON of the full opStream when available.\n\t * @param anonymize - anonymize the ops json using the sanitization tool\n\t */\n\tonDownloadOpsButtonClick(anonymize: boolean): Promise<string>;\n}\n\nconst debuggerWindowHtml = `<Title>Fluid Debugger</Title>\n<body>\n<h3>Fluid Debugger</h3>\nPlease select snapshot or file to start with<br/>\nClose debugger window to proceed to live document<br/><br/>\n<select style='width:250px' id='selector'>\n</select>\n \n<button id='buttonVers' style='width:60px'>Go</button><br/>\n<input id='file' type='file' value='Load from file'/>\n<br/><br/>\n<h4>Download the current document's ops</h4>\n<input type='checkbox' id='anonymize' value='Anonymize'>\n<label for='anonymize'>Anonymize</label>\n<button type='button' id='downloadOps'>Download ops</button>\n<br/><br/><div id='versionText'></div>\n</body>`;\n\nconst debuggerWindowHtml2 = `<Title>Fluid Debugger</Title>\n<body>\n<h3>Fluid Debugger</h3>\n<div id='versionText'></div>\n<div id='lastOp'></div>\n<br/>\nStep to move: <input type='number' id='steps' value='1' min='1' style='width:50px'/>\n <button id='buttonOps' style='width:60px'>Go</button>\n<br/><br/>\n<div id='text1'></div><div id='text2'></div><div id='text3'></div>\n<br/>\n<h4>Download the current document's ops</h4>\n<input type='checkbox' id='anonymize' value='Anonymize'>\n<label for='anonymize'>Anonymize</label>\n<button type='button' id='downloadOps'>Download ops</button>\n</body>`;\n\n/**\n * @internal\n */\nexport class DebuggerUI {\n\tpublic static create(controller: IDebuggerController): DebuggerUI | null {\n\t\tif (\n\t\t\ttypeof window !== \"object\" ||\n\t\t\twindow === null ||\n\t\t\ttypeof window.document !== \"object\" ||\n\t\t\twindow.document === null\n\t\t) {\n\t\t\tconsole.log(\"Can't create debugger window - not running in browser!\");\n\t\t\treturn null;\n\t\t}\n\n\t\tconst debuggerWindow = window.open(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"width=400,height=400,resizable=yes,location=no,menubar=no,titlebar=no,status=no,toolbar=no\",\n\t\t);\n\t\tif (!debuggerWindow) {\n\t\t\tconsole.error(\n\t\t\t\t\"Can't create debugger window - please enable pop-up windows in your browser!\",\n\t\t\t);\n\t\t\treturn null;\n\t\t}\n\n\t\treturn new DebuggerUI(controller, debuggerWindow);\n\t}\n\n\tprivate static formatDate(date: number): string {\n\t\t// Alternative - without timezone\n\t\t// new Date().toLocaleString('default', { timeZone: 'UTC'}));\n\t\t// new Date().toLocaleString('default', { year: 'numeric', month: 'short',\n\t\t// day: 'numeric', hour: '2-digit', minute: 'numeric', second: 'numeric' }));\n\t\treturn new Date(date).toUTCString();\n\t}\n\n\tprotected selector?: HTMLSelectElement;\n\tprotected versionText: HTMLDivElement;\n\n\tprotected buttonOps?: HTMLButtonElement;\n\tprotected text1?: HTMLDivElement;\n\tprotected text2?: HTMLDivElement;\n\tprotected text3?: HTMLDivElement;\n\tprotected lastOpText?: HTMLDivElement;\n\tprotected wasVersionSelected = false;\n\tprotected versions: IVersion[] = [];\n\n\tprotected documentClosed = false;\n\n\tprotected constructor(\n\t\tprivate readonly controller: IDebuggerController,\n\t\tprivate readonly debuggerWindow: Window,\n\t) {\n\t\tconst doc = this.debuggerWindow.document;\n\t\tdoc.write(debuggerWindowHtml);\n\n\t\twindow.addEventListener(\n\t\t\t\"beforeunload\",\n\t\t\t(e) => {\n\t\t\t\tthis.documentClosed = true;\n\t\t\t\tthis.debuggerWindow.close();\n\t\t\t},\n\t\t\tfalse,\n\t\t);\n\n\t\tthis.debuggerWindow.addEventListener(\n\t\t\t\"beforeunload\",\n\t\t\t(e) => {\n\t\t\t\tif (!this.documentClosed) {\n\t\t\t\t\tthis.controller.onClose();\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t);\n\n\t\tthis.selector = doc.querySelector(\"#selector\") as HTMLSelectElement;\n\n\t\tconst buttonVers = doc.querySelector(\"#buttonVers\") as HTMLDivElement;\n\t\tbuttonVers.addEventListener(\"click\", () => {\n\t\t\tconst index = this.selector!.selectedIndex;\n\t\t\t// TODO Why are we non null asserting here\n\t\t\tcontroller.onVersionSelection(this.versions[index]!);\n\t\t});\n\n\t\tconst fileSnapshot = doc.querySelector(\"#file\") as HTMLInputElement;\n\t\tfileSnapshot.addEventListener(\n\t\t\t\"change\",\n\t\t\t() => {\n\t\t\t\tconst files = fileSnapshot.files;\n\t\t\t\tif (files) {\n\t\t\t\t\t// TODO Why are we non null asserting here\n\t\t\t\t\tcontroller.onSnapshotFileSelection(files[0]!);\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t);\n\n\t\tconst opDownloadButton = doc.querySelector(\"#downloadOps\") as HTMLElement;\n\t\tconst anonymizeCheckbox = doc.querySelector(\"#anonymize\") as HTMLInputElement;\n\t\tthis.attachDownloadOpsListener(opDownloadButton, anonymizeCheckbox);\n\n\t\tthis.versionText = doc.querySelector(\"#versionText\") as HTMLDivElement;\n\t\tthis.versionText.textContent = \"Fetching snapshots, please wait...\";\n\n\t\tcontroller.connectToUi(this);\n\t}\n\n\tprivate attachDownloadOpsListener(element: HTMLElement, anonymize: HTMLInputElement): void {\n\t\telement.addEventListener(\"click\", () => {\n\t\t\tthis.controller\n\t\t\t\t.onDownloadOpsButtonClick(anonymize.checked)\n\t\t\t\t.then((opJson) => {\n\t\t\t\t\tthis.download(\"opStream.json\", opJson);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(`Error downloading ops: ${error}`);\n\t\t\t\t});\n\t\t});\n\t}\n\n\tpublic addVersions(versions: IVersion[]): void {\n\t\tif (this.selector) {\n\t\t\tthis.versions = versions;\n\t\t\tfor (const version of versions) {\n\t\t\t\tconst option = document.createElement(\"option\");\n\t\t\t\toption.text =\n\t\t\t\t\tversion.date === undefined\n\t\t\t\t\t\t? `id = ${version.id}`\n\t\t\t\t\t\t: `id = ${version.id}, time = ${version.date}`;\n\t\t\t\tthis.selector.add(option);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic updateVersion(index: number, version: IVersion, seqNumber: number): void {\n\t\tif (this.selector) {\n\t\t\tconst option = this.selector[index] as HTMLOptionElement;\n\t\t\toption.text = `${option.text}, seq = ${seqNumber}`;\n\t\t\tthis.selector[index] = option;\n\t\t}\n\t}\n\n\tpublic versionSelected(seqNumber: number, version: IVersion | string): void {\n\t\tconst text =\n\t\t\ttypeof version === \"string\"\n\t\t\t\t? `Playing ${version} file`\n\t\t\t\t: `Playing from ${version.id}, seq# ${seqNumber}`;\n\n\t\tthis.wasVersionSelected = true;\n\t\tthis.selector = undefined;\n\n\t\tconst doc = this.debuggerWindow.document;\n\t\tdoc.open();\n\t\tdoc.write(debuggerWindowHtml2);\n\t\tdoc.close();\n\n\t\tthis.lastOpText = doc.querySelector(\"#lastOp\") as HTMLDivElement;\n\t\tthis.text1 = doc.querySelector(\"#text1\") as HTMLDivElement;\n\t\tthis.text2 = doc.querySelector(\"#text2\") as HTMLDivElement;\n\t\tthis.text3 = doc.querySelector(\"#text3\") as HTMLDivElement;\n\n\t\tconst steps = doc.querySelector(\"#steps\") as HTMLInputElement;\n\t\tthis.buttonOps = doc.querySelector(\"#buttonOps\") as HTMLButtonElement;\n\t\tthis.buttonOps.disabled = true;\n\t\tthis.buttonOps.addEventListener(\"click\", () => {\n\t\t\tthis.controller.onOpButtonClick(Number(steps.value));\n\t\t});\n\n\t\tthis.versionText = doc.querySelector(\"#versionText\") as HTMLDivElement;\n\t\tthis.versionText.textContent = text;\n\n\t\tconst opDownloadButton = doc.querySelector(\"#downloadOps\") as HTMLElement;\n\t\tconst anonymizeCheckbox = doc.querySelector(\"#anonymize\") as HTMLInputElement;\n\t\tthis.attachDownloadOpsListener(opDownloadButton, anonymizeCheckbox);\n\t}\n\n\tpublic disableNextOpButton(disable: boolean): void {\n\t\tassert(!!this.buttonOps, 0x088 /* \"Missing button ops button!\" */);\n\t\tthis.buttonOps.disabled = disable;\n\t}\n\n\tpublic updateNextOpText(ops: ISequencedDocumentMessage[]): void {\n\t\tif (ops.length === 0) {\n\t\t\tthis.text1!.textContent = \"\";\n\t\t\tthis.text2!.textContent = \"\";\n\t\t\tthis.text3!.textContent = \"\";\n\t\t} else {\n\t\t\t// Non null asserting here because of the length check above\n\t\t\tconst op = ops[0]!;\n\t\t\tconst seq = op.sequenceNumber;\n\t\t\tconst date = DebuggerUI.formatDate(op.timestamp);\n\t\t\tthis.text1!.textContent = `Next op seq#: ${seq}`;\n\t\t\tthis.text2!.textContent = `Type: ${op.type}`;\n\t\t\tthis.text3!.textContent = `${date}`;\n\t\t}\n\t}\n\n\tpublic updateVersionText(versionCount: number): void {\n\t\tif (!this.wasVersionSelected) {\n\t\t\tconst text =\n\t\t\t\tversionCount === 0 ? \"\" : `Fetching information about ${versionCount} snapshots...`;\n\t\t\tthis.versionText.textContent = text;\n\t\t}\n\t}\n\n\tpublic updateLastOpText(lastKnownOp: number, stillLoading: boolean): void {\n\t\tconst text = stillLoading\n\t\t\t? `Last op (still loading): ${lastKnownOp}`\n\t\t\t: `Document's last op seq#: ${lastKnownOp}`;\n\t\tthis.lastOpText!.textContent = text;\n\t}\n\n\tprivate download(filename: string, data: string): void {\n\t\tconst element = document.createElement(\"a\");\n\t\telement.setAttribute(\"href\", `data:text/plain;charset=utf-8,${encodeURIComponent(data)}`);\n\t\telement.setAttribute(\"download\", filename);\n\n\t\telement.style.display = \"none\";\n\t\tdocument.body.append(element);\n\n\t\telement.click();\n\n\t\telement.remove();\n\t}\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { FluidDebugger } from "./fluidDebugger.js";
|
|
6
|
-
export { debuggerUIFactory, DebugReplayController } from "./fluidDebuggerController.js";
|
|
7
|
-
export { DebuggerUI, IDebuggerController, IDebuggerUI } from "./fluidDebuggerUi.js";
|
|
6
|
+
export { type debuggerUIFactory, DebugReplayController } from "./fluidDebuggerController.js";
|
|
7
|
+
export { DebuggerUI, type IDebuggerController, type IDebuggerUI } from "./fluidDebuggerUi.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAA0B,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,UAAU,EAA8C,MAAM,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { FluidDebugger } from \"./fluidDebugger.js\";\nexport { type debuggerUIFactory, DebugReplayController } from \"./fluidDebuggerController.js\";\nexport { DebuggerUI, type IDebuggerController, type IDebuggerUI } from \"./fluidDebuggerUi.js\";\n"]}
|
package/lib/legacy.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export {
|
package/lib/messageSchema.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { Schema } from "jsonschema";
|
|
5
|
+
import type { Schema } from "jsonschema";
|
|
6
6
|
export declare const joinContentsSchema: {
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageSchema.d.ts","sourceRoot":"","sources":["../src/messageSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"messageSchema.d.ts","sourceRoot":"","sources":["../src/messageSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,kBAAkB;;CAE9B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B1B,CAAC;AAEF,eAAO,M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AAE;SACxC;QACD,IAAI,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,CAAC,CAAC,8BAA8B;YACzC,OAAO,EAAE,CAAC,CAAC,8BAA8B;SACzC;KACD;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,KAAK;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC/C,WAAW,EAAE;QACZ,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,sBAAsB;KAC/B;IACD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACX,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE;KAC3C;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IACjC,oBAAoB,EAAE,KAAK;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC/C,WAAW,EAAE;QACZ,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,sBAAsB;QAC/B,OAAO,EAAE,sBAAsB;KAC/B;IACD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACX,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE;KAC3C;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IACjC,oBAAoB,EAAE,KAAK;CAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Schema } from \"jsonschema\";\n\nexport const joinContentsSchema = {\n\ttype: \"null\",\n};\n\nexport const joinDataSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tclientId: { type: \"string\" },\n\t\tdetail: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tdetails: { type: \"object\" },\n\t\t\t\tmode: { type: \"string\" },\n\t\t\t\tpermission: { type: \"array\" },\n\t\t\t\tscopes: { type: \"array\" },\n\t\t\t\ttype: { type: \"string\" },\n\t\t\t\tuser: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tid: { type: \"string\" },\n\t\t\t\t\t\tname: { type: \"string\" },\n\t\t\t\t\t\temail: { type: \"string\" },\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"id\", \"name\", \"email\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: [\"user\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t},\n\trequired: [\"clientId\", \"detail\"],\n\tadditionalProperties: false,\n};\n\nexport const proposeContentsSchema = {\n\ttype: [\"string\", \"object\"],\n\tproperties: {\n\t\tkey: { type: \"string\" },\n\t\tvalue: { type: \"string\" },\n\t},\n\trequired: [\"key\"],\n\tadditionalProperties: false,\n};\n\n// The parsed json of a propose message's contents value\nexport const proposeCodeSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tkey: { type: \"string\" },\n\t\tvalue: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tpackage: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tname: { type: \"string\" },\n\t\t\t\t\t\tversion: { type: \"string\" },\n\t\t\t\t\t\tfluid: { type: \"object\" },\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"name\"],\n\t\t\t\t},\n\t\t\t\tconfig: { type: \"object\" },\n\t\t\t},\n\t\t\trequired: [\"package\", \"config\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t},\n\trequired: [\"key\", \"value\"],\n\tadditionalProperties: false,\n};\n\n// This also needs to be in the root \"definitions\" key as \"entries\" to be used\nconst attachSnapshotEntriesSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tmode: { type: \"string\" },\n\t\tpath: { type: \"string\" },\n\t\ttype: { enum: [\"Blob\", \"Tree\"] },\n\t\tvalue: {\n\t\t\ttype: \"object\",\n\t\t\toneOf: [\n\t\t\t\t// type Blob\n\t\t\t\t{\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tcontents: { type: \"string\" },\n\t\t\t\t\t\tencoding: { type: \"string\" },\n\t\t\t\t\t\t// Verify this\n\t\t\t\t\t\tid: { type: \"null\" },\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"contents\", \"encoding\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t\t// type Tree\n\t\t\t\t{\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tentries: {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\titems: { $ref: \"#/definitions/entries\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// Verify this\n\t\t\t\t\t\tid: { type: \"null\" },\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"entries\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\trequired: [\"mode\", \"path\", \"type\", \"value\"],\n\tadditionalProperties: false,\n};\n\nexport const attachContentsSchema = {\n\tdefinitions: {\n\t\tentries: attachSnapshotEntriesSchema,\n\t},\n\ttype: \"object\",\n\tproperties: {\n\t\tid: { type: \"string\" },\n\t\tsnapshot: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tentries: {\n\t\t\t\t\ttype: \"array\",\n\t\t\t\t\titems: { $ref: \"#/definitions/entries\" },\n\t\t\t\t},\n\t\t\t\t// Verify this\n\t\t\t\tid: { type: \"null\" },\n\t\t\t},\n\t\t\trequired: [\"entries\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\ttype: { type: \"string\" },\n\t},\n\trequired: [\"id\", \"snapshot\", \"type\"],\n\tadditionalProperties: false,\n};\n\n// can exist at the root level or within an op\nexport const chunkedOpContentsSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tchunkId: { type: \"number\" },\n\t\tcontents: { type: \"string\" },\n\t\ttotalChunks: { type: \"number\" },\n\t},\n\trequired: [\"chunkId\", \"contents\", \"totalChunks\"],\n\tadditionalProperties: false,\n};\n\nconst contentsSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tcontent: { type: \"object\" },\n\t\t\t\ttype: { type: \"string\" },\n\t\t\t},\n\t\t\trequired: [\"content\", \"type\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n\n// special contents formats from containerRuntime.ts's ContainerMessageType\nexport const opContentsSchema = {\n\tdefinitions: {\n\t\tcontent: contentsSchema,\n\t\tentries: attachSnapshotEntriesSchema,\n\t\tattachContents: attachContentsSchema,\n\t\tchunkedOpContents: chunkedOpContentsSchema,\n\t},\n\ttype: \"object\",\n\toneOf: [\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [\"component\"] },\n\t\t\t\tcontents: { $ref: \"#/definitions/content\" },\n\t\t\t},\n\t\t\trequired: [\"type\", \"contents\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [\"attach\"] },\n\t\t\t\tcontents: { $ref: \"#/definitions/attachContents\" },\n\t\t\t},\n\t\t\trequired: [\"type\", \"contents\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [\"chunkedOp\"] },\n\t\t\t\tcontents: { $ref: \"#/definitions/chunkedOpContents\" },\n\t\t\t},\n\t\t\trequired: [\"type\", \"contents\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\t$ref: \"#/definitions/content\",\n\t\t},\n\t],\n};\n\n// \"op\" message's contents.contents.content schemas\n\nexport const opContentsAttachSchema = attachContentsSchema;\n\n// Ops from dds/register-collection's consensusRegisterCollection\nexport const opContentsRegisterCollectionSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tkey: { type: \"string\" },\n\t\t\t\trefSeq: { type: \"number\" },\n\t\t\t\tserializedValue: { type: \"string\" },\n\t\t\t\tvalue: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\ttype: { type: \"string\" },\n\t\t\t\t\t\tvalue: {},\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"type\", \"value\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t\ttype: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tenum: [\"write\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: [\"key\", \"type\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n\n// Ops from dds/map's directory.ts\nexport const opContentsMapSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tkey: { type: \"string\" },\n\t\t\t\tpath: { type: \"string\" },\n\t\t\t\tsubdirName: { type: \"string\" },\n\t\t\t\tvalue: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\ttype: { type: \"string\" },\n\t\t\t\t\t\tvalue: {},\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"type\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t\ttype: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tenum: [\"act\", \"set\", \"delete\", \"clear\", \"createSubDirectory\", \"deleteSubDirectory\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: [\"type\"],\n\t\t\tadditionalProperties: false,\n\t\t\t// specific property combinations based on type value\n\t\t\toneOf: [\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"act\"] } },\n\t\t\t\t\trequired: [\"key\", \"path\", \"value\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"set\"] } },\n\t\t\t\t\trequired: [\"key\", \"value\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"delete\"] } },\n\t\t\t\t\trequired: [\"key\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"clear\"] } },\n\t\t\t\t\trequired: [\"path\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"createSubDirectory\", \"deleteSubDirectory\"] } },\n\t\t\t\t\trequired: [\"path\", \"subdirName\"],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n\n// from dds/merge-tree's ops.ts and opBuilder.ts\n// Note: written op objects in opBuilder.ts are more restrictive than their\n// corresponding interface definitions in ops.ts, and the more restrictive\n// schema are used here\nconst mergeTreeRelativePosSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tid: { type: \"string\" },\n\t\tbefore: { type: \"boolean\" },\n\t\toffset: { type: \"number\" },\n\t},\n\tadditionalProperties: false,\n};\n\nconst mergeTreeDeltaOpSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\ttype: {\n\t\t\ttype: \"number\",\n\t\t\tminimum: 0 /* MergeTreeDeltaType.INSERT */,\n\t\t\tmaximum: 2 /* MergeTreeDeltaType.ANNOTATE */,\n\t\t},\n\t},\n\trequired: [\"type\"],\n\toneOf: [\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [0] },\n\t\t\t\tseg: { type: [\"string\", \"object\"] },\n\t\t\t\tpos1: { type: \"number\" },\n\t\t\t},\n\t\t\trequired: [\"pos1\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [1] },\n\t\t\t\tregister: { type: \"string\" },\n\t\t\t\tpos1: { type: \"number\" },\n\t\t\t\tpos2: { type: \"number\" },\n\t\t\t},\n\t\t\trequired: [\"pos1\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [2] },\n\t\t\t\tpos1: { type: \"number\" },\n\t\t\t\tpos2: { type: \"number\" },\n\t\t\t\tprops: { type: \"object\" },\n\t\t\t\tregister: { type: \"string\" },\n\t\t\t\trelativePos1: { $ref: \"#/definitions/relativePos\" },\n\t\t\t\trelativePos2: { $ref: \"#/definitions/relativePos\" },\n\t\t\t},\n\t\t\trequired: [\"props\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t// There's something weird with the typings/settings here where this doesn't get\n\t\t// recognized as a valid Schema array if more than 1 item has \"properties\" defined\n\t] as Schema[],\n};\n\nconst mergeTreeGroupOpSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tops: {\n\t\t\ttype: \"array\",\n\t\t\titems: { $ref: \"#/definitions/deltaOp\" },\n\t\t},\n\t\ttype: {\n\t\t\ttype: \"number\",\n\t\t\tminimum: 3 /* MergeTreeDeltaType.GROUP */,\n\t\t\tmaximum: 3 /* MergeTreeDeltaType.GROUP */,\n\t\t},\n\t},\n\trequired: [\"ops\", \"type\"],\n\tadditionalProperties: false,\n};\n\nexport const opContentsMergeTreeDeltaOpSchema = {\n\tdefinitions: {\n\t\trelativePos: mergeTreeRelativePosSchema,\n\t\tdeltaOp: mergeTreeDeltaOpSchema,\n\t},\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: { $ref: \"#/definitions/deltaOp\" },\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n\nexport const opContentsMergeTreeGroupOpSchema = {\n\tdefinitions: {\n\t\trelativePos: mergeTreeRelativePosSchema,\n\t\tdeltaOp: mergeTreeDeltaOpSchema,\n\t\tgroupOp: mergeTreeGroupOpSchema,\n\t},\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: { $ref: \"#/definitions/groupOp\" },\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"messageSchema.js","sourceRoot":"","sources":["../src/messageSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC,IAAI,EAAE,MAAM;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACX,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,MAAM,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACX,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;gBAC7B,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;gBACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,IAAI,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACX,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBACzB;oBACD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC;oBACjC,oBAAoB,EAAE,KAAK;iBAC3B;aACD;YACD,QAAQ,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KAC3C;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IACjC,oBAAoB,EAAE,KAAK;CAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Schema } from \"jsonschema\";\n\nexport const joinContentsSchema = {\n\ttype: \"null\",\n};\n\nexport const joinDataSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tclientId: { type: \"string\" },\n\t\tdetail: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tdetails: { type: \"object\" },\n\t\t\t\tmode: { type: \"string\" },\n\t\t\t\tpermission: { type: \"array\" },\n\t\t\t\tscopes: { type: \"array\" },\n\t\t\t\ttype: { type: \"string\" },\n\t\t\t\tuser: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tid: { type: \"string\" },\n\t\t\t\t\t\tname: { type: \"string\" },\n\t\t\t\t\t\temail: { type: \"string\" },\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"id\", \"name\", \"email\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: [\"user\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t},\n\trequired: [\"clientId\", \"detail\"],\n\tadditionalProperties: false,\n};\n\nexport const proposeContentsSchema = {\n\ttype: [\"string\", \"object\"],\n\tproperties: {\n\t\tkey: { type: \"string\" },\n\t\tvalue: { type: \"string\" },\n\t},\n\trequired: [\"key\"],\n\tadditionalProperties: false,\n};\n\n// The parsed json of a propose message's contents value\nexport const proposeCodeSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tkey: { type: \"string\" },\n\t\tvalue: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tpackage: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tname: { type: \"string\" },\n\t\t\t\t\t\tversion: { type: \"string\" },\n\t\t\t\t\t\tfluid: { type: \"object\" },\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"name\"],\n\t\t\t\t},\n\t\t\t\tconfig: { type: \"object\" },\n\t\t\t},\n\t\t\trequired: [\"package\", \"config\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t},\n\trequired: [\"key\", \"value\"],\n\tadditionalProperties: false,\n};\n\n// This also needs to be in the root \"definitions\" key as \"entries\" to be used\nconst attachSnapshotEntriesSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tmode: { type: \"string\" },\n\t\tpath: { type: \"string\" },\n\t\ttype: { enum: [\"Blob\", \"Tree\"] },\n\t\tvalue: {\n\t\t\ttype: \"object\",\n\t\t\toneOf: [\n\t\t\t\t// type Blob\n\t\t\t\t{\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tcontents: { type: \"string\" },\n\t\t\t\t\t\tencoding: { type: \"string\" },\n\t\t\t\t\t\t// Verify this\n\t\t\t\t\t\tid: { type: \"null\" },\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"contents\", \"encoding\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t\t// type Tree\n\t\t\t\t{\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tentries: {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\titems: { $ref: \"#/definitions/entries\" },\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// Verify this\n\t\t\t\t\t\tid: { type: \"null\" },\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"entries\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\trequired: [\"mode\", \"path\", \"type\", \"value\"],\n\tadditionalProperties: false,\n};\n\nexport const attachContentsSchema = {\n\tdefinitions: {\n\t\tentries: attachSnapshotEntriesSchema,\n\t},\n\ttype: \"object\",\n\tproperties: {\n\t\tid: { type: \"string\" },\n\t\tsnapshot: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tentries: {\n\t\t\t\t\ttype: \"array\",\n\t\t\t\t\titems: { $ref: \"#/definitions/entries\" },\n\t\t\t\t},\n\t\t\t\t// Verify this\n\t\t\t\tid: { type: \"null\" },\n\t\t\t},\n\t\t\trequired: [\"entries\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\ttype: { type: \"string\" },\n\t},\n\trequired: [\"id\", \"snapshot\", \"type\"],\n\tadditionalProperties: false,\n};\n\n// can exist at the root level or within an op\nexport const chunkedOpContentsSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tchunkId: { type: \"number\" },\n\t\tcontents: { type: \"string\" },\n\t\ttotalChunks: { type: \"number\" },\n\t},\n\trequired: [\"chunkId\", \"contents\", \"totalChunks\"],\n\tadditionalProperties: false,\n};\n\nconst contentsSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tcontent: { type: \"object\" },\n\t\t\t\ttype: { type: \"string\" },\n\t\t\t},\n\t\t\trequired: [\"content\", \"type\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n\n// special contents formats from containerRuntime.ts's ContainerMessageType\nexport const opContentsSchema = {\n\tdefinitions: {\n\t\tcontent: contentsSchema,\n\t\tentries: attachSnapshotEntriesSchema,\n\t\tattachContents: attachContentsSchema,\n\t\tchunkedOpContents: chunkedOpContentsSchema,\n\t},\n\ttype: \"object\",\n\toneOf: [\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [\"component\"] },\n\t\t\t\tcontents: { $ref: \"#/definitions/content\" },\n\t\t\t},\n\t\t\trequired: [\"type\", \"contents\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [\"attach\"] },\n\t\t\t\tcontents: { $ref: \"#/definitions/attachContents\" },\n\t\t\t},\n\t\t\trequired: [\"type\", \"contents\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [\"chunkedOp\"] },\n\t\t\t\tcontents: { $ref: \"#/definitions/chunkedOpContents\" },\n\t\t\t},\n\t\t\trequired: [\"type\", \"contents\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\t$ref: \"#/definitions/content\",\n\t\t},\n\t],\n};\n\n// \"op\" message's contents.contents.content schemas\n\nexport const opContentsAttachSchema = attachContentsSchema;\n\n// Ops from dds/register-collection's consensusRegisterCollection\nexport const opContentsRegisterCollectionSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tkey: { type: \"string\" },\n\t\t\t\trefSeq: { type: \"number\" },\n\t\t\t\tserializedValue: { type: \"string\" },\n\t\t\t\tvalue: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\ttype: { type: \"string\" },\n\t\t\t\t\t\tvalue: {},\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"type\", \"value\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t\ttype: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tenum: [\"write\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: [\"key\", \"type\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n\n// Ops from dds/map's directory.ts\nexport const opContentsMapSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tkey: { type: \"string\" },\n\t\t\t\tpath: { type: \"string\" },\n\t\t\t\tsubdirName: { type: \"string\" },\n\t\t\t\tvalue: {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\ttype: { type: \"string\" },\n\t\t\t\t\t\tvalue: {},\n\t\t\t\t\t},\n\t\t\t\t\trequired: [\"type\"],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t},\n\t\t\t\ttype: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tenum: [\"act\", \"set\", \"delete\", \"clear\", \"createSubDirectory\", \"deleteSubDirectory\"],\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: [\"type\"],\n\t\t\tadditionalProperties: false,\n\t\t\t// specific property combinations based on type value\n\t\t\toneOf: [\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"act\"] } },\n\t\t\t\t\trequired: [\"key\", \"path\", \"value\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"set\"] } },\n\t\t\t\t\trequired: [\"key\", \"value\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"delete\"] } },\n\t\t\t\t\trequired: [\"key\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"clear\"] } },\n\t\t\t\t\trequired: [\"path\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tproperties: { type: { enum: [\"createSubDirectory\", \"deleteSubDirectory\"] } },\n\t\t\t\t\trequired: [\"path\", \"subdirName\"],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n\n// from dds/merge-tree's ops.ts and opBuilder.ts\n// Note: written op objects in opBuilder.ts are more restrictive than their\n// corresponding interface definitions in ops.ts, and the more restrictive\n// schema are used here\nconst mergeTreeRelativePosSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tid: { type: \"string\" },\n\t\tbefore: { type: \"boolean\" },\n\t\toffset: { type: \"number\" },\n\t},\n\tadditionalProperties: false,\n};\n\nconst mergeTreeDeltaOpSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\ttype: {\n\t\t\ttype: \"number\",\n\t\t\tminimum: 0 /* MergeTreeDeltaType.INSERT */,\n\t\t\tmaximum: 2 /* MergeTreeDeltaType.ANNOTATE */,\n\t\t},\n\t},\n\trequired: [\"type\"],\n\toneOf: [\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [0] },\n\t\t\t\tseg: { type: [\"string\", \"object\"] },\n\t\t\t\tpos1: { type: \"number\" },\n\t\t\t},\n\t\t\trequired: [\"pos1\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [1] },\n\t\t\t\tregister: { type: \"string\" },\n\t\t\t\tpos1: { type: \"number\" },\n\t\t\t\tpos2: { type: \"number\" },\n\t\t\t},\n\t\t\trequired: [\"pos1\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t{\n\t\t\tproperties: {\n\t\t\t\ttype: { enum: [2] },\n\t\t\t\tpos1: { type: \"number\" },\n\t\t\t\tpos2: { type: \"number\" },\n\t\t\t\tprops: { type: \"object\" },\n\t\t\t\tregister: { type: \"string\" },\n\t\t\t\trelativePos1: { $ref: \"#/definitions/relativePos\" },\n\t\t\t\trelativePos2: { $ref: \"#/definitions/relativePos\" },\n\t\t\t},\n\t\t\trequired: [\"props\"],\n\t\t\tadditionalProperties: false,\n\t\t},\n\t\t// There's something weird with the typings/settings here where this doesn't get\n\t\t// recognized as a valid Schema array if more than 1 item has \"properties\" defined\n\t] as Schema[],\n};\n\nconst mergeTreeGroupOpSchema = {\n\ttype: \"object\",\n\tproperties: {\n\t\tops: {\n\t\t\ttype: \"array\",\n\t\t\titems: { $ref: \"#/definitions/deltaOp\" },\n\t\t},\n\t\ttype: {\n\t\t\ttype: \"number\",\n\t\t\tminimum: 3 /* MergeTreeDeltaType.GROUP */,\n\t\t\tmaximum: 3 /* MergeTreeDeltaType.GROUP */,\n\t\t},\n\t},\n\trequired: [\"ops\", \"type\"],\n\tadditionalProperties: false,\n};\n\nexport const opContentsMergeTreeDeltaOpSchema = {\n\tdefinitions: {\n\t\trelativePos: mergeTreeRelativePosSchema,\n\t\tdeltaOp: mergeTreeDeltaOpSchema,\n\t},\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: { $ref: \"#/definitions/deltaOp\" },\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n\nexport const opContentsMergeTreeGroupOpSchema = {\n\tdefinitions: {\n\t\trelativePos: mergeTreeRelativePosSchema,\n\t\tdeltaOp: mergeTreeDeltaOpSchema,\n\t\tgroupOp: mergeTreeGroupOpSchema,\n\t},\n\ttype: \"object\",\n\tproperties: {\n\t\taddress: { type: \"string\" },\n\t\tcontents: { $ref: \"#/definitions/groupOp\" },\n\t},\n\trequired: [\"address\", \"contents\"],\n\tadditionalProperties: false,\n};\n"]}
|
package/lib/public.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export {}
|
package/lib/sanitize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.js","sourceRoot":"","sources":["../src/sanitize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,OAAO,MAAM,cAAc,CAAC;AAInC,OAAO,EAAE,SA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;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,4DAA4D;QAC5D,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC;YACpC,4DAA4D;YAC5D,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC;IACF,CAAC;IACD,UAAU,EAAE,CAAC;AACd,CAAC;AAED,IAAI,EAAE,CAAC","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 fs from \"node:fs\";\nimport process from \"node:process\";\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport { Sanitizer } from \"./sanitizer.js\";\n\nfunction printUsage(): void {\n\tconsole.log(\"Usage:\");\n\tconsole.log(\" node sanitize [--full | --noBail] <input>\");\n\tconsole.log(\"Where\");\n\tconsole.log(\" [--full] - scrub fully (result cannot be loaded in Fluid Preview)\");\n\tconsole.log(\n\t\t\" [--noBail] - don't bail out when encountering an unknown message format (it won't be scrubbed\",\n\t);\n\tconsole.log(\" <input> - file path to message.json - file downloaded by FluidFetch tool\");\n\tconsole.log(\"Note: <input> is sanitized in place\");\n\tprocess.exit(-1);\n}\n\nfunction Sanitize(msgPath: string, fullScrub: boolean, noBail: boolean): void {\n\tconst input = fs.readFileSync(msgPath, { encoding: \"utf-8\" });\n\tconst messages = JSON.parse(input) as ISequencedDocumentMessage[];\n\n\tconst sanitizer = new Sanitizer(messages, fullScrub, noBail, true);\n\tconst cleanMessages = sanitizer.sanitize();\n\n\tfs.writeFileSync(msgPath, JSON.stringify(cleanMessages, undefined, 2));\n\n\tconsole.log(\"Done.\");\n}\n\nfunction main(): void {\n\tif (process.argv.length === 3) {\n\t\t// Non null asserting here because of the length check above\n\t\treturn Sanitize(process.argv[2]!, false, false);\n\t}\n\tif (process.argv.length === 4) {\n\t\t// Non null asserting here because of the length check above\n\t\tif (process.argv[2] === \"--full\") {\n\t\t\treturn Sanitize(process.argv[3]!, true, false);\n\t\t}\n\t\tif (process.argv[2] === \"--noBail\") {\n\t\t\t// Non null asserting here because of the length check above\n\t\t\treturn Sanitize(process.argv[3]!, false, true);\n\t\t}\n\t}\n\tprintUsage();\n}\n\nmain();\n"]}
|
|
1
|
+
{"version":3,"file":"sanitize.js","sourceRoot":"","sources":["../src/sanitize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,OAAO,MAAM,cAAc,CAAC;AAInC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,SAAS,UAAU;IAClB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;IACnF,OAAO,CAAC,GAAG,C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I,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC;YACpC,4DAA4D;YAC5D,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC;IACF,CAAC;IACD,UAAU,EAAE,CAAC;AACd,CAAC;AAED,IAAI,EAAE,CAAC","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 fs from \"node:fs\";\nimport process from \"node:process\";\n\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\n\nimport { Sanitizer } from \"./sanitizer.js\";\n\nfunction printUsage(): void {\n\tconsole.log(\"Usage:\");\n\tconsole.log(\" node sanitize [--full | --noBail] <input>\");\n\tconsole.log(\"Where\");\n\tconsole.log(\" [--full] - scrub fully (result cannot be loaded in Fluid Preview)\");\n\tconsole.log(\n\t\t\" [--noBail] - don't bail out when encountering an unknown message format (it won't be scrubbed\",\n\t);\n\tconsole.log(\" <input> - file path to message.json - file downloaded by FluidFetch tool\");\n\tconsole.log(\"Note: <input> is sanitized in place\");\n\tprocess.exit(-1);\n}\n\nfunction Sanitize(msgPath: string, fullScrub: boolean, noBail: boolean): void {\n\tconst input = fs.readFileSync(msgPath, { encoding: \"utf-8\" });\n\tconst messages = JSON.parse(input) as ISequencedDocumentMessage[];\n\n\tconst sanitizer = new Sanitizer(messages, fullScrub, noBail, true);\n\tconst cleanMessages = sanitizer.sanitize();\n\n\tfs.writeFileSync(msgPath, JSON.stringify(cleanMessages, undefined, 2));\n\n\tconsole.log(\"Done.\");\n}\n\nfunction main(): void {\n\tif (process.argv.length === 3) {\n\t\t// Non null asserting here because of the length check above\n\t\treturn Sanitize(process.argv[2]!, false, false);\n\t}\n\tif (process.argv.length === 4) {\n\t\t// Non null asserting here because of the length check above\n\t\tif (process.argv[2] === \"--full\") {\n\t\t\treturn Sanitize(process.argv[3]!, true, false);\n\t\t}\n\t\tif (process.argv[2] === \"--noBail\") {\n\t\t\t// Non null asserting here because of the length check above\n\t\t\treturn Sanitize(process.argv[3]!, false, true);\n\t\t}\n\t}\n\tprintUsage();\n}\n\nmain();\n"]}
|
package/lib/sanitizer.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
5
|
+
import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
6
6
|
import * as Validator from "jsonschema";
|
|
7
7
|
declare enum TextType {
|
|
8
8
|
Generic = 0,
|
package/lib/sanitizer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizer.d.ts","sourceRoot":"","sources":["../src/sanitizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"sanitizer.d.ts","sourceRoot":"","sources":["../src/sanitizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAexC,aAAK,QAAQ;IACZ,O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AAK,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IA2DzB;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAahC,QAAQ,IAAI,yBAAyB,EAAE;CAsDvC"}
|
package/lib/sanitizer.js
CHANGED
|
@@ -80,8 +80,8 @@ class ChunkedOpProcessor {
|
|
|
80
80
|
parsed = parsed.contents;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
catch (
|
|
84
|
-
this.debugMsg(
|
|
83
|
+
catch (error) {
|
|
84
|
+
this.debugMsg(error);
|
|
85
85
|
this.debugMsg(message.contents);
|
|
86
86
|
}
|
|
87
87
|
this.validateSchemaFn(parsed, chunkedOpContentsSchema);
|
|
@@ -103,9 +103,9 @@ class ChunkedOpProcessor {
|
|
|
103
103
|
try {
|
|
104
104
|
return JSON.parse(contentsString);
|
|
105
105
|
}
|
|
106
|
-
catch (
|
|
106
|
+
catch (error) {
|
|
107
107
|
this.debugMsg(contentsString);
|
|
108
|
-
this.debugMsg(
|
|
108
|
+
this.debugMsg(error);
|
|
109
109
|
return undefined;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -123,9 +123,9 @@ class ChunkedOpProcessor {
|
|
|
123
123
|
stringified = JSON.stringify(contents);
|
|
124
124
|
assert(stringified.length <= this.concatenatedLength, 0x089 /* "Stringified length of chunk contents > total starting length" */);
|
|
125
125
|
}
|
|
126
|
-
catch (
|
|
127
|
-
this.debugMsg(
|
|
128
|
-
throw
|
|
126
|
+
catch (error) {
|
|
127
|
+
this.debugMsg(error);
|
|
128
|
+
throw error;
|
|
129
129
|
}
|
|
130
130
|
for (let i = 0; i < this.messages.length; i++) {
|
|
131
131
|
const substring = stringified.substring(i * chunkSize, (i + 1) * chunkSize);
|
|
@@ -147,8 +147,8 @@ class ChunkedOpProcessor {
|
|
|
147
147
|
stringifiedParsedContents = JSON.stringify(parsedContents);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
catch (
|
|
151
|
-
this.debugMsg(
|
|
150
|
+
catch (error) {
|
|
151
|
+
this.debugMsg(error);
|
|
152
152
|
}
|
|
153
153
|
message.contents = stringifiedParsedContents;
|
|
154
154
|
}
|
|
@@ -162,7 +162,7 @@ class ChunkedOpProcessor {
|
|
|
162
162
|
this.concatenatedLength = 0;
|
|
163
163
|
}
|
|
164
164
|
isPendingProcessing() {
|
|
165
|
-
return this.messages.length
|
|
165
|
+
return this.messages.length > 0;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
export class Sanitizer {
|
|
@@ -229,9 +229,9 @@ export class Sanitizer {
|
|
|
229
229
|
getRandomText(len) {
|
|
230
230
|
let str = "";
|
|
231
231
|
while (str.length < len) {
|
|
232
|
-
str = str + Math.random().toString(36).
|
|
232
|
+
str = str + Math.random().toString(36).slice(2);
|
|
233
233
|
}
|
|
234
|
-
return str.
|
|
234
|
+
return str.slice(0, Math.max(0, len));
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
237
|
* Replace text with garbage. FluidObject types are not replaced when not under
|
|
@@ -280,7 +280,7 @@ export class Sanitizer {
|
|
|
280
280
|
return input;
|
|
281
281
|
}
|
|
282
282
|
const keys = Object.keys(input);
|
|
283
|
-
|
|
283
|
+
for (const key of keys) {
|
|
284
284
|
if (this.fullScrub || !excludedKeys.has(key)) {
|
|
285
285
|
const value = input[key];
|
|
286
286
|
if (typeof value === "string") {
|
|
@@ -293,7 +293,7 @@ export class Sanitizer {
|
|
|
293
293
|
input[key] = this.replaceObject(value, excludedKeys);
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
}
|
|
296
|
+
}
|
|
297
297
|
return input;
|
|
298
298
|
}
|
|
299
299
|
/**
|
|
@@ -324,26 +324,23 @@ export class Sanitizer {
|
|
|
324
324
|
}
|
|
325
325
|
try {
|
|
326
326
|
let data = JSON.parse(message.data);
|
|
327
|
-
if (
|
|
328
|
-
data = this.replaceAny(data);
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
327
|
+
if (this.objectMatchesSchema(data, joinDataSchema)) {
|
|
331
328
|
const user = data.detail.user;
|
|
332
329
|
user.id = this.replaceText(user.id, TextType.Email);
|
|
333
330
|
user.email = this.replaceText(user.email, TextType.Email);
|
|
334
331
|
user.name = this.replaceText(user.name, TextType.Name);
|
|
335
332
|
}
|
|
333
|
+
else {
|
|
334
|
+
data = this.replaceAny(data);
|
|
335
|
+
}
|
|
336
336
|
message.data = JSON.stringify(data);
|
|
337
337
|
}
|
|
338
|
-
catch (
|
|
339
|
-
this.debugMsg(
|
|
338
|
+
catch (error) {
|
|
339
|
+
this.debugMsg(error);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
fixPropose(message) {
|
|
343
|
-
if (
|
|
344
|
-
message.contents = this.replaceAny(message.contents);
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
343
|
+
if (this.objectMatchesSchema(message.contents, proposeContentsSchema)) {
|
|
347
344
|
if (typeof message.contents === "string") {
|
|
348
345
|
try {
|
|
349
346
|
const data = JSON.parse(message.contents);
|
|
@@ -357,8 +354,8 @@ export class Sanitizer {
|
|
|
357
354
|
}
|
|
358
355
|
}
|
|
359
356
|
}
|
|
360
|
-
catch (
|
|
361
|
-
this.debugMsg(
|
|
357
|
+
catch (error) {
|
|
358
|
+
this.debugMsg(error);
|
|
362
359
|
}
|
|
363
360
|
}
|
|
364
361
|
else {
|
|
@@ -367,9 +364,12 @@ export class Sanitizer {
|
|
|
367
364
|
}
|
|
368
365
|
}
|
|
369
366
|
}
|
|
367
|
+
else {
|
|
368
|
+
message.contents = this.replaceAny(message.contents);
|
|
369
|
+
}
|
|
370
370
|
}
|
|
371
371
|
fixAttachEntries(entries) {
|
|
372
|
-
|
|
372
|
+
for (const element of entries) {
|
|
373
373
|
// Tree type
|
|
374
374
|
if (element.value.entries) {
|
|
375
375
|
this.fixAttachEntries(element.value.entries);
|
|
@@ -383,11 +383,11 @@ export class Sanitizer {
|
|
|
383
383
|
element.value.contents = JSON.stringify(data);
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
catch (
|
|
387
|
-
this.debugMsg(
|
|
386
|
+
catch (error) {
|
|
387
|
+
this.debugMsg(error);
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
}
|
|
390
|
+
}
|
|
391
391
|
}
|
|
392
392
|
/**
|
|
393
393
|
* Fix the content of an attach in place
|
|
@@ -395,16 +395,16 @@ export class Sanitizer {
|
|
|
395
395
|
*/
|
|
396
396
|
fixAttachContents(contents) {
|
|
397
397
|
assert(typeof contents === "object", 0x08b /* "Unexpected type on contents for fix of an attach!" */);
|
|
398
|
-
if (
|
|
399
|
-
this.replaceObject(contents);
|
|
400
|
-
}
|
|
401
|
-
else {
|
|
398
|
+
if (this.objectMatchesSchema(contents, attachContentsSchema)) {
|
|
402
399
|
if (this.fullScrub) {
|
|
403
400
|
contents.id = this.replaceText(contents.id, TextType.FluidObject);
|
|
404
401
|
contents.type = this.replaceText(contents.type, TextType.FluidObject);
|
|
405
402
|
}
|
|
406
403
|
this.fixAttachEntries(contents.snapshot.entries);
|
|
407
404
|
}
|
|
405
|
+
else {
|
|
406
|
+
this.replaceObject(contents);
|
|
407
|
+
}
|
|
408
408
|
}
|
|
409
409
|
/**
|
|
410
410
|
* Fix an attach message at the root level or a ContainerMessageType attach. Attach
|
|
@@ -424,8 +424,8 @@ export class Sanitizer {
|
|
|
424
424
|
this.fixAttachContents(data);
|
|
425
425
|
message.contents = JSON.stringify(data);
|
|
426
426
|
}
|
|
427
|
-
catch (
|
|
428
|
-
this.debugMsg(
|
|
427
|
+
catch (error) {
|
|
428
|
+
this.debugMsg(error);
|
|
429
429
|
return;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
@@ -448,10 +448,7 @@ export class Sanitizer {
|
|
|
448
448
|
*/
|
|
449
449
|
fixOpContentsObject(contents) {
|
|
450
450
|
// do replacement
|
|
451
|
-
if (
|
|
452
|
-
this.replaceAny(contents);
|
|
453
|
-
}
|
|
454
|
-
else {
|
|
451
|
+
if (this.objectMatchesSchema(contents, opContentsSchema)) {
|
|
455
452
|
if (this.fullScrub) {
|
|
456
453
|
contents.address = this.replaceText(contents.address, TextType.FluidObject);
|
|
457
454
|
}
|
|
@@ -466,8 +463,8 @@ export class Sanitizer {
|
|
|
466
463
|
this.fixAttachContents(data);
|
|
467
464
|
contents.contents.content = JSON.stringify(data);
|
|
468
465
|
}
|
|
469
|
-
catch (
|
|
470
|
-
this.debugMsg(
|
|
466
|
+
catch (error) {
|
|
467
|
+
this.debugMsg(error);
|
|
471
468
|
}
|
|
472
469
|
}
|
|
473
470
|
else {
|
|
@@ -489,9 +486,9 @@ export class Sanitizer {
|
|
|
489
486
|
if (this.fullScrub) {
|
|
490
487
|
innerContent.address = this.replaceText(innerContent.address, TextType.FluidObject);
|
|
491
488
|
}
|
|
492
|
-
innerContent.contents.ops
|
|
489
|
+
for (const deltaOp of innerContent.contents.ops) {
|
|
493
490
|
this.fixDeltaOp(deltaOp);
|
|
494
|
-
}
|
|
491
|
+
}
|
|
495
492
|
}
|
|
496
493
|
else if (this.validator.validate(innerContent, opContentsMergeTreeDeltaOpSchema).valid) {
|
|
497
494
|
// merge tree delta op
|
|
@@ -515,6 +512,9 @@ export class Sanitizer {
|
|
|
515
512
|
this.objectMatchesSchema(contents, false);
|
|
516
513
|
}
|
|
517
514
|
}
|
|
515
|
+
else {
|
|
516
|
+
this.replaceAny(contents);
|
|
517
|
+
}
|
|
518
518
|
}
|
|
519
519
|
fixOp(message) {
|
|
520
520
|
// handle case where contents is stringified json
|
|
@@ -523,8 +523,8 @@ export class Sanitizer {
|
|
|
523
523
|
try {
|
|
524
524
|
msgContents = JSON.parse(message.contents);
|
|
525
525
|
}
|
|
526
|
-
catch (
|
|
527
|
-
this.debugMsg(
|
|
526
|
+
catch (error) {
|
|
527
|
+
this.debugMsg(error);
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
530
|
}
|
|
@@ -569,8 +569,8 @@ export class Sanitizer {
|
|
|
569
569
|
try {
|
|
570
570
|
message.contents = JSON.stringify(msgContents);
|
|
571
571
|
}
|
|
572
|
-
catch (
|
|
573
|
-
this.debugMsg(
|
|
572
|
+
catch (error) {
|
|
573
|
+
this.debugMsg(error);
|
|
574
574
|
return;
|
|
575
575
|
}
|
|
576
576
|
}
|
|
@@ -623,10 +623,12 @@ export class Sanitizer {
|
|
|
623
623
|
case "noClient":
|
|
624
624
|
case "summarize":
|
|
625
625
|
case "summaryAck":
|
|
626
|
-
case "summaryNack":
|
|
626
|
+
case "summaryNack": {
|
|
627
627
|
break;
|
|
628
|
-
|
|
628
|
+
}
|
|
629
|
+
default: {
|
|
629
630
|
this.debugMsg(`Unexpected op type ${message.type}`);
|
|
631
|
+
}
|
|
630
632
|
}
|
|
631
633
|
});
|
|
632
634
|
// make sure we don't miss an incomplete chunked op at the end
|