@fluidframework/driver-utils 2.3.0-288113 → 2.3.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 +4 -0
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +3 -7
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
- package/dist/documentStorageServiceProxy.d.ts.map +1 -1
- package/dist/documentStorageServiceProxy.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/insecureUrlResolver.d.ts.map +1 -1
- package/dist/insecureUrlResolver.js +0 -4
- package/dist/insecureUrlResolver.js.map +1 -1
- package/dist/messageRecognition.d.ts +0 -8
- package/dist/messageRecognition.d.ts.map +1 -1
- package/dist/messageRecognition.js +2 -11
- package/dist/messageRecognition.js.map +1 -1
- package/dist/network.d.ts +2 -2
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +6 -2
- package/dist/network.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/parallelRequests.d.ts.map +1 -1
- package/dist/parallelRequests.js +1 -10
- package/dist/parallelRequests.js.map +1 -1
- package/dist/prefetchDocumentStorageService.d.ts +2 -5
- package/dist/prefetchDocumentStorageService.d.ts.map +1 -1
- package/dist/prefetchDocumentStorageService.js +4 -4
- package/dist/prefetchDocumentStorageService.js.map +1 -1
- package/dist/protocol/gitHelper.d.ts.map +1 -1
- package/dist/protocol/gitHelper.js +0 -2
- package/dist/protocol/gitHelper.js.map +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +3 -7
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
- package/lib/documentStorageServiceProxy.d.ts.map +1 -1
- package/lib/documentStorageServiceProxy.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/insecureUrlResolver.d.ts.map +1 -1
- package/lib/insecureUrlResolver.js +0 -4
- package/lib/insecureUrlResolver.js.map +1 -1
- package/lib/messageRecognition.d.ts +0 -8
- package/lib/messageRecognition.d.ts.map +1 -1
- package/lib/messageRecognition.js +1 -10
- package/lib/messageRecognition.js.map +1 -1
- package/lib/network.d.ts +2 -2
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js +6 -2
- package/lib/network.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/parallelRequests.d.ts.map +1 -1
- package/lib/parallelRequests.js +1 -10
- package/lib/parallelRequests.js.map +1 -1
- package/lib/prefetchDocumentStorageService.d.ts +2 -5
- package/lib/prefetchDocumentStorageService.d.ts.map +1 -1
- package/lib/prefetchDocumentStorageService.js +5 -5
- package/lib/prefetchDocumentStorageService.js.map +1 -1
- package/lib/protocol/gitHelper.d.ts.map +1 -1
- package/lib/protocol/gitHelper.js +0 -2
- package/lib/protocol/gitHelper.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +35 -13
- package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +7 -10
- package/src/documentStorageServiceProxy.ts +1 -1
- package/src/index.ts +0 -1
- package/src/insecureUrlResolver.ts +2 -6
- package/src/messageRecognition.ts +1 -10
- package/src/network.ts +10 -2
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +4 -12
- package/src/prefetchDocumentStorageService.ts +8 -7
- package/src/protocol/gitHelper.ts +1 -3
- package/tsconfig.json +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefetchDocumentStorageService.js","sourceRoot":"","sources":["../src/prefetchDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"prefetchDocumentStorageService.js","sourceRoot":"","sources":["../src/prefetchDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAElF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,2BAA2B;IAA/E;;QACC,qCAAqC;QACpB,kBAAa,GAAG,IAAI,GAAG,EAAoC,CAAC;QACrE,oBAAe,GAAG,IAAI,CAAC;IAiFhC,CAAC;IA/EA,IAAW,QAAQ;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC;QACtD,IAAI,QAAQ,EAAE,CAAC;YACd,OAAO,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,mBAAmB,CAAC,SAAS,EAAE,CAAC;QAChE,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAAkB;QAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC/D,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,yCAAyC;YACzC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAsC,EAAE,EAAE;gBACtD,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACzC,OAAO;gBACR,CAAC;gBACD,IAAI,CAAC,Y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,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;IACF,CAAC;IAEO,gBAAgB,CAAC,IAAmB,EAAE,SAAmB;QAChE,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACrF,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBACnB,yCAAyC;oBACzC,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC5B,CAAC;YACF,CAAC;iBAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC1C,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBACnB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtB,CAAC;YACF,CAAC;QACF,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;QACvD,CAAC;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDocumentStorageServicePolicies,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { LoaderCachingPolicy } from \"@fluidframework/driver-definitions/internal\";\n\nimport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy.js\";\nimport { canRetryOnError } from \"./network.js\";\n\n/**\n * @internal\n */\nexport class PrefetchDocumentStorageService extends DocumentStorageServiceProxy {\n\t// BlobId -> blob prefetchCache cache\n\tprivate readonly prefetchCache = new Map<string, Promise<ArrayBufferLike>>();\n\tprivate prefetchEnabled = true;\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\tconst policies = this.internalStorageService.policies;\n\t\tif (policies) {\n\t\t\treturn { ...policies, caching: LoaderCachingPolicy.NoCaching };\n\t\t}\n\t}\n\n\tpublic async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n\t\tconst p = this.internalStorageService.getSnapshotTree(version);\n\t\tif (this.prefetchEnabled) {\n\t\t\t// We don't care if the prefetch succeeds\n\t\t\tvoid p.then((tree: ISnapshotTree | null | undefined) => {\n\t\t\t\tif (tree === null || tree === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.prefetchTree(tree);\n\t\t\t});\n\t\t}\n\t\treturn p;\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.cachedRead(blobId);\n\t}\n\tpublic stopPrefetch() {\n\t\tthis.prefetchEnabled = false;\n\t\tthis.prefetchCache.clear();\n\t}\n\n\tprivate async cachedRead(blobId: string): Promise<ArrayBufferLike> {\n\t\tif (this.prefetchEnabled) {\n\t\t\tconst prefetchedBlobP = this.prefetchCache.get(blobId);\n\t\t\tif (prefetchedBlobP !== undefined) {\n\t\t\t\treturn prefetchedBlobP;\n\t\t\t}\n\t\t\tconst prefetchedBlobPFromStorage = this.internalStorageService.readBlob(blobId);\n\t\t\tthis.prefetchCache.set(\n\t\t\t\tblobId,\n\t\t\t\tprefetchedBlobPFromStorage.catch((error) => {\n\t\t\t\t\tif (canRetryOnError(error)) {\n\t\t\t\t\t\tthis.prefetchCache.delete(blobId);\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn prefetchedBlobPFromStorage;\n\t\t}\n\t\treturn this.internalStorageService.readBlob(blobId);\n\t}\n\n\tprivate prefetchTree(tree: ISnapshotTree) {\n\t\tconst secondary: string[] = [];\n\t\tthis.prefetchTreeCore(tree, secondary);\n\n\t\tfor (const blob of secondary) {\n\t\t\t// We don't care if the prefetch succeeds\n\t\t\tvoid this.cachedRead(blob);\n\t\t}\n\t}\n\n\tprivate prefetchTreeCore(tree: ISnapshotTree, secondary: string[]) {\n\t\tfor (const blobKey of Object.keys(tree.blobs)) {\n\t\t\tconst blob = tree.blobs[blobKey];\n\t\t\tif (blobKey.startsWith(\".\") || blobKey === \"header\" || blobKey.startsWith(\"quorum\")) {\n\t\t\t\tif (blob !== null) {\n\t\t\t\t\t// We don't care if the prefetch succeeds\n\t\t\t\t\tvoid this.cachedRead(blob);\n\t\t\t\t}\n\t\t\t} else if (!blobKey.startsWith(\"deltas\")) {\n\t\t\t\tif (blob !== null) {\n\t\t\t\t\tsecondary.push(blob);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const subTree of Object.keys(tree.trees)) {\n\t\t\tthis.prefetchTreeCore(tree.trees[subTree], secondary);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitHelper.d.ts","sourceRoot":"","sources":["../../src/protocol/gitHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,QAAQ,EACR,eAAe,EAEf,aAAa,EACb,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAWvD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,CAYhE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAA6B,EACpE,mBAAmB,UAAQ,GACzB,eAAe,
|
|
1
|
+
{"version":3,"file":"gitHelper.d.ts","sourceRoot":"","sources":["../../src/protocol/gitHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,QAAQ,EACR,eAAe,EAEf,aAAa,EACb,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAWvD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,CAYhE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAA6B,EACpE,mBAAmB,UAAQ,GACzB,eAAe,CA4BjB"}
|
|
@@ -62,8 +62,6 @@ export function buildGitTreeHierarchy(flatTree, blobsShaToPathCache = new Map(),
|
|
|
62
62
|
const entryPathDir = entryPath.slice(0, Math.max(0, lastIndex));
|
|
63
63
|
const entryPathBase = entryPath.slice(lastIndex + 1);
|
|
64
64
|
// The flat output is breadth-first so we can assume we see tree nodes prior to their contents
|
|
65
|
-
// TODO why are we non null asserting here?
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
67
65
|
const node = lookup[entryPathDir];
|
|
68
66
|
// Add in either the blob or tree
|
|
69
67
|
if (entry.type === "tree") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitHelper.js","sourceRoot":"","sources":["../../src/protocol/gitHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EACN,QAAQ,EAGR,WAAW,GAEX,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,KAAoB;IAC9C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,K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AI,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QAElC,iCAAiC;QACjC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC3B,MAAM,OAAO,GAAG,EAAE,EAAE,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YACrE,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,GAAG,OAAO,CAAC;YACxD,MAAM,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;QAC7B,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAClC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;YAC1D,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFileMode,\n\tIGitTree,\n\tISnapshotTreeEx,\n\tSummaryType,\n\tSummaryObject,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Take a summary object and returns its git mode.\n *\n * @param value - summary object\n * @returns the git mode of summary object\n * @internal\n */\nexport function getGitMode(value: SummaryObject): string {\n\tconst type = value.type === SummaryType.Handle ? value.handleType : value.type;\n\tswitch (type) {\n\t\tcase SummaryType.Blob:\n\t\tcase SummaryType.Attachment:\n\t\t\treturn FileMode.File;\n\t\tcase SummaryType.Tree:\n\t\t\treturn FileMode.Directory;\n\t\tdefault:\n\t\t\tunreachableCase(type, `Unknown type: ${type}`);\n\t}\n}\n\n/**\n * Take a summary object and returns its type.\n *\n * @param value - summary object\n * @returns the type of summary object\n * @internal\n */\nexport function getGitType(value: SummaryObject): \"blob\" | \"tree\" {\n\tconst type = value.type === SummaryType.Handle ? value.handleType : value.type;\n\n\tswitch (type) {\n\t\tcase SummaryType.Blob:\n\t\tcase SummaryType.Attachment:\n\t\t\treturn \"blob\";\n\t\tcase SummaryType.Tree:\n\t\t\treturn \"tree\";\n\t\tdefault:\n\t\t\tunreachableCase(type, `Unknown type: ${type}`);\n\t}\n}\n\n/**\n * NOTE: Renamed from `buildHierarchy` to `buildGitTreeHierarchy`. There is usage of this function in loader and driver layer.\n * Build a tree hierarchy base on a flat tree\n *\n * @param flatTree - a flat tree\n * @param blobsShaToPathCache - Map with blobs sha as keys and values as path of the blob.\n * @param removeAppTreePrefix - Remove `.app/` from beginning of paths when present\n * @returns the hierarchical tree\n * @internal\n */\nexport function buildGitTreeHierarchy(\n\tflatTree: IGitTree,\n\tblobsShaToPathCache: Map<string, string> = new Map<string, string>(),\n\tremoveAppTreePrefix = false,\n): ISnapshotTreeEx {\n\tconst lookup: { [path: string]: ISnapshotTreeEx } = {};\n\tconst root: ISnapshotTreeEx = { id: flatTree.sha, blobs: {}, trees: {} };\n\tlookup[\"\"] = root;\n\n\tfor (const entry of flatTree.tree) {\n\t\tconst entryPath = removeAppTreePrefix ? entry.path.replace(/^\\.app\\//, \"\") : entry.path;\n\t\tconst lastIndex = entryPath.lastIndexOf(\"/\");\n\t\tconst entryPathDir = entryPath.slice(0, Math.max(0, lastIndex));\n\t\tconst entryPathBase = entryPath.slice(lastIndex + 1);\n\n\t\t// The flat output is breadth-first so we can assume we see tree nodes prior to their contents\n\t\tconst node = lookup[entryPathDir];\n\n\t\t// Add in either the blob or tree\n\t\tif (entry.type === \"tree\") {\n\t\t\tconst newTree = { id: entry.sha, blobs: {}, commits: {}, trees: {} };\n\t\t\tnode.trees[decodeURIComponent(entryPathBase)] = newTree;\n\t\t\tlookup[entryPath] = newTree;\n\t\t} else if (entry.type === \"blob\") {\n\t\t\tnode.blobs[decodeURIComponent(entryPathBase)] = entry.sha;\n\t\t\tblobsShaToPathCache.set(entry.sha, `/${entryPath}`);\n\t\t} else {\n\t\t\tthrow new Error(\"Unknown entry type!!\");\n\t\t}\n\t}\n\n\treturn root;\n}\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-utils",
|
|
3
|
-
"version": "2.3.0
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Collection of utility functions for Fluid drivers",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -67,25 +67,25 @@
|
|
|
67
67
|
"temp-directory": "nyc/.nyc_output"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluid-internal/client-utils": "2.3.0
|
|
71
|
-
"@fluidframework/core-interfaces": "2.3.0
|
|
72
|
-
"@fluidframework/core-utils": "2.3.0
|
|
73
|
-
"@fluidframework/driver-definitions": "2.3.0
|
|
74
|
-
"@fluidframework/telemetry-utils": "2.3.0
|
|
75
|
-
"axios": "^1.
|
|
70
|
+
"@fluid-internal/client-utils": "~2.3.0",
|
|
71
|
+
"@fluidframework/core-interfaces": "~2.3.0",
|
|
72
|
+
"@fluidframework/core-utils": "~2.3.0",
|
|
73
|
+
"@fluidframework/driver-definitions": "~2.3.0",
|
|
74
|
+
"@fluidframework/telemetry-utils": "~2.3.0",
|
|
75
|
+
"axios": "^1.7.7",
|
|
76
76
|
"lz4js": "^0.2.0",
|
|
77
77
|
"uuid": "^9.0.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
81
81
|
"@biomejs/biome": "~1.8.3",
|
|
82
|
-
"@fluid-internal/mocha-test-setup": "2.3.0
|
|
83
|
-
"@fluid-tools/build-cli": "^0.
|
|
82
|
+
"@fluid-internal/mocha-test-setup": "~2.3.0",
|
|
83
|
+
"@fluid-tools/build-cli": "^0.46.0",
|
|
84
84
|
"@fluidframework/build-common": "^2.0.3",
|
|
85
|
-
"@fluidframework/build-tools": "^0.
|
|
85
|
+
"@fluidframework/build-tools": "^0.46.0",
|
|
86
86
|
"@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.2.0",
|
|
87
|
-
"@fluidframework/eslint-config-fluid": "^5.
|
|
88
|
-
"@microsoft/api-extractor": "
|
|
87
|
+
"@fluidframework/eslint-config-fluid": "^5.4.0",
|
|
88
|
+
"@microsoft/api-extractor": "7.47.8",
|
|
89
89
|
"@types/mocha": "^9.1.1",
|
|
90
90
|
"@types/node": "^18.19.0",
|
|
91
91
|
"@types/sinon": "^17.0.3",
|
|
@@ -105,7 +105,29 @@
|
|
|
105
105
|
"typescript": "~5.4.5"
|
|
106
106
|
},
|
|
107
107
|
"typeValidation": {
|
|
108
|
-
"broken": {
|
|
108
|
+
"broken": {
|
|
109
|
+
"RemovedEnum_MessageType2": {
|
|
110
|
+
"forwardCompat": false,
|
|
111
|
+
"backCompat": false
|
|
112
|
+
},
|
|
113
|
+
"Class_AuthorizationError": {
|
|
114
|
+
"backCompat": false
|
|
115
|
+
},
|
|
116
|
+
"Class_PrefetchDocumentStorageService": {
|
|
117
|
+
"backCompat": false
|
|
118
|
+
},
|
|
119
|
+
"ClassStatics_AuthorizationError": {
|
|
120
|
+
"backCompat": false
|
|
121
|
+
},
|
|
122
|
+
"ClassStatics_PrefetchDocumentStorageService": {
|
|
123
|
+
"backCompat": false
|
|
124
|
+
},
|
|
125
|
+
"Enum_MessageType2": {
|
|
126
|
+
"forwardCompat": false,
|
|
127
|
+
"backCompat": false
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"entrypoint": "internal"
|
|
109
131
|
},
|
|
110
132
|
"scripts": {
|
|
111
133
|
"api": "fluid-build . --task api",
|
package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts
CHANGED
|
@@ -61,9 +61,7 @@ export class DocumentStorageServiceCompressionAdapter extends DocumentStorageSer
|
|
|
61
61
|
* @returns `true` if there is a compression markup byte in the blob, otherwise `false`.
|
|
62
62
|
*/
|
|
63
63
|
private static hasPrefix(blob: ArrayBufferLike): boolean {
|
|
64
|
-
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
66
|
-
const firstByte = IsoBuffer.from(blob)[0]!;
|
|
64
|
+
const firstByte = IsoBuffer.from(blob)[0];
|
|
67
65
|
// eslint-disable-next-line no-bitwise
|
|
68
66
|
return (firstByte & 0xf0) === 0xb0;
|
|
69
67
|
}
|
|
@@ -75,9 +73,8 @@ export class DocumentStorageServiceCompressionAdapter extends DocumentStorageSer
|
|
|
75
73
|
private static readAlgorithmFromBlob(blob: ArrayBufferLike): number {
|
|
76
74
|
return !this.hasPrefix(blob)
|
|
77
75
|
? SummaryCompressionAlgorithm.None
|
|
78
|
-
: //
|
|
79
|
-
|
|
80
|
-
IsoBuffer.from(blob)[0]! & 0x0f;
|
|
76
|
+
: // eslint-disable-next-line no-bitwise
|
|
77
|
+
IsoBuffer.from(blob)[0] & 0x0f;
|
|
81
78
|
}
|
|
82
79
|
|
|
83
80
|
/**
|
|
@@ -91,9 +88,7 @@ export class DocumentStorageServiceCompressionAdapter extends DocumentStorageSer
|
|
|
91
88
|
algorithm: number,
|
|
92
89
|
): ArrayBufferLike {
|
|
93
90
|
if (algorithm === SummaryCompressionAlgorithm.None) {
|
|
94
|
-
|
|
95
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
96
|
-
const firstByte = IsoBuffer.from(blob)[0]!;
|
|
91
|
+
const firstByte = IsoBuffer.from(blob)[0];
|
|
97
92
|
// eslint-disable-next-line no-bitwise
|
|
98
93
|
if ((firstByte & 0xf0) !== 0xb0) {
|
|
99
94
|
return blob;
|
|
@@ -296,7 +291,9 @@ export class DocumentStorageServiceCompressionAdapter extends DocumentStorageSer
|
|
|
296
291
|
*/
|
|
297
292
|
private static findMetadataHolderSummary(summary: ISummaryTree): ISummaryTree | undefined {
|
|
298
293
|
assert(typeof summary === "object", 0x6f7 /* summary must be a non-null object */);
|
|
299
|
-
for (const
|
|
294
|
+
for (const key of Object.keys(summary.tree)) {
|
|
295
|
+
const value = summary.tree[key];
|
|
296
|
+
|
|
300
297
|
if (Boolean(value) && value.type === SummaryType.Tree) {
|
|
301
298
|
const found = this.findMetadataHolderSummary(value);
|
|
302
299
|
if (found) {
|
|
@@ -27,7 +27,7 @@ export class DocumentStorageServiceProxy implements IDocumentStorageService {
|
|
|
27
27
|
this._policies = policies;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
public get policies() {
|
|
30
|
+
public get policies(): IDocumentStorageServicePolicies | undefined {
|
|
31
31
|
return this._policies ?? this.internalStorageService.policies;
|
|
32
32
|
}
|
|
33
33
|
|
package/src/index.ts
CHANGED
|
@@ -54,14 +54,10 @@ export class InsecureUrlResolver implements IUrlResolver {
|
|
|
54
54
|
if (this.isForNodeTest) {
|
|
55
55
|
const [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split("/");
|
|
56
56
|
const relativePath = tmpRelativePath ?? "";
|
|
57
|
-
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
59
|
-
return this.resolveHelper(documentId!, relativePath, parsedUrl.search);
|
|
57
|
+
return this.resolveHelper(documentId, relativePath, parsedUrl.search);
|
|
60
58
|
} else if (parsedUrl.host === window.location.host) {
|
|
61
59
|
const fullPath = parsedUrl.pathname.substr(1);
|
|
62
|
-
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
64
|
-
const documentId = fullPath.split("/")[0]!;
|
|
60
|
+
const documentId = fullPath.split("/")[0];
|
|
65
61
|
const documentRelativePath = fullPath.slice(documentId.length);
|
|
66
62
|
return this.resolveHelper(documentId, documentRelativePath);
|
|
67
63
|
} else {
|
|
@@ -19,15 +19,6 @@ export function isRuntimeMessage(message: { type: string }): boolean {
|
|
|
19
19
|
return message.type === MessageType.Operation;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* @privateRemarks ADO #1385: staging code changes across layers.
|
|
24
|
-
* Eventually to be replaced by MessageType.accept
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export enum MessageType2 {
|
|
28
|
-
Accept = "accept",
|
|
29
|
-
}
|
|
30
|
-
|
|
31
22
|
/**
|
|
32
23
|
* @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
|
|
33
24
|
* @internal
|
|
@@ -37,5 +28,5 @@ export function canBeCoalescedByService(
|
|
|
37
28
|
): boolean {
|
|
38
29
|
// This assumes that in the future relay service may implement coalescing of accept messages,
|
|
39
30
|
// same way it was doing coalescing of immediate noops in the past.
|
|
40
|
-
return message.type === MessageType.NoOp || message.type ===
|
|
31
|
+
return message.type === MessageType.NoOp || message.type === MessageType.Accept;
|
|
41
32
|
}
|
package/src/network.ts
CHANGED
|
@@ -112,14 +112,22 @@ export class AuthorizationError
|
|
|
112
112
|
implements IAuthorizationError, IFluidErrorBase
|
|
113
113
|
{
|
|
114
114
|
readonly errorType = DriverErrorTypes.authorizationError;
|
|
115
|
+
readonly claims?: string;
|
|
116
|
+
readonly tenantId?: string;
|
|
115
117
|
readonly canRetry = false;
|
|
116
118
|
|
|
117
119
|
constructor(
|
|
118
120
|
message: string,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
claims: string | undefined,
|
|
122
|
+
tenantId: string | undefined,
|
|
121
123
|
props: DriverErrorTelemetryProps,
|
|
122
124
|
) {
|
|
125
|
+
if (claims !== undefined) {
|
|
126
|
+
props.claims = claims;
|
|
127
|
+
}
|
|
128
|
+
if (tenantId !== undefined) {
|
|
129
|
+
props.tenantId = tenantId;
|
|
130
|
+
}
|
|
123
131
|
// don't log claims or tenantId
|
|
124
132
|
super(message, props, new Set(["claims", "tenantId"]));
|
|
125
133
|
}
|
package/src/packageVersion.ts
CHANGED
package/src/parallelRequests.ts
CHANGED
|
@@ -595,21 +595,13 @@ export function requestOps(
|
|
|
595
595
|
(deltas: ISequencedDocumentMessage[]) => {
|
|
596
596
|
// Assert continuing and right start.
|
|
597
597
|
if (lastFetch === undefined) {
|
|
598
|
-
|
|
599
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
600
|
-
assert(deltas[0]!.sequenceNumber === fromTotal, 0x26d /* "wrong start" */);
|
|
598
|
+
assert(deltas[0].sequenceNumber === fromTotal, 0x26d /* "wrong start" */);
|
|
601
599
|
} else {
|
|
602
|
-
|
|
603
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
604
|
-
assert(deltas[0]!.sequenceNumber === lastFetch + 1, 0x26e /* "wrong start" */);
|
|
600
|
+
assert(deltas[0].sequenceNumber === lastFetch + 1, 0x26e /* "wrong start" */);
|
|
605
601
|
}
|
|
606
|
-
|
|
607
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
608
|
-
lastFetch = deltas[deltas.length - 1]!.sequenceNumber;
|
|
602
|
+
lastFetch = deltas[deltas.length - 1].sequenceNumber;
|
|
609
603
|
assert(
|
|
610
|
-
|
|
611
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
612
|
-
lastFetch - deltas[0]!.sequenceNumber + 1 === deltas.length,
|
|
604
|
+
lastFetch - deltas[0].sequenceNumber + 1 === deltas.length,
|
|
613
605
|
0x26f /* "continuous and no duplicates" */,
|
|
614
606
|
);
|
|
615
607
|
length += deltas.length;
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import type {
|
|
7
|
+
IDocumentStorageServicePolicies,
|
|
8
8
|
ISnapshotTree,
|
|
9
9
|
IVersion,
|
|
10
10
|
} from "@fluidframework/driver-definitions/internal";
|
|
11
|
+
import { LoaderCachingPolicy } from "@fluidframework/driver-definitions/internal";
|
|
11
12
|
|
|
12
13
|
import { DocumentStorageServiceProxy } from "./documentStorageServiceProxy.js";
|
|
13
14
|
import { canRetryOnError } from "./network.js";
|
|
@@ -20,7 +21,7 @@ export class PrefetchDocumentStorageService extends DocumentStorageServiceProxy
|
|
|
20
21
|
private readonly prefetchCache = new Map<string, Promise<ArrayBufferLike>>();
|
|
21
22
|
private prefetchEnabled = true;
|
|
22
23
|
|
|
23
|
-
public get policies() {
|
|
24
|
+
public get policies(): IDocumentStorageServicePolicies | undefined {
|
|
24
25
|
const policies = this.internalStorageService.policies;
|
|
25
26
|
if (policies) {
|
|
26
27
|
return { ...policies, caching: LoaderCachingPolicy.NoCaching };
|
|
@@ -84,19 +85,19 @@ export class PrefetchDocumentStorageService extends DocumentStorageServiceProxy
|
|
|
84
85
|
for (const blobKey of Object.keys(tree.blobs)) {
|
|
85
86
|
const blob = tree.blobs[blobKey];
|
|
86
87
|
if (blobKey.startsWith(".") || blobKey === "header" || blobKey.startsWith("quorum")) {
|
|
87
|
-
if (blob !== null
|
|
88
|
+
if (blob !== null) {
|
|
88
89
|
// We don't care if the prefetch succeeds
|
|
89
90
|
void this.cachedRead(blob);
|
|
90
91
|
}
|
|
91
92
|
} else if (!blobKey.startsWith("deltas")) {
|
|
92
|
-
if (blob !== null
|
|
93
|
+
if (blob !== null) {
|
|
93
94
|
secondary.push(blob);
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
for (const
|
|
99
|
-
this.prefetchTreeCore(
|
|
99
|
+
for (const subTree of Object.keys(tree.trees)) {
|
|
100
|
+
this.prefetchTreeCore(tree.trees[subTree], secondary);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
}
|
|
@@ -79,9 +79,7 @@ export function buildGitTreeHierarchy(
|
|
|
79
79
|
const entryPathBase = entryPath.slice(lastIndex + 1);
|
|
80
80
|
|
|
81
81
|
// The flat output is breadth-first so we can assume we see tree nodes prior to their contents
|
|
82
|
-
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
84
|
-
const node = lookup[entryPathDir]!;
|
|
82
|
+
const node = lookup[entryPathDir];
|
|
85
83
|
|
|
86
84
|
// Add in either the blob or tree
|
|
87
85
|
if (entry.type === "tree") {
|