@fluidframework/driver-utils 2.0.0-dev-rc.5.0.0.263932 → 2.0.0-dev-rc.5.0.0.267932
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/api-report/driver-utils.api.md +13 -13
- package/dist/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +2 -2
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +7 -7
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
- package/dist/adapters/predefinedAdapters.js.map +1 -1
- package/dist/blob.d.ts +1 -1
- package/dist/blob.d.ts.map +1 -1
- package/dist/blob.js +7 -7
- package/dist/blob.js.map +1 -1
- package/dist/buildSnapshotTree.d.ts +1 -1
- package/dist/buildSnapshotTree.d.ts.map +1 -1
- package/dist/buildSnapshotTree.js +6 -6
- package/dist/buildSnapshotTree.js.map +1 -1
- package/dist/documentServiceFactoryProxy.d.ts +1 -1
- package/dist/documentServiceFactoryProxy.d.ts.map +1 -1
- package/dist/documentServiceFactoryProxy.js.map +1 -1
- package/dist/documentServiceProxy.d.ts +1 -1
- package/dist/documentServiceProxy.d.ts.map +1 -1
- package/dist/documentServiceProxy.js.map +1 -1
- package/dist/documentStorageServiceProxy.d.ts +2 -2
- package/dist/documentStorageServiceProxy.d.ts.map +1 -1
- package/dist/documentStorageServiceProxy.js.map +1 -1
- package/dist/insecureUrlResolver.js.map +1 -1
- package/dist/messageRecognition.d.ts +2 -1
- package/dist/messageRecognition.d.ts.map +1 -1
- package/dist/messageRecognition.js +3 -3
- package/dist/messageRecognition.js.map +1 -1
- package/dist/network.js.map +1 -1
- package/dist/networkUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/parallelRequests.d.ts +1 -1
- package/dist/parallelRequests.d.ts.map +1 -1
- package/dist/parallelRequests.js.map +1 -1
- package/dist/prefetchDocumentStorageService.d.ts +1 -2
- package/dist/prefetchDocumentStorageService.d.ts.map +1 -1
- package/dist/prefetchDocumentStorageService.js.map +1 -1
- package/dist/rateLimiter.js.map +1 -1
- package/dist/runWithRetry.js.map +1 -1
- package/dist/storageUtils.d.ts +1 -2
- package/dist/storageUtils.d.ts.map +1 -1
- package/dist/storageUtils.js.map +1 -1
- package/dist/summaryForCreateNew.d.ts +2 -1
- package/dist/summaryForCreateNew.d.ts.map +1 -1
- package/dist/summaryForCreateNew.js +3 -3
- package/dist/summaryForCreateNew.js.map +1 -1
- package/dist/treeConversions.d.ts +2 -1
- package/dist/treeConversions.d.ts.map +1 -1
- package/dist/treeConversions.js +5 -5
- package/dist/treeConversions.js.map +1 -1
- package/lib/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +2 -2
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
- package/lib/adapters/predefinedAdapters.js.map +1 -1
- package/lib/blob.d.ts +1 -1
- package/lib/blob.d.ts.map +1 -1
- package/lib/blob.js +1 -1
- package/lib/blob.js.map +1 -1
- package/lib/buildSnapshotTree.d.ts +1 -1
- package/lib/buildSnapshotTree.d.ts.map +1 -1
- package/lib/buildSnapshotTree.js +1 -1
- package/lib/buildSnapshotTree.js.map +1 -1
- package/lib/documentServiceFactoryProxy.d.ts +1 -1
- package/lib/documentServiceFactoryProxy.d.ts.map +1 -1
- package/lib/documentServiceFactoryProxy.js.map +1 -1
- package/lib/documentServiceProxy.d.ts +1 -1
- package/lib/documentServiceProxy.d.ts.map +1 -1
- package/lib/documentServiceProxy.js.map +1 -1
- package/lib/documentStorageServiceProxy.d.ts +2 -2
- package/lib/documentStorageServiceProxy.d.ts.map +1 -1
- package/lib/documentStorageServiceProxy.js.map +1 -1
- package/lib/insecureUrlResolver.js.map +1 -1
- package/lib/messageRecognition.d.ts +2 -1
- package/lib/messageRecognition.d.ts.map +1 -1
- package/lib/messageRecognition.js +1 -1
- package/lib/messageRecognition.js.map +1 -1
- package/lib/network.js.map +1 -1
- package/lib/networkUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/parallelRequests.d.ts +1 -1
- package/lib/parallelRequests.d.ts.map +1 -1
- package/lib/parallelRequests.js.map +1 -1
- package/lib/prefetchDocumentStorageService.d.ts +1 -2
- package/lib/prefetchDocumentStorageService.d.ts.map +1 -1
- package/lib/prefetchDocumentStorageService.js +1 -1
- package/lib/prefetchDocumentStorageService.js.map +1 -1
- package/lib/rateLimiter.js.map +1 -1
- package/lib/runWithRetry.js.map +1 -1
- package/lib/storageUtils.d.ts +1 -2
- package/lib/storageUtils.d.ts.map +1 -1
- package/lib/storageUtils.js.map +1 -1
- package/lib/summaryForCreateNew.d.ts +2 -1
- package/lib/summaryForCreateNew.d.ts.map +1 -1
- package/lib/summaryForCreateNew.js +1 -1
- package/lib/summaryForCreateNew.js.map +1 -1
- package/lib/treeConversions.d.ts +2 -1
- package/lib/treeConversions.d.ts.map +1 -1
- package/lib/treeConversions.js +1 -1
- package/lib/treeConversions.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +12 -14
- package/src/adapters/compression/documentServiceFactoryCompressionAdapter.ts +1 -1
- package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +7 -7
- package/src/blob.ts +1 -1
- package/src/buildSnapshotTree.ts +8 -8
- package/src/documentServiceFactoryProxy.ts +1 -1
- package/src/documentServiceProxy.ts +1 -1
- package/src/documentStorageServiceProxy.ts +2 -5
- package/src/messageRecognition.ts +2 -5
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +1 -1
- package/src/prefetchDocumentStorageService.ts +5 -2
- package/src/storageUtils.ts +1 -2
- package/src/summaryForCreateNew.ts +2 -4
- package/src/treeConversions.ts +2 -1
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
6
|
+
import { ICommittedProposal, IDocumentAttributes } from "@fluidframework/driver-definitions/internal";
|
|
6
7
|
/**
|
|
7
8
|
* Defines the current layout of an .app + .protocol summary tree
|
|
8
9
|
* this is used internally for create new, and single commit summary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryForCreateNew.d.ts","sourceRoot":"","sources":["../src/summaryForCreateNew.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"summaryForCreateNew.d.ts","sourceRoot":"","sources":["../src/summaryForCreateNew.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,YAAY,EAAe,MAAM,oCAAoC,CAAC;AAC7F,OAAO,EACN,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,6CAA6C,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,YAAY;IAClE,IAAI,EAAE;QACL,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;QACvB,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC;KAC5B,CAAC;CACF;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC9C,OAAO,EAAE,YAAY,GAAG,SAAS,EACjC,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAC5B,OAAO,IAAI,6BAA6B,CAa1C;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CAClD,eAAe,EAAE,YAAY,GAC3B,mBAAmB,CAGrB;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,eAAe,EAAE,YAAY,GAC3B,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,CAOhC"}
|
|
@@ -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 { SummaryType
|
|
5
|
+
import { SummaryType } from "@fluidframework/driver-definitions";
|
|
6
6
|
/**
|
|
7
7
|
* Validates the current layout of an .app + .protocol summary tree
|
|
8
8
|
* this is used internally for create new, and single commit summary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryForCreateNew.js","sourceRoot":"","sources":["../src/summaryForCreateNew.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"summaryForCreateNew.js","sourceRoot":"","sources":["../src/summaryForCreateNew.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA8B,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAkB7F;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAC9C,OAAiC,EACjC,GAAG,iBAA2B;IAE9B,IACC,OAAO,EAAE,IAAI,KAAK,SAAS;QAC3B,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,KAAK,WAAW,CAAC,IAAI;QACjD,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,IAAI,KAAK,WAAW,CAAC,IAAI,EACrD,CAAC;QACF,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mCAAmC,CAClD,eAA6B;IAE7B,MAAM,cAAc,GAAG,eAAe,CAAC,IAAI,CAAC,UAA0B,CAAC;IACvE,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAiB,CAAwB,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kCAAkC,CACjD,eAA6B;IAE7B,MAAM,gBAAgB,GAAG,eAAe,CAAC,IAAI,CAAC,YAA4B,CAAC;IAC3E,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAiB,CAG/D,CAAC;IACJ,OAAO,YAAY,CAAC;AACrB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISummaryBlob, ISummaryTree, SummaryType } from \"@fluidframework/driver-definitions\";\nimport {\n\tICommittedProposal,\n\tIDocumentAttributes,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Defines the current layout of an .app + .protocol summary tree\n * this is used internally for create new, and single commit summary\n * @internal\n */\nexport interface CombinedAppAndProtocolSummary extends ISummaryTree {\n\ttree: {\n\t\t[\".app\"]: ISummaryTree;\n\t\t[\".protocol\"]: ISummaryTree;\n\t};\n}\n\n/**\n * Validates the current layout of an .app + .protocol summary tree\n * this is used internally for create new, and single commit summary\n * @internal\n */\nexport function isCombinedAppAndProtocolSummary(\n\tsummary: ISummaryTree | undefined,\n\t...optionalRootTrees: string[]\n): summary is CombinedAppAndProtocolSummary {\n\tif (\n\t\tsummary?.tree === undefined ||\n\t\tsummary.tree?.[\".app\"]?.type !== SummaryType.Tree ||\n\t\tsummary.tree?.[\".protocol\"]?.type !== SummaryType.Tree\n\t) {\n\t\treturn false;\n\t}\n\tconst treeKeys = Object.keys(summary.tree).filter((t) => !optionalRootTrees.includes(t));\n\tif (treeKeys.length !== 2) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n/**\n * Extract the attributes from the protocol summary.\n * @param protocolSummary - protocol summary from which the values are to be extracted.\n * @internal\n */\nexport function getDocAttributesFromProtocolSummary(\n\tprotocolSummary: ISummaryTree,\n): IDocumentAttributes {\n\tconst attributesBlob = protocolSummary.tree.attributes as ISummaryBlob;\n\treturn JSON.parse(attributesBlob.content as string) as IDocumentAttributes;\n}\n\n/**\n * Extract quorum values from the protocol summary.\n * @param protocolSummary - protocol summary from which the values are to be extracted.\n * @internal\n */\nexport function getQuorumValuesFromProtocolSummary(\n\tprotocolSummary: ISummaryTree,\n): [string, ICommittedProposal][] {\n\tconst quorumValuesBlob = protocolSummary.tree.quorumValues as ISummaryBlob;\n\tconst quorumValues = JSON.parse(quorumValuesBlob.content as string) as [\n\t\tstring,\n\t\tICommittedProposal,\n\t][];\n\treturn quorumValues;\n}\n"]}
|
package/lib/treeConversions.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ISummaryTree
|
|
5
|
+
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
6
|
+
import { ITree } from "@fluidframework/driver-definitions/internal";
|
|
6
7
|
/**
|
|
7
8
|
* Converts ISummaryTree to ITree format.
|
|
8
9
|
* @param summaryTree - summary tree in ISummaryTree format
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeConversions.d.ts","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"treeConversions.d.ts","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAe,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAc,MAAM,6CAA6C,CAAC;AAKhF;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,YAAY,GAAG,KAAK,CAiDlF"}
|
package/lib/treeConversions.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
6
6
|
import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import { SummaryType } from "@fluidframework/
|
|
7
|
+
import { SummaryType } from "@fluidframework/driver-definitions";
|
|
8
8
|
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "./blob.js";
|
|
9
9
|
import { isCombinedAppAndProtocolSummary } from "./summaryForCreateNew.js";
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeConversions.js","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"treeConversions.js","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAgB,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAG/E,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAE3E;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,WAAyB;IAC1E,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,+BAA+B,CAAC,WAAW,CAAC,CAAC;IACtE,MAAM,iBAAiB,GAAG,gBAAgB;QACzC,CAAC,CAAC;YACA,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;YACrD,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;SAC/C;QACH,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEpC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,iBAAiB,EAAE,CAAC;QAC9C,MAAM,CAAC,GAAG,gBAAgB,IAAI,GAAG,KAAK,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC;QACzE,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACpB,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;gBACvB,IAAI,aAAqB,CAAC;gBAC1B,IAAI,QAAQ,GAAuB,OAAO,CAAC;gBAC3C,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBACvC,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC/B,CAAC;qBAAM,CAAC;oBACP,aAAa,GAAG,kBAAkB,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;oBAC5D,QAAQ,GAAG,QAAQ,CAAC;gBACrB,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,CAAC,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;gBAC5D,MAAM;YACP,CAAC;YAED,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;gBACvB,OAAO,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,CAAC,EAAE,iCAAiC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC7E,MAAM;YACP,CAAC;YAED,KAAK,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;gBAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;gBACnD,MAAM;YACP,CAAC;YAED,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAChE,CAAC;YAED;gBACC,eAAe,CAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC;QACzD,CAAC;IACF,CAAC;IACD,OAAO;QACN,OAAO;QACP,YAAY,EAAE,WAAW,CAAC,YAAY;QACtC,OAAO,EAAE,WAAW,CAAC,OAAO;KAC5B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { ISummaryTree, SummaryType } from \"@fluidframework/driver-definitions\";\nimport { ITree, ITreeEntry } from \"@fluidframework/driver-definitions/internal\";\n\nimport { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from \"./blob.js\";\nimport { isCombinedAppAndProtocolSummary } from \"./summaryForCreateNew.js\";\n\n/**\n * Converts ISummaryTree to ITree format.\n * @param summaryTree - summary tree in ISummaryTree format\n * @internal\n */\nexport function convertSummaryTreeToSnapshotITree(summaryTree: ISummaryTree): ITree {\n\tconst entries: ITreeEntry[] = [];\n\tconst adaptSummaryTree = isCombinedAppAndProtocolSummary(summaryTree);\n\tconst allSummaryEntries = adaptSummaryTree\n\t\t? [\n\t\t\t\t...Object.entries(summaryTree.tree[\".protocol\"].tree),\n\t\t\t\t...Object.entries(summaryTree.tree[\".app\"].tree),\n\t\t ]\n\t\t: Object.entries(summaryTree.tree);\n\n\tfor (const [key, value] of allSummaryEntries) {\n\t\tconst k = adaptSummaryTree && key === \"attributes\" ? \".attributes\" : key;\n\t\tswitch (value.type) {\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tlet parsedContent: string;\n\t\t\t\tlet encoding: \"utf-8\" | \"base64\" = \"utf-8\";\n\t\t\t\tif (typeof value.content === \"string\") {\n\t\t\t\t\tparsedContent = value.content;\n\t\t\t\t} else {\n\t\t\t\t\tparsedContent = Uint8ArrayToString(value.content, \"base64\");\n\t\t\t\t\tencoding = \"base64\";\n\t\t\t\t}\n\t\t\t\tentries.push(new BlobTreeEntry(k, parsedContent, encoding));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\tentries.push(new TreeTreeEntry(k, convertSummaryTreeToSnapshotITree(value)));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Attachment: {\n\t\t\t\tentries.push(new AttachmentTreeEntry(k, value.id));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tthrow new Error(\"Should not have Handle type in summary tree\");\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tunreachableCase(value, \"Unexpected summary tree type\");\n\t\t}\n\t}\n\treturn {\n\t\tentries,\n\t\tunreferenced: summaryTree.unreferenced,\n\t\tgroupId: summaryTree.groupId,\n\t};\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.0.0-dev-rc.5.0.0.
|
|
3
|
+
"version": "2.0.0-dev-rc.5.0.0.267932",
|
|
4
4
|
"description": "Collection of utility functions for Fluid drivers",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -67,14 +67,12 @@
|
|
|
67
67
|
"temp-directory": "nyc/.nyc_output"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluid-internal/client-utils": "2.0.0-dev-rc.5.0.0.
|
|
71
|
-
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.
|
|
72
|
-
"@fluidframework/core-utils": "2.0.0-dev-rc.5.0.0.
|
|
73
|
-
"@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.
|
|
74
|
-
"@fluidframework/gitresources": "^4.0.0",
|
|
70
|
+
"@fluid-internal/client-utils": "2.0.0-dev-rc.5.0.0.267932",
|
|
71
|
+
"@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.267932",
|
|
72
|
+
"@fluidframework/core-utils": "2.0.0-dev-rc.5.0.0.267932",
|
|
73
|
+
"@fluidframework/driver-definitions": "2.0.0-dev-rc.5.0.0.267932",
|
|
75
74
|
"@fluidframework/protocol-base": "^4.0.0",
|
|
76
|
-
"@fluidframework/
|
|
77
|
-
"@fluidframework/telemetry-utils": "2.0.0-dev-rc.5.0.0.263932",
|
|
75
|
+
"@fluidframework/telemetry-utils": "2.0.0-dev-rc.5.0.0.267932",
|
|
78
76
|
"axios": "^1.6.2",
|
|
79
77
|
"lz4js": "^0.2.0",
|
|
80
78
|
"uuid": "^9.0.0"
|
|
@@ -82,13 +80,13 @@
|
|
|
82
80
|
"devDependencies": {
|
|
83
81
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
84
82
|
"@biomejs/biome": "^1.6.2",
|
|
85
|
-
"@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.5.0.0.
|
|
86
|
-
"@fluid-tools/build-cli": "^0.
|
|
83
|
+
"@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.5.0.0.267932",
|
|
84
|
+
"@fluid-tools/build-cli": "^0.39.0-264124",
|
|
87
85
|
"@fluidframework/build-common": "^2.0.3",
|
|
88
|
-
"@fluidframework/build-tools": "^0.
|
|
89
|
-
"@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.0.0-rc.
|
|
86
|
+
"@fluidframework/build-tools": "^0.39.0-264124",
|
|
87
|
+
"@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.0.0-rc.4.0.0",
|
|
90
88
|
"@fluidframework/eslint-config-fluid": "^5.1.0",
|
|
91
|
-
"@microsoft/api-extractor": "^7.
|
|
89
|
+
"@microsoft/api-extractor": "^7.45.1",
|
|
92
90
|
"@types/mocha": "^9.1.1",
|
|
93
91
|
"@types/node": "^18.19.0",
|
|
94
92
|
"@types/sinon": "^17.0.3",
|
|
@@ -104,7 +102,7 @@
|
|
|
104
102
|
"prettier": "~3.0.3",
|
|
105
103
|
"rimraf": "^4.4.0",
|
|
106
104
|
"sinon": "^17.0.1",
|
|
107
|
-
"typescript": "~5.
|
|
105
|
+
"typescript": "~5.4.5"
|
|
108
106
|
},
|
|
109
107
|
"typeValidation": {
|
|
110
108
|
"broken": {}
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
7
8
|
import {
|
|
8
9
|
IDocumentService,
|
|
9
10
|
IDocumentServiceFactory,
|
|
10
11
|
IResolvedUrl,
|
|
11
12
|
} from "@fluidframework/driver-definitions/internal";
|
|
12
|
-
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
13
13
|
|
|
14
14
|
import { DocumentServiceFactoryProxy } from "../../documentServiceFactoryProxy.js";
|
|
15
15
|
|
package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
import { IsoBuffer } from "@fluid-internal/client-utils";
|
|
7
7
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
8
|
import {
|
|
9
|
-
IDocumentStorageService,
|
|
10
|
-
ISummaryContext,
|
|
11
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
12
|
-
import {
|
|
13
|
-
ISnapshotTree,
|
|
14
9
|
ISummaryBlob,
|
|
15
10
|
ISummaryHandle,
|
|
16
11
|
ISummaryTree,
|
|
17
|
-
IVersion,
|
|
18
12
|
SummaryObject,
|
|
19
13
|
SummaryType,
|
|
20
|
-
} from "@fluidframework/
|
|
14
|
+
} from "@fluidframework/driver-definitions";
|
|
15
|
+
import {
|
|
16
|
+
IDocumentStorageService,
|
|
17
|
+
ISummaryContext,
|
|
18
|
+
ISnapshotTree,
|
|
19
|
+
IVersion,
|
|
20
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
21
21
|
import { compress, decompress } from "lz4js";
|
|
22
22
|
|
|
23
23
|
import { ICompressionStorageConfig, SummaryCompressionAlgorithm } from "..//index.js";
|
package/src/blob.ts
CHANGED
package/src/buildSnapshotTree.ts
CHANGED
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
|
|
6
6
|
import { stringToBuffer } from "@fluid-internal/client-utils";
|
|
7
7
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
|
-
import
|
|
9
|
-
import { buildGitTreeHierarchy } from "@fluidframework/protocol-base";
|
|
8
|
+
import type { IGitTree, IGitTreeEntry } from "@fluidframework/driver-definitions/internal";
|
|
10
9
|
import {
|
|
11
10
|
FileMode,
|
|
12
11
|
ISnapshotTree,
|
|
13
12
|
ITreeEntry,
|
|
14
13
|
TreeEntry,
|
|
15
|
-
} from "@fluidframework/
|
|
14
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
15
|
+
import { buildGitTreeHierarchy } from "@fluidframework/protocol-base";
|
|
16
16
|
import { v4 as uuid } from "uuid";
|
|
17
17
|
|
|
18
18
|
function flattenCore(
|
|
19
19
|
path: string,
|
|
20
20
|
treeEntries: ITreeEntry[],
|
|
21
21
|
blobMap: Map<string, ArrayBufferLike>,
|
|
22
|
-
):
|
|
23
|
-
const entries:
|
|
22
|
+
): IGitTreeEntry[] {
|
|
23
|
+
const entries: IGitTreeEntry[] = [];
|
|
24
24
|
for (const treeEntry of treeEntries) {
|
|
25
25
|
const subPath = `${path}${treeEntry.path}`;
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ function flattenCore(
|
|
|
30
30
|
const id = uuid();
|
|
31
31
|
blobMap.set(id, buffer);
|
|
32
32
|
|
|
33
|
-
const entry:
|
|
33
|
+
const entry: IGitTreeEntry = {
|
|
34
34
|
mode: FileMode[treeEntry.mode],
|
|
35
35
|
path: subPath,
|
|
36
36
|
sha: id,
|
|
@@ -45,7 +45,7 @@ function flattenCore(
|
|
|
45
45
|
0x101 /* "Unexpected tree entry type on flatten!" */,
|
|
46
46
|
);
|
|
47
47
|
const t = treeEntry.value;
|
|
48
|
-
const entry:
|
|
48
|
+
const entry: IGitTreeEntry = {
|
|
49
49
|
mode: FileMode[treeEntry.mode],
|
|
50
50
|
path: subPath,
|
|
51
51
|
sha: "",
|
|
@@ -70,7 +70,7 @@ function flattenCore(
|
|
|
70
70
|
* @param blobMap - a map of blob's sha1 to content
|
|
71
71
|
* @returns A flatten with of the ITreeEntry
|
|
72
72
|
*/
|
|
73
|
-
function flatten(tree: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>):
|
|
73
|
+
function flatten(tree: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>): IGitTree {
|
|
74
74
|
const entries = flattenCore("", tree, blobMap);
|
|
75
75
|
return {
|
|
76
76
|
sha: "",
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
7
8
|
import {
|
|
8
9
|
IDocumentService,
|
|
9
10
|
IDocumentServiceFactory,
|
|
10
11
|
IResolvedUrl,
|
|
11
12
|
} from "@fluidframework/driver-definitions/internal";
|
|
12
|
-
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* This abstract class implements IDocumentServiceFactory interface. It uses delegation pattern.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
+
import { IClient } from "@fluidframework/driver-definitions";
|
|
7
8
|
import {
|
|
8
9
|
IDocumentDeltaConnection,
|
|
9
10
|
IDocumentDeltaStorageService,
|
|
@@ -12,7 +13,6 @@ import {
|
|
|
12
13
|
IDocumentStorageService,
|
|
13
14
|
IResolvedUrl,
|
|
14
15
|
} from "@fluidframework/driver-definitions/internal";
|
|
15
|
-
import { IClient } from "@fluidframework/protocol-definitions";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* This abstract class implements IDocumentService interface. It uses delegation pattern.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { ISummaryHandle, ISummaryTree } from "@fluidframework/driver-definitions";
|
|
6
7
|
import {
|
|
7
8
|
FetchSource,
|
|
8
9
|
IDocumentStorageService,
|
|
@@ -10,14 +11,10 @@ import {
|
|
|
10
11
|
ISnapshot,
|
|
11
12
|
ISnapshotFetchOptions,
|
|
12
13
|
ISummaryContext,
|
|
13
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
14
|
-
import {
|
|
15
14
|
ICreateBlobResponse,
|
|
16
15
|
ISnapshotTree,
|
|
17
|
-
ISummaryHandle,
|
|
18
|
-
ISummaryTree,
|
|
19
16
|
IVersion,
|
|
20
|
-
} from "@fluidframework/
|
|
17
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
21
18
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
22
19
|
|
|
23
20
|
/**
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
ISequencedDocumentMessage,
|
|
9
|
-
MessageType,
|
|
10
|
-
} from "@fluidframework/protocol-definitions";
|
|
6
|
+
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
|
|
7
|
+
import { IDocumentMessage, MessageType } from "@fluidframework/driver-definitions/internal";
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
10
|
* Tells if message was sent by container runtime
|
package/src/packageVersion.ts
CHANGED
package/src/parallelRequests.ts
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
import { performance } from "@fluid-internal/client-utils";
|
|
7
7
|
import { ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { assert, Deferred } from "@fluidframework/core-utils/internal";
|
|
9
|
+
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
|
|
9
10
|
import {
|
|
10
11
|
IDeltasFetchResult,
|
|
11
12
|
IStream,
|
|
12
13
|
IStreamResult,
|
|
13
14
|
} from "@fluidframework/driver-definitions/internal";
|
|
14
|
-
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
15
15
|
import { ITelemetryLoggerExt, PerformanceEvent } from "@fluidframework/telemetry-utils/internal";
|
|
16
16
|
|
|
17
17
|
import { canRetryOnError, createGenericNetworkError, getRetryDelayFromError } from "./network.js";
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
LoaderCachingPolicy,
|
|
8
|
+
ISnapshotTree,
|
|
9
|
+
IVersion,
|
|
10
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
8
11
|
|
|
9
12
|
import { DocumentStorageServiceProxy } from "./documentStorageServiceProxy.js";
|
|
10
13
|
import { canRetryOnError } from "./network.js";
|
package/src/storageUtils.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ISnapshot } from "@fluidframework/driver-definitions/internal";
|
|
7
|
-
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
6
|
+
import { ISnapshot, ISnapshotTree } from "@fluidframework/driver-definitions/internal";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Utility API to check if the type of snapshot contents is `ISnapshot`.
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { ISummaryBlob, ISummaryTree, SummaryType } from "@fluidframework/driver-definitions";
|
|
6
7
|
import {
|
|
7
8
|
ICommittedProposal,
|
|
8
9
|
IDocumentAttributes,
|
|
9
|
-
|
|
10
|
-
ISummaryTree,
|
|
11
|
-
SummaryType,
|
|
12
|
-
} from "@fluidframework/protocol-definitions";
|
|
10
|
+
} from "@fluidframework/driver-definitions/internal";
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* Defines the current layout of an .app + .protocol summary tree
|
package/src/treeConversions.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
7
7
|
import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
8
|
-
import { ISummaryTree,
|
|
8
|
+
import { ISummaryTree, SummaryType } from "@fluidframework/driver-definitions";
|
|
9
|
+
import { ITree, ITreeEntry } from "@fluidframework/driver-definitions/internal";
|
|
9
10
|
|
|
10
11
|
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "./blob.js";
|
|
11
12
|
import { isCombinedAppAndProtocolSummary } from "./summaryForCreateNew.js";
|