@fluidframework/driver-utils 2.2.0 → 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.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.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 +36 -14
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentStorageServiceSummaryBlobCompressionAdapter.d.ts","sourceRoot":"","sources":["../../../../src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,cAAc,EACd,YAAY,EAGZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAA+B,MAAM,aAAa,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAG3D;;;;;;;;;;;GAWG;AACH,qBAAa,wCAAyC,SAAQ,2BAA2B;IAKvF,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJzB,OAAO,CAAC,qBAAqB,CAAkB;gBAG9C,OAAO,EAAE,uBAAuB,EACf,OAAO,EAAE,yBAAyB;IAKpD,IAAW,OAAO,IAAI,uBAAuB,CAE5C;IAED;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;
|
|
1
|
+
{"version":3,"file":"documentStorageServiceSummaryBlobCompressionAdapter.d.ts","sourceRoot":"","sources":["../../../../src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,cAAc,EACd,YAAY,EAGZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAA+B,MAAM,aAAa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AAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAYpE;;;;;;;OAOG;IACmB,eAAe,CACpC,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,EAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,GAE/B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAShC;;;;;OAKG;IACmB,wBAAwB,CAC7C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC;IAQlB;;;;OAIG;IACmB,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;CAYhF"}
|
package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js
CHANGED
|
@@ -43,8 +43,6 @@ class DocumentStorageServiceCompressionAdapter extends documentStorageServicePro
|
|
|
43
43
|
* @returns `true` if there is a compression markup byte in the blob, otherwise `false`.
|
|
44
44
|
*/
|
|
45
45
|
static hasPrefix(blob) {
|
|
46
|
-
// TODO why are we non null asserting here?
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
48
46
|
const firstByte = client_utils_1.IsoBuffer.from(blob)[0];
|
|
49
47
|
// eslint-disable-next-line no-bitwise
|
|
50
48
|
return (firstByte & 0xf0) === 0xb0;
|
|
@@ -56,8 +54,7 @@ class DocumentStorageServiceCompressionAdapter extends documentStorageServicePro
|
|
|
56
54
|
static readAlgorithmFromBlob(blob) {
|
|
57
55
|
return !this.hasPrefix(blob)
|
|
58
56
|
? index_js_1.SummaryCompressionAlgorithm.None
|
|
59
|
-
: //
|
|
60
|
-
// eslint-disable-next-line no-bitwise, @typescript-eslint/no-non-null-assertion
|
|
57
|
+
: // eslint-disable-next-line no-bitwise
|
|
61
58
|
client_utils_1.IsoBuffer.from(blob)[0] & 0x0f;
|
|
62
59
|
}
|
|
63
60
|
/**
|
|
@@ -68,8 +65,6 @@ class DocumentStorageServiceCompressionAdapter extends documentStorageServicePro
|
|
|
68
65
|
*/
|
|
69
66
|
static writeAlgorithmToBlob(blob, algorithm) {
|
|
70
67
|
if (algorithm === index_js_1.SummaryCompressionAlgorithm.None) {
|
|
71
|
-
// TODO why are we non null asserting here?
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
73
68
|
const firstByte = client_utils_1.IsoBuffer.from(blob)[0];
|
|
74
69
|
// eslint-disable-next-line no-bitwise
|
|
75
70
|
if ((firstByte & 0xf0) !== 0xb0) {
|
|
@@ -198,7 +193,8 @@ class DocumentStorageServiceCompressionAdapter extends documentStorageServicePro
|
|
|
198
193
|
*/
|
|
199
194
|
static findMetadataHolderSummary(summary) {
|
|
200
195
|
(0, internal_1.assert)(typeof summary === "object", 0x6f7 /* summary must be a non-null object */);
|
|
201
|
-
for (const
|
|
196
|
+
for (const key of Object.keys(summary.tree)) {
|
|
197
|
+
const value = summary.tree[key];
|
|
202
198
|
if (Boolean(value) && value.type === driver_definitions_1.SummaryType.Tree) {
|
|
203
199
|
const found = this.findMetadataHolderSummary(value);
|
|
204
200
|
if (found) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentStorageServiceSummaryBlobCompressionAdapter.js","sourceRoot":"","sources":["../../../../src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAyD;AACzD,kEAA6D;AAC7D,2EAM4C;AAO5C,iCAA6C;AAE7C,4FAAsF;AACtF,0CAAqF;AAErF;;GAEG;AACU,QAAA,mBAAmB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,MAAa,wCAAyC,SAAQ,4DAA2B;IAGxF,YACC,OAAgC,EACf,OAAkC;QAEnD,KAAK,CAAC,OAAO,CAAC,CAAC;QAFE,YAAO,GAAP,OAAO,CAA2B;QAJ5C,0BAAqB,GAAY,KAAK,C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a,CACvF,WAAW,CAAC,OAAO,CACnB,CAAC;QACF,MAAM,SAAS,GAAoB,wCAAwC,CAAC,UAAU,CACrF,QAAQ,EACR,MAAM,CACN,CAAC;QACF,MAAM,cAAc,GAAG;YACtB,IAAI,EAAE,gCAAW,CAAC,IAAI;YACtB,OAAO,EAAE,wBAAS,CAAC,IAAI,CAAC,SAAS,CAAC;SAClC,CAAC;QACF,OAAO,cAAc,CAAC;IACvB,CAAC;SAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,AArBkC,CAqBjC;AAEF;;;;GAIG;AACqB,oDAAW,GAAG,CAAC,KAAoB,EAAiB,EAAE;IAC7E,IAAI,KAAK,CAAC,IAAI,KAAK,gCAAW,CAAC,IAAI,EAAE,CAAC;QACrC,MAAM,WAAW,GAAiB,KAAK,CAAC;QACxC,MAAM,QAAQ,GAAe,wCAAwC,CAAC,aAAa,CAClF,WAAW,CAAC,OAAO,CACnB,CAAC;QACF,MAAM,SAAS,GACd,wCAAwC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC/D,MAAM,cAAc,GAAG;YACtB,IAAI,EAAE,gCAAW,CAAC,IAAI;YACtB,OAAO,EAAE,wBAAS,CAAC,IAAI,CAAC,SAAS,CAAC;SAClC,CAAC;QACF,OAAO,cAAc,CAAC;IACvB,CAAC;SAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,AAhBkC,CAgBjC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tISummaryBlob,\n\tISummaryHandle,\n\tISummaryTree,\n\tSummaryObject,\n\tSummaryType,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentStorageService,\n\tISummaryContext,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { compress, decompress } from \"lz4js\";\n\nimport { DocumentStorageServiceProxy } from \"../../../documentStorageServiceProxy.js\";\nimport { ICompressionStorageConfig, SummaryCompressionAlgorithm } from \"../index.js\";\n\n/**\n * @internal\n */\nexport const blobHeadersBlobName = \".metadata.blobHeaders\";\nconst metadataBlobName = \".metadata\";\n\n/**\n * This class is a proxy for the IDocumentStorageService that compresses and decompresses blobs in the summary.\n * The identification of the compressed blobs is done by adding a compression markup blob to the summary.\n * Even if the markup blob is present, it does not mean that all blobs are compressed. The blob,\n * which is compressed also contain the compression algorithm enumerated value from the\n * SummaryCompressionAlgorithm enumeration in the first byte . If the blob is not\n * commpressed, it contains the first byte equals to SummaryCompressionAlgorithm.None .\n * In case, the markup blob is present, it is expected that the first byte of the markup blob\n * will contain the info about the compression. If the first byte is not present, it is assumed\n * that the compression is not enabled and no first prefix byte is present in the blobs.\n * @public\n */\nexport class DocumentStorageServiceCompressionAdapter extends DocumentStorageServiceProxy {\n\tprivate _isCompressionEnabled: boolean = false;\n\n\tconstructor(\n\t\tservice: IDocumentStorageService,\n\t\tprivate readonly _config: ICompressionStorageConfig,\n\t) {\n\t\tsuper(service);\n\t}\n\n\tpublic get service(): IDocumentStorageService {\n\t\treturn this.internalStorageService;\n\t}\n\n\t/**\n\t * This method returns `true` if there is a compression markup byte in the blob, otherwise `false`.\n\t * @param blob - The blob to compress.\n\t * @returns `true` if there is a compression markup byte in the blob, otherwise `false`.\n\t */\n\tprivate static hasPrefix(blob: ArrayBufferLike): boolean {\n\t\t// TODO why are we non null asserting here?\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\tconst firstByte = IsoBuffer.from(blob)[0]!;\n\t\t// eslint-disable-next-line no-bitwise\n\t\treturn (firstByte & 0xf0) === 0xb0;\n\t}\n\n\t/**\n\t * This method reads the first byte from the given blob and maps that byte to the compression algorithm.\n\t * @param blob - The maybe compressed blob.\n\t */\n\tprivate static readAlgorithmFromBlob(blob: ArrayBufferLike): number {\n\t\treturn !this.hasPrefix(blob)\n\t\t\t? SummaryCompressionAlgorithm.None\n\t\t\t: // TODO why are we non null asserting here?\n\t\t\t\t// eslint-disable-next-line no-bitwise, @typescript-eslint/no-non-null-assertion\n\t\t\t\tIsoBuffer.from(blob)[0]! & 0x0f;\n\t}\n\n\t/**\n\t * This method writes the given algorithm to the blob as the first byte.\n\t * @param blob - The blob to write the algorithm to.\n\t * @param algorithm - The algorithm to write.\n\t * @returns The blob with the algorithm as the first byte.\n\t */\n\tprivate static writeAlgorithmToBlob(\n\t\tblob: ArrayBufferLike,\n\t\talgorithm: number,\n\t): ArrayBufferLike {\n\t\tif (algorithm === SummaryCompressionAlgorithm.None) {\n\t\t\t// TODO why are we non null asserting here?\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst firstByte = IsoBuffer.from(blob)[0]!;\n\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\tif ((firstByte & 0xf0) !== 0xb0) {\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t}\n\t\tassert(algorithm < 0x10, 0x6f5 /* Algorithm should be less than 0x10 */);\n\t\tconst blobView = new Uint8Array(blob);\n\t\tconst blobLength = blobView.length;\n\t\tconst newBlob = new Uint8Array(blobLength + 1);\n\t\t// eslint-disable-next-line no-bitwise\n\t\tconst prefix = 0xb0 | algorithm;\n\t\tnewBlob[0] = prefix;\n\t\tnewBlob.set(blobView, 1);\n\t\treturn IsoBuffer.from(newBlob);\n\t}\n\n\t/**\n\t * This method removes the algorithm markup prefix from the blob (1 byte)\n\t * @param blob - The blob to remove the prefix from.\n\t * @returns The blob without the prefix.\n\t */\n\tprivate static removePrefixFromBlobIfPresent(blob: ArrayBufferLike): ArrayBufferLike {\n\t\tconst blobView = new Uint8Array(blob);\n\t\treturn this.hasPrefix(blob) ? IsoBuffer.from(blobView.subarray(1)) : blob;\n\t}\n\n\t/**\n\t * This method converts the given argument to Uint8Array. If the parameter is already Uint8Array,\n\t * it is just returned as is. If the parameter is string, it is converted to Uint8Array using\n\t * TextEncoder.\n\t * @param input - The input to convert to Uint8Array.\n\t * @returns The Uint8Array representation of the input.\n\t */\n\tprivate static toBinaryArray(input: string | Uint8Array): Uint8Array {\n\t\treturn typeof input === \"string\" ? new TextEncoder().encode(input) : input;\n\t}\n\n\t/**\n\t * This method encodes the blob inside the given summary object of the SummaryType.Blob type using the given config\n\t * containing the compression algorithm.\n\t * @param input - The summary object to encode.\n\t * @param config - The config containing the compression algorithm.\n\t * @returns The summary object with the encoded blob.\n\t */\n\tprivate static readonly blobEncoder = (\n\t\tinput: SummaryObject,\n\t\tconfig: ICompressionStorageConfig,\n\t): SummaryObject => {\n\t\tif (input.type === SummaryType.Blob) {\n\t\t\tconst summaryBlob: ISummaryBlob = input;\n\t\t\tconst original: ArrayBufferLike = DocumentStorageServiceCompressionAdapter.toBinaryArray(\n\t\t\t\tsummaryBlob.content,\n\t\t\t);\n\t\t\tconst processed: ArrayBufferLike = DocumentStorageServiceCompressionAdapter.encodeBlob(\n\t\t\t\toriginal,\n\t\t\t\tconfig,\n\t\t\t);\n\t\t\tconst newSummaryBlob = {\n\t\t\t\ttype: SummaryType.Blob,\n\t\t\t\tcontent: IsoBuffer.from(processed),\n\t\t\t};\n\t\t\treturn newSummaryBlob;\n\t\t} else {\n\t\t\treturn input;\n\t\t}\n\t};\n\n\t/**\n\t * This method decodes the blob inside the given summary object of the SummaryType.Blob type.\n\t * @param input - The summary object to decode.\n\t * @returns The summary object with the decoded blob.\n\t */\n\tprivate static readonly blobDecoder = (input: SummaryObject): SummaryObject => {\n\t\tif (input.type === SummaryType.Blob) {\n\t\t\tconst summaryBlob: ISummaryBlob = input;\n\t\t\tconst original: Uint8Array = DocumentStorageServiceCompressionAdapter.toBinaryArray(\n\t\t\t\tsummaryBlob.content,\n\t\t\t);\n\t\t\tconst processed: ArrayBufferLike =\n\t\t\t\tDocumentStorageServiceCompressionAdapter.decodeBlob(original);\n\t\t\tconst newSummaryBlob = {\n\t\t\t\ttype: SummaryType.Blob,\n\t\t\t\tcontent: IsoBuffer.from(processed),\n\t\t\t};\n\t\t\treturn newSummaryBlob;\n\t\t} else {\n\t\t\treturn input;\n\t\t}\n\t};\n\n\t/**\n\t * This method encodes the given blob according to the given config.\n\t * @param file - The blob to encode.\n\t * @param config - The config to use for encoding.\n\t * @returns The encoded blob.\n\t */\n\tprivate static encodeBlob(\n\t\tfile: ArrayBufferLike,\n\t\tconfig: ICompressionStorageConfig,\n\t): ArrayBufferLike {\n\t\tlet maybeCompressed: ArrayBufferLike;\n\t\tlet algorithm = config.algorithm;\n\t\tif (new Uint8Array(file).length < config.minSizeToCompress) {\n\t\t\tmaybeCompressed = file;\n\t\t\talgorithm = SummaryCompressionAlgorithm.None;\n\t\t} else if (algorithm === SummaryCompressionAlgorithm.None) {\n\t\t\tmaybeCompressed = file;\n\t\t} else if (algorithm === SummaryCompressionAlgorithm.LZ4) {\n\t\t\tconst compressed = compress(file) as ArrayBufferLike;\n\t\t\tmaybeCompressed = compressed;\n\t\t} else {\n\t\t\tthrow new Error(`Unknown Algorithm ${config.algorithm}`);\n\t\t}\n\t\tmaybeCompressed = DocumentStorageServiceCompressionAdapter.writeAlgorithmToBlob(\n\t\t\tmaybeCompressed,\n\t\t\talgorithm,\n\t\t);\n\t\treturn maybeCompressed;\n\t}\n\n\t/**\n\t * This method decodes the given blob.\n\t * @param file - The blob to decode.\n\t * @returns The decoded blob.\n\t */\n\tprivate static decodeBlob(file: ArrayBufferLike): ArrayBufferLike {\n\t\tlet decompressed: ArrayBufferLike;\n\t\tlet originalBlob;\n\t\tlet algorithm;\n\t\tif (this.hasPrefix(file)) {\n\t\t\talgorithm = DocumentStorageServiceCompressionAdapter.readAlgorithmFromBlob(file);\n\t\t\toriginalBlob = this.removePrefixFromBlobIfPresent(file);\n\t\t} else {\n\t\t\talgorithm = SummaryCompressionAlgorithm.None;\n\t\t\toriginalBlob = file;\n\t\t}\n\t\tif (algorithm === SummaryCompressionAlgorithm.None) {\n\t\t\tdecompressed = originalBlob;\n\t\t} else if (algorithm === SummaryCompressionAlgorithm.LZ4) {\n\t\t\tdecompressed = decompress(originalBlob) as ArrayBufferLike;\n\t\t} else {\n\t\t\tthrow new Error(`Unknown Algorithm ${algorithm}`);\n\t\t}\n\t\treturn decompressed;\n\t}\n\n\t/**\n\t * This method traverses the SummaryObject recursively. If it finds the ISummaryBlob object,\n\t * it applies encoding/decoding on it according to the given isEncode flag.\n\t * @param isEncode - True if the encoding should be applied, false if the decoding should be applied.\n\t * @param input - The summary object to traverse.\n\t * @param encoder - The encoder function to use.\n\t * @param decoder - The decoder function to use.\n\t * @param config - The config to use for encoding.\n\t * @param context - The summary context.\n\t * @returns The summary object with the encoded/decoded blob.\n\t */\n\tprivate static recursivelyReplace(\n\t\tisEncode: boolean,\n\t\tinput: SummaryObject,\n\t\tencoder: (input: SummaryObject, config: ICompressionStorageConfig) => SummaryObject,\n\t\tdecoder: (input: SummaryObject) => SummaryObject,\n\t\tconfig: ICompressionStorageConfig,\n\t\tcontext?: ISummaryContext,\n\t): SummaryObject {\n\t\tassert(typeof input === \"object\", 0x6f6 /* input must be a non-null object */);\n\t\tconst maybeReplaced = isEncode ? encoder(input, config) : decoder(input);\n\n\t\tif (maybeReplaced !== input) {\n\t\t\treturn maybeReplaced;\n\t\t}\n\t\tlet clone: object | undefined;\n\t\tfor (const key of Object.keys(input)) {\n\t\t\tconst value = input[key];\n\n\t\t\tif (Boolean(value) && typeof value === \"object\") {\n\t\t\t\tconst replaced = this.recursivelyReplace(\n\t\t\t\t\tisEncode,\n\t\t\t\t\tvalue as SummaryObject,\n\t\t\t\t\tencoder,\n\t\t\t\t\tdecoder,\n\t\t\t\t\tconfig,\n\t\t\t\t\tcontext,\n\t\t\t\t);\n\t\t\t\tif (replaced !== value) {\n\t\t\t\t\tclone = clone ?? (Array.isArray(input) ? [...input] : { ...input });\n\t\t\t\t\tclone[key] = replaced;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (clone ?? input) as SummaryObject;\n\t}\n\n\t/**\n\t * This method traverses the SummaryTree recursively. If it finds the ISummaryBlob object with the key '.metadata',\n\t * it returns the summary tree containing that blob.\n\t *\n\t * @param summary - The summary tree to traverse.\n\t * @returns The summary tree containing the metadata blob.\n\t */\n\tprivate static findMetadataHolderSummary(summary: ISummaryTree): ISummaryTree | undefined {\n\t\tassert(typeof summary === \"object\", 0x6f7 /* summary must be a non-null object */);\n\t\tfor (const [key, value] of Object.entries(summary.tree)) {\n\t\t\tif (Boolean(value) && value.type === SummaryType.Tree) {\n\t\t\t\tconst found = this.findMetadataHolderSummary(value);\n\t\t\t\tif (found) {\n\t\t\t\t\treturn found;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Boolean(value) && key === metadataBlobName && value.type === SummaryType.Blob) {\n\t\t\t\treturn summary;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * This method obtains the summary tree containing the metadata blob. It returns the content\n\t * of the tree atribute.\n\t * @param summary - The summary tree to traverse.\n\t * @returns The content of the tree attribute of the summary tree containing the metadata blob.\n\t */\n\tprivate static getMetadataHolderTree(summary: ISummaryTree) {\n\t\tconst metadataHolder = this.findMetadataHolderSummary(summary);\n\t\tassert(metadataHolder !== undefined, 0x6f8 /* metadataHolder must be a non-null object */);\n\t\tconst metadataHolderTree = metadataHolder.tree;\n\t\treturn metadataHolderTree;\n\t}\n\n\t/**\n\t * This method adds the compression markup blob to the nested summary tree containing the metadata blob.\n\t * @param summary - The top summary tree to put the compression markup blob into.\n\t */\n\tprivate static putCompressionMarkup(summary: ISummaryTree): void {\n\t\tconst metadataHolderTree =\n\t\t\tDocumentStorageServiceCompressionAdapter.getMetadataHolderTree(summary);\n\t\tmetadataHolderTree[blobHeadersBlobName] = {\n\t\t\ttype: 2,\n\t\t\tcontent: \"\",\n\t\t};\n\t}\n\n\t/**\n\t * This method traverses the SnapshotTree recursively. If it finds the ISummaryBlob object with the key '.metadata',\n\t * it checks, if the SummaryTree holder of that object also contains the compression markup blob. If it is found,\n\t * it returns true, otherwise false.\n\t * @param snapshot - The snapshot tree to traverse.\n\t * @returns True if the compression markup blob is found, otherwise false.\n\t */\n\tprivate static hasCompressionMarkup(snapshot: ISnapshotTree): boolean {\n\t\tassert(typeof snapshot === \"object\", 0x6f9 /* snapshot must be a non-null object */);\n\t\tfor (const key of Object.keys(snapshot.blobs)) {\n\t\t\tif (key === metadataBlobName) {\n\t\t\t\tconst value = snapshot.blobs[blobHeadersBlobName];\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const key of Object.keys(snapshot.trees)) {\n\t\t\tconst value = snapshot[key] as ISnapshotTree;\n\t\t\tif (value !== undefined) {\n\t\t\t\tconst found = this.hasCompressionMarkup(value);\n\t\t\t\tif (found) {\n\t\t\t\t\treturn found;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * This method performs compression of the blobs in the summary tree.\n\t * @param summary - The summary tree to compress.\n\t * @param config - The compression config.\n\t * @returns The compressed summary tree.\n\t */\n\tpublic static compressSummary(\n\t\tsummary: ISummaryTree,\n\t\tconfig: ICompressionStorageConfig,\n\t): ISummaryTree {\n\t\tthis.putCompressionMarkup(summary);\n\t\tconst prep = DocumentStorageServiceCompressionAdapter.recursivelyReplace(\n\t\t\ttrue,\n\t\t\tsummary,\n\t\t\tDocumentStorageServiceCompressionAdapter.blobEncoder,\n\t\t\tDocumentStorageServiceCompressionAdapter.blobDecoder,\n\t\t\tconfig,\n\t\t) as ISummaryTree;\n\t\t//\tconsole.log(`Miso summary-blob Summary Upload: ${JSON.stringify(prep).length}`);\n\t\treturn prep;\n\t}\n\n\t/**\n\t * This method read blob from the storage and decompresses it if it is compressed.\n\t * @param id - The id of the blob to read.\n\t * @returns The decompressed blob.\n\t */\n\tpublic override async readBlob(id: string): Promise<ArrayBufferLike> {\n\t\tconst originalBlob = await super.readBlob(id);\n\t\tif (!this._isCompressionEnabled) {\n\t\t\treturn originalBlob;\n\t\t} else {\n\t\t\tconst decompressedBlob =\n\t\t\t\tDocumentStorageServiceCompressionAdapter.decodeBlob(originalBlob);\n\t\t\t//\t\t\tconsole.log(`Miso summary-blob Blob read END : ${id} ${decompressedBlob.byteLength}`);\n\t\t\treturn decompressedBlob;\n\t\t}\n\t}\n\n\t/**\n\t * This method loads the snapshot tree from the server. It also checks, if the compression markup blob is present\n\t * and setups the compression flag accordingly. It also identifies the blobs that are not compressed and do not contain\n\t * algorithm byte prefix and store them.\n\t * @param version - The version of the snapshot tree to load.\n\t * @param scenarioName - The scenario name of the snapshot tree to load.\n\t * @returns The snapshot tree.\n\t */\n\tpublic override async getSnapshotTree(\n\t\tversion?: IVersion | undefined,\n\t\tscenarioName?: string | undefined,\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t): Promise<ISnapshotTree | null> {\n\t\tconst snapshotTree = await super.getSnapshotTree(version, scenarioName);\n\t\tthis._isCompressionEnabled =\n\t\t\tsnapshotTree !== undefined &&\n\t\t\tsnapshotTree !== null &&\n\t\t\tDocumentStorageServiceCompressionAdapter.hasCompressionMarkup(snapshotTree);\n\t\treturn snapshotTree;\n\t}\n\n\t/**\n\t * This method uploads the summary to the storage. It performs compression of the blobs in the summary tree.\n\t * @param summary - The summary tree to upload.\n\t * @param context - The summary context.\n\t * @returns The ID of the uploaded summary.\n\t */\n\tpublic override async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tconst prep = DocumentStorageServiceCompressionAdapter.compressSummary(\n\t\t\tsummary,\n\t\t\tthis._config,\n\t\t);\n\t\treturn super.uploadSummaryWithContext(prep, context);\n\t}\n\n\t/**\n\t * This method downloads the summary from the storage and then applies decompression on the compressed blobs.\n\t * @param id - The ID of the summary to be downloaded\n\t * @returns The summary with decompressed blobs\n\t */\n\tpublic override async downloadSummary(id: ISummaryHandle): Promise<ISummaryTree> {\n\t\tconst summary = await super.downloadSummary(id);\n\t\treturn !this._isCompressionEnabled\n\t\t\t? summary\n\t\t\t: (DocumentStorageServiceCompressionAdapter.recursivelyReplace(\n\t\t\t\t\tfalse,\n\t\t\t\t\tsummary,\n\t\t\t\t\tDocumentStorageServiceCompressionAdapter.blobEncoder,\n\t\t\t\t\tDocumentStorageServiceCompressionAdapter.blobDecoder,\n\t\t\t\t\tthis._config,\n\t\t\t\t) as ISummaryTree);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"documentStorageServiceSummaryBlobCompressionAdapter.js","sourceRoot":"","sources":["../../../../src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAyD;AACzD,kEAA6D;AAC7D,2EAM4C;AAO5C,iCAA6C;AAE7C,4FAAsF;AACtF,0CAAqF;AAErF;;GAEG;AACU,QAAA,mBAAmB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,MAAa,wCAAyC,SAAQ,4DAA2B;IAGxF,YACC,OAAgC,EACf,OAAkC;QAEnD,KAAK,CAAC,OAAO,CAAC,CAAC;QAFE,YAAO,GAAP,OAAO,CAA2B;QAJ5C,0BAAqB,GAAY,KAAK,CAAC;IAO/C,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,SAAS,CAAC,IAAqB;QAC7C,MAAM,SAAS,GAAG,wBAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,sCAAsC;QACtC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;IACpC,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,qBAAqB,CAAC,IAAqB;QACzD,OAAO,CAAC,I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E;IAC7E,IAAI,KAAK,CAAC,IAAI,KAAK,gCAAW,CAAC,IAAI,EAAE,CAAC;QACrC,MAAM,WAAW,GAAiB,KAAK,CAAC;QACxC,MAAM,QAAQ,GAAe,wCAAwC,CAAC,aAAa,CAClF,WAAW,CAAC,OAAO,CACnB,CAAC;QACF,MAAM,SAAS,GACd,wCAAwC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC/D,MAAM,cAAc,GAAG;YACtB,IAAI,EAAE,gCAAW,CAAC,IAAI;YACtB,OAAO,EAAE,wBAAS,CAAC,IAAI,CAAC,SAAS,CAAC;SAClC,CAAC;QACF,OAAO,cAAc,CAAC;IACvB,CAAC;SAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,AAhBkC,CAgBjC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tISummaryBlob,\n\tISummaryHandle,\n\tISummaryTree,\n\tSummaryObject,\n\tSummaryType,\n} from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentStorageService,\n\tISummaryContext,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { compress, decompress } from \"lz4js\";\n\nimport { DocumentStorageServiceProxy } from \"../../../documentStorageServiceProxy.js\";\nimport { ICompressionStorageConfig, SummaryCompressionAlgorithm } from \"../index.js\";\n\n/**\n * @internal\n */\nexport const blobHeadersBlobName = \".metadata.blobHeaders\";\nconst metadataBlobName = \".metadata\";\n\n/**\n * This class is a proxy for the IDocumentStorageService that compresses and decompresses blobs in the summary.\n * The identification of the compressed blobs is done by adding a compression markup blob to the summary.\n * Even if the markup blob is present, it does not mean that all blobs are compressed. The blob,\n * which is compressed also contain the compression algorithm enumerated value from the\n * SummaryCompressionAlgorithm enumeration in the first byte . If the blob is not\n * commpressed, it contains the first byte equals to SummaryCompressionAlgorithm.None .\n * In case, the markup blob is present, it is expected that the first byte of the markup blob\n * will contain the info about the compression. If the first byte is not present, it is assumed\n * that the compression is not enabled and no first prefix byte is present in the blobs.\n * @public\n */\nexport class DocumentStorageServiceCompressionAdapter extends DocumentStorageServiceProxy {\n\tprivate _isCompressionEnabled: boolean = false;\n\n\tconstructor(\n\t\tservice: IDocumentStorageService,\n\t\tprivate readonly _config: ICompressionStorageConfig,\n\t) {\n\t\tsuper(service);\n\t}\n\n\tpublic get service(): IDocumentStorageService {\n\t\treturn this.internalStorageService;\n\t}\n\n\t/**\n\t * This method returns `true` if there is a compression markup byte in the blob, otherwise `false`.\n\t * @param blob - The blob to compress.\n\t * @returns `true` if there is a compression markup byte in the blob, otherwise `false`.\n\t */\n\tprivate static hasPrefix(blob: ArrayBufferLike): boolean {\n\t\tconst firstByte = IsoBuffer.from(blob)[0];\n\t\t// eslint-disable-next-line no-bitwise\n\t\treturn (firstByte & 0xf0) === 0xb0;\n\t}\n\n\t/**\n\t * This method reads the first byte from the given blob and maps that byte to the compression algorithm.\n\t * @param blob - The maybe compressed blob.\n\t */\n\tprivate static readAlgorithmFromBlob(blob: ArrayBufferLike): number {\n\t\treturn !this.hasPrefix(blob)\n\t\t\t? SummaryCompressionAlgorithm.None\n\t\t\t: // eslint-disable-next-line no-bitwise\n\t\t\t\tIsoBuffer.from(blob)[0] & 0x0f;\n\t}\n\n\t/**\n\t * This method writes the given algorithm to the blob as the first byte.\n\t * @param blob - The blob to write the algorithm to.\n\t * @param algorithm - The algorithm to write.\n\t * @returns The blob with the algorithm as the first byte.\n\t */\n\tprivate static writeAlgorithmToBlob(\n\t\tblob: ArrayBufferLike,\n\t\talgorithm: number,\n\t): ArrayBufferLike {\n\t\tif (algorithm === SummaryCompressionAlgorithm.None) {\n\t\t\tconst firstByte = IsoBuffer.from(blob)[0];\n\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\tif ((firstByte & 0xf0) !== 0xb0) {\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t}\n\t\tassert(algorithm < 0x10, 0x6f5 /* Algorithm should be less than 0x10 */);\n\t\tconst blobView = new Uint8Array(blob);\n\t\tconst blobLength = blobView.length;\n\t\tconst newBlob = new Uint8Array(blobLength + 1);\n\t\t// eslint-disable-next-line no-bitwise\n\t\tconst prefix = 0xb0 | algorithm;\n\t\tnewBlob[0] = prefix;\n\t\tnewBlob.set(blobView, 1);\n\t\treturn IsoBuffer.from(newBlob);\n\t}\n\n\t/**\n\t * This method removes the algorithm markup prefix from the blob (1 byte)\n\t * @param blob - The blob to remove the prefix from.\n\t * @returns The blob without the prefix.\n\t */\n\tprivate static removePrefixFromBlobIfPresent(blob: ArrayBufferLike): ArrayBufferLike {\n\t\tconst blobView = new Uint8Array(blob);\n\t\treturn this.hasPrefix(blob) ? IsoBuffer.from(blobView.subarray(1)) : blob;\n\t}\n\n\t/**\n\t * This method converts the given argument to Uint8Array. If the parameter is already Uint8Array,\n\t * it is just returned as is. If the parameter is string, it is converted to Uint8Array using\n\t * TextEncoder.\n\t * @param input - The input to convert to Uint8Array.\n\t * @returns The Uint8Array representation of the input.\n\t */\n\tprivate static toBinaryArray(input: string | Uint8Array): Uint8Array {\n\t\treturn typeof input === \"string\" ? new TextEncoder().encode(input) : input;\n\t}\n\n\t/**\n\t * This method encodes the blob inside the given summary object of the SummaryType.Blob type using the given config\n\t * containing the compression algorithm.\n\t * @param input - The summary object to encode.\n\t * @param config - The config containing the compression algorithm.\n\t * @returns The summary object with the encoded blob.\n\t */\n\tprivate static readonly blobEncoder = (\n\t\tinput: SummaryObject,\n\t\tconfig: ICompressionStorageConfig,\n\t): SummaryObject => {\n\t\tif (input.type === SummaryType.Blob) {\n\t\t\tconst summaryBlob: ISummaryBlob = input;\n\t\t\tconst original: ArrayBufferLike = DocumentStorageServiceCompressionAdapter.toBinaryArray(\n\t\t\t\tsummaryBlob.content,\n\t\t\t);\n\t\t\tconst processed: ArrayBufferLike = DocumentStorageServiceCompressionAdapter.encodeBlob(\n\t\t\t\toriginal,\n\t\t\t\tconfig,\n\t\t\t);\n\t\t\tconst newSummaryBlob = {\n\t\t\t\ttype: SummaryType.Blob,\n\t\t\t\tcontent: IsoBuffer.from(processed),\n\t\t\t};\n\t\t\treturn newSummaryBlob;\n\t\t} else {\n\t\t\treturn input;\n\t\t}\n\t};\n\n\t/**\n\t * This method decodes the blob inside the given summary object of the SummaryType.Blob type.\n\t * @param input - The summary object to decode.\n\t * @returns The summary object with the decoded blob.\n\t */\n\tprivate static readonly blobDecoder = (input: SummaryObject): SummaryObject => {\n\t\tif (input.type === SummaryType.Blob) {\n\t\t\tconst summaryBlob: ISummaryBlob = input;\n\t\t\tconst original: Uint8Array = DocumentStorageServiceCompressionAdapter.toBinaryArray(\n\t\t\t\tsummaryBlob.content,\n\t\t\t);\n\t\t\tconst processed: ArrayBufferLike =\n\t\t\t\tDocumentStorageServiceCompressionAdapter.decodeBlob(original);\n\t\t\tconst newSummaryBlob = {\n\t\t\t\ttype: SummaryType.Blob,\n\t\t\t\tcontent: IsoBuffer.from(processed),\n\t\t\t};\n\t\t\treturn newSummaryBlob;\n\t\t} else {\n\t\t\treturn input;\n\t\t}\n\t};\n\n\t/**\n\t * This method encodes the given blob according to the given config.\n\t * @param file - The blob to encode.\n\t * @param config - The config to use for encoding.\n\t * @returns The encoded blob.\n\t */\n\tprivate static encodeBlob(\n\t\tfile: ArrayBufferLike,\n\t\tconfig: ICompressionStorageConfig,\n\t): ArrayBufferLike {\n\t\tlet maybeCompressed: ArrayBufferLike;\n\t\tlet algorithm = config.algorithm;\n\t\tif (new Uint8Array(file).length < config.minSizeToCompress) {\n\t\t\tmaybeCompressed = file;\n\t\t\talgorithm = SummaryCompressionAlgorithm.None;\n\t\t} else if (algorithm === SummaryCompressionAlgorithm.None) {\n\t\t\tmaybeCompressed = file;\n\t\t} else if (algorithm === SummaryCompressionAlgorithm.LZ4) {\n\t\t\tconst compressed = compress(file) as ArrayBufferLike;\n\t\t\tmaybeCompressed = compressed;\n\t\t} else {\n\t\t\tthrow new Error(`Unknown Algorithm ${config.algorithm}`);\n\t\t}\n\t\tmaybeCompressed = DocumentStorageServiceCompressionAdapter.writeAlgorithmToBlob(\n\t\t\tmaybeCompressed,\n\t\t\talgorithm,\n\t\t);\n\t\treturn maybeCompressed;\n\t}\n\n\t/**\n\t * This method decodes the given blob.\n\t * @param file - The blob to decode.\n\t * @returns The decoded blob.\n\t */\n\tprivate static decodeBlob(file: ArrayBufferLike): ArrayBufferLike {\n\t\tlet decompressed: ArrayBufferLike;\n\t\tlet originalBlob;\n\t\tlet algorithm;\n\t\tif (this.hasPrefix(file)) {\n\t\t\talgorithm = DocumentStorageServiceCompressionAdapter.readAlgorithmFromBlob(file);\n\t\t\toriginalBlob = this.removePrefixFromBlobIfPresent(file);\n\t\t} else {\n\t\t\talgorithm = SummaryCompressionAlgorithm.None;\n\t\t\toriginalBlob = file;\n\t\t}\n\t\tif (algorithm === SummaryCompressionAlgorithm.None) {\n\t\t\tdecompressed = originalBlob;\n\t\t} else if (algorithm === SummaryCompressionAlgorithm.LZ4) {\n\t\t\tdecompressed = decompress(originalBlob) as ArrayBufferLike;\n\t\t} else {\n\t\t\tthrow new Error(`Unknown Algorithm ${algorithm}`);\n\t\t}\n\t\treturn decompressed;\n\t}\n\n\t/**\n\t * This method traverses the SummaryObject recursively. If it finds the ISummaryBlob object,\n\t * it applies encoding/decoding on it according to the given isEncode flag.\n\t * @param isEncode - True if the encoding should be applied, false if the decoding should be applied.\n\t * @param input - The summary object to traverse.\n\t * @param encoder - The encoder function to use.\n\t * @param decoder - The decoder function to use.\n\t * @param config - The config to use for encoding.\n\t * @param context - The summary context.\n\t * @returns The summary object with the encoded/decoded blob.\n\t */\n\tprivate static recursivelyReplace(\n\t\tisEncode: boolean,\n\t\tinput: SummaryObject,\n\t\tencoder: (input: SummaryObject, config: ICompressionStorageConfig) => SummaryObject,\n\t\tdecoder: (input: SummaryObject) => SummaryObject,\n\t\tconfig: ICompressionStorageConfig,\n\t\tcontext?: ISummaryContext,\n\t): SummaryObject {\n\t\tassert(typeof input === \"object\", 0x6f6 /* input must be a non-null object */);\n\t\tconst maybeReplaced = isEncode ? encoder(input, config) : decoder(input);\n\n\t\tif (maybeReplaced !== input) {\n\t\t\treturn maybeReplaced;\n\t\t}\n\t\tlet clone: object | undefined;\n\t\tfor (const key of Object.keys(input)) {\n\t\t\tconst value = input[key];\n\n\t\t\tif (Boolean(value) && typeof value === \"object\") {\n\t\t\t\tconst replaced = this.recursivelyReplace(\n\t\t\t\t\tisEncode,\n\t\t\t\t\tvalue as SummaryObject,\n\t\t\t\t\tencoder,\n\t\t\t\t\tdecoder,\n\t\t\t\t\tconfig,\n\t\t\t\t\tcontext,\n\t\t\t\t);\n\t\t\t\tif (replaced !== value) {\n\t\t\t\t\tclone = clone ?? (Array.isArray(input) ? [...input] : { ...input });\n\t\t\t\t\tclone[key] = replaced;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (clone ?? input) as SummaryObject;\n\t}\n\n\t/**\n\t * This method traverses the SummaryTree recursively. If it finds the ISummaryBlob object with the key '.metadata',\n\t * it returns the summary tree containing that blob.\n\t *\n\t * @param summary - The summary tree to traverse.\n\t * @returns The summary tree containing the metadata blob.\n\t */\n\tprivate static findMetadataHolderSummary(summary: ISummaryTree): ISummaryTree | undefined {\n\t\tassert(typeof summary === \"object\", 0x6f7 /* summary must be a non-null object */);\n\t\tfor (const key of Object.keys(summary.tree)) {\n\t\t\tconst value = summary.tree[key];\n\n\t\t\tif (Boolean(value) && value.type === SummaryType.Tree) {\n\t\t\t\tconst found = this.findMetadataHolderSummary(value);\n\t\t\t\tif (found) {\n\t\t\t\t\treturn found;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Boolean(value) && key === metadataBlobName && value.type === SummaryType.Blob) {\n\t\t\t\treturn summary;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * This method obtains the summary tree containing the metadata blob. It returns the content\n\t * of the tree atribute.\n\t * @param summary - The summary tree to traverse.\n\t * @returns The content of the tree attribute of the summary tree containing the metadata blob.\n\t */\n\tprivate static getMetadataHolderTree(summary: ISummaryTree) {\n\t\tconst metadataHolder = this.findMetadataHolderSummary(summary);\n\t\tassert(metadataHolder !== undefined, 0x6f8 /* metadataHolder must be a non-null object */);\n\t\tconst metadataHolderTree = metadataHolder.tree;\n\t\treturn metadataHolderTree;\n\t}\n\n\t/**\n\t * This method adds the compression markup blob to the nested summary tree containing the metadata blob.\n\t * @param summary - The top summary tree to put the compression markup blob into.\n\t */\n\tprivate static putCompressionMarkup(summary: ISummaryTree): void {\n\t\tconst metadataHolderTree =\n\t\t\tDocumentStorageServiceCompressionAdapter.getMetadataHolderTree(summary);\n\t\tmetadataHolderTree[blobHeadersBlobName] = {\n\t\t\ttype: 2,\n\t\t\tcontent: \"\",\n\t\t};\n\t}\n\n\t/**\n\t * This method traverses the SnapshotTree recursively. If it finds the ISummaryBlob object with the key '.metadata',\n\t * it checks, if the SummaryTree holder of that object also contains the compression markup blob. If it is found,\n\t * it returns true, otherwise false.\n\t * @param snapshot - The snapshot tree to traverse.\n\t * @returns True if the compression markup blob is found, otherwise false.\n\t */\n\tprivate static hasCompressionMarkup(snapshot: ISnapshotTree): boolean {\n\t\tassert(typeof snapshot === \"object\", 0x6f9 /* snapshot must be a non-null object */);\n\t\tfor (const key of Object.keys(snapshot.blobs)) {\n\t\t\tif (key === metadataBlobName) {\n\t\t\t\tconst value = snapshot.blobs[blobHeadersBlobName];\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const key of Object.keys(snapshot.trees)) {\n\t\t\tconst value = snapshot[key] as ISnapshotTree;\n\t\t\tif (value !== undefined) {\n\t\t\t\tconst found = this.hasCompressionMarkup(value);\n\t\t\t\tif (found) {\n\t\t\t\t\treturn found;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * This method performs compression of the blobs in the summary tree.\n\t * @param summary - The summary tree to compress.\n\t * @param config - The compression config.\n\t * @returns The compressed summary tree.\n\t */\n\tpublic static compressSummary(\n\t\tsummary: ISummaryTree,\n\t\tconfig: ICompressionStorageConfig,\n\t): ISummaryTree {\n\t\tthis.putCompressionMarkup(summary);\n\t\tconst prep = DocumentStorageServiceCompressionAdapter.recursivelyReplace(\n\t\t\ttrue,\n\t\t\tsummary,\n\t\t\tDocumentStorageServiceCompressionAdapter.blobEncoder,\n\t\t\tDocumentStorageServiceCompressionAdapter.blobDecoder,\n\t\t\tconfig,\n\t\t) as ISummaryTree;\n\t\t//\tconsole.log(`Miso summary-blob Summary Upload: ${JSON.stringify(prep).length}`);\n\t\treturn prep;\n\t}\n\n\t/**\n\t * This method read blob from the storage and decompresses it if it is compressed.\n\t * @param id - The id of the blob to read.\n\t * @returns The decompressed blob.\n\t */\n\tpublic override async readBlob(id: string): Promise<ArrayBufferLike> {\n\t\tconst originalBlob = await super.readBlob(id);\n\t\tif (!this._isCompressionEnabled) {\n\t\t\treturn originalBlob;\n\t\t} else {\n\t\t\tconst decompressedBlob =\n\t\t\t\tDocumentStorageServiceCompressionAdapter.decodeBlob(originalBlob);\n\t\t\t//\t\t\tconsole.log(`Miso summary-blob Blob read END : ${id} ${decompressedBlob.byteLength}`);\n\t\t\treturn decompressedBlob;\n\t\t}\n\t}\n\n\t/**\n\t * This method loads the snapshot tree from the server. It also checks, if the compression markup blob is present\n\t * and setups the compression flag accordingly. It also identifies the blobs that are not compressed and do not contain\n\t * algorithm byte prefix and store them.\n\t * @param version - The version of the snapshot tree to load.\n\t * @param scenarioName - The scenario name of the snapshot tree to load.\n\t * @returns The snapshot tree.\n\t */\n\tpublic override async getSnapshotTree(\n\t\tversion?: IVersion | undefined,\n\t\tscenarioName?: string | undefined,\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t): Promise<ISnapshotTree | null> {\n\t\tconst snapshotTree = await super.getSnapshotTree(version, scenarioName);\n\t\tthis._isCompressionEnabled =\n\t\t\tsnapshotTree !== undefined &&\n\t\t\tsnapshotTree !== null &&\n\t\t\tDocumentStorageServiceCompressionAdapter.hasCompressionMarkup(snapshotTree);\n\t\treturn snapshotTree;\n\t}\n\n\t/**\n\t * This method uploads the summary to the storage. It performs compression of the blobs in the summary tree.\n\t * @param summary - The summary tree to upload.\n\t * @param context - The summary context.\n\t * @returns The ID of the uploaded summary.\n\t */\n\tpublic override async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\tconst prep = DocumentStorageServiceCompressionAdapter.compressSummary(\n\t\t\tsummary,\n\t\t\tthis._config,\n\t\t);\n\t\treturn super.uploadSummaryWithContext(prep, context);\n\t}\n\n\t/**\n\t * This method downloads the summary from the storage and then applies decompression on the compressed blobs.\n\t * @param id - The ID of the summary to be downloaded\n\t * @returns The summary with decompressed blobs\n\t */\n\tpublic override async downloadSummary(id: ISummaryHandle): Promise<ISummaryTree> {\n\t\tconst summary = await super.downloadSummary(id);\n\t\treturn !this._isCompressionEnabled\n\t\t\t? summary\n\t\t\t: (DocumentStorageServiceCompressionAdapter.recursivelyReplace(\n\t\t\t\t\tfalse,\n\t\t\t\t\tsummary,\n\t\t\t\t\tDocumentStorageServiceCompressionAdapter.blobEncoder,\n\t\t\t\t\tDocumentStorageServiceCompressionAdapter.blobDecoder,\n\t\t\t\t\tthis._config,\n\t\t\t\t) as ISummaryTree);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentStorageServiceProxy.d.ts","sourceRoot":"","sources":["../src/documentStorageServiceProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EACN,WAAW,EACX,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,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SAAwB,EACxB,KAAa,EACb,YAAqB,EACrB,WAAyB;QAEzB,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAC7C,SAAS,EACT,KAAK,EACL,YAAY,EACZ,WAAW,CACX,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,wBAAwB,CACpC,OAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAAsB;QAClD,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,OAAO,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,MAAc;QACnC,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;CACD;AA7DD,kEA6DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISummaryHandle, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tFetchSource,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISummaryContext,\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * @internal\n */\nexport class DocumentStorageServiceProxy implements IDocumentStorageService {\n\tprivate _policies: IDocumentStorageServicePolicies | undefined;\n\n\tpublic set policies(policies: IDocumentStorageServicePolicies | undefined) {\n\t\tthis._policies = policies;\n\t}\n\n\tpublic get policies() {\n\t\treturn this._policies ?? this.internalStorageService.policies;\n\t}\n\n\tconstructor(protected readonly internalStorageService: IDocumentStorageService) {}\n\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this.internalStorageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tif (this.internalStorageService.getSnapshot !== undefined) {\n\t\t\treturn this.internalStorageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\t\tthrow new UsageError(\n\t\t\t\"getSnapshot api should exist on internal storage in documentStorageServiceProxy class\",\n\t\t);\n\t}\n\n\tpublic async getVersions(\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this.internalStorageService.getVersions(\n\t\t\tversionId,\n\t\t\tcount,\n\t\t\tscenarioName,\n\t\t\tfetchSource,\n\t\t);\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this.internalStorageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this.internalStorageService.downloadSummary(handle);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.internalStorageService.createBlob(file);\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.internalStorageService.readBlob(blobId);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"documentStorageServiceProxy.js","sourceRoot":"","sources":["../src/documentStorageServiceProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,uEAAsE;AAEtE;;GAEG;AACH,MAAa,2BAA2B;IAGvC,IAAW,QAAQ,CAAC,QAAqD;QACxE,IAAI,CAAC,SAAS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AAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;CACD;AA7DD,kEA6DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISummaryHandle, ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tFetchSource,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tISummaryContext,\n\tICreateBlobResponse,\n\tISnapshotTree,\n\tIVersion,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * @internal\n */\nexport class DocumentStorageServiceProxy implements IDocumentStorageService {\n\tprivate _policies: IDocumentStorageServicePolicies | undefined;\n\n\tpublic set policies(policies: IDocumentStorageServicePolicies | undefined) {\n\t\tthis._policies = policies;\n\t}\n\n\tpublic get policies(): IDocumentStorageServicePolicies | undefined {\n\t\treturn this._policies ?? this.internalStorageService.policies;\n\t}\n\n\tconstructor(protected readonly internalStorageService: IDocumentStorageService) {}\n\n\tpublic async getSnapshotTree(\n\t\tversion?: IVersion,\n\t\tscenarioName?: string,\n\t): Promise<ISnapshotTree | null> {\n\t\treturn this.internalStorageService.getSnapshotTree(version, scenarioName);\n\t}\n\n\tpublic async getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot> {\n\t\tif (this.internalStorageService.getSnapshot !== undefined) {\n\t\t\treturn this.internalStorageService.getSnapshot(snapshotFetchOptions);\n\t\t}\n\t\tthrow new UsageError(\n\t\t\t\"getSnapshot api should exist on internal storage in documentStorageServiceProxy class\",\n\t\t);\n\t}\n\n\tpublic async getVersions(\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]> {\n\t\treturn this.internalStorageService.getVersions(\n\t\t\tversionId,\n\t\t\tcount,\n\t\t\tscenarioName,\n\t\t\tfetchSource,\n\t\t);\n\t}\n\n\tpublic async uploadSummaryWithContext(\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> {\n\t\treturn this.internalStorageService.uploadSummaryWithContext(summary, context);\n\t}\n\n\tpublic async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n\t\treturn this.internalStorageService.downloadSummary(handle);\n\t}\n\n\tpublic async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n\t\treturn this.internalStorageService.createBlob(file);\n\t}\n\n\tpublic async readBlob(blobId: string): Promise<ArrayBufferLike> {\n\t\treturn this.internalStorageService.readBlob(blobId);\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from "./blob.js";
|
|
|
7
7
|
export { DocumentStorageServiceProxy } from "./documentStorageServiceProxy.js";
|
|
8
8
|
export { UsageError } from "./error.js";
|
|
9
9
|
export { InsecureUrlResolver } from "./insecureUrlResolver.js";
|
|
10
|
-
export { canBeCoalescedByService, isRuntimeMessage,
|
|
10
|
+
export { canBeCoalescedByService, isRuntimeMessage, } from "./messageRecognition.js";
|
|
11
11
|
export { AuthorizationError, canRetryOnError, createGenericNetworkError, createWriteError, DeltaStreamConnectionForbiddenError, DriverErrorTelemetryProps, FluidInvalidSchemaError, GenericNetworkError, getRetryDelayFromError, getRetryDelaySecondsFromError, isOnline, LocationRedirectionError, NetworkErrorBasic, NonRetryableError, OnlineStatus, RetryableError, ThrottlingError, } from "./network.js";
|
|
12
12
|
export { logNetworkFailure } from "./networkUtils.js";
|
|
13
13
|
export { emptyMessageStream, ParallelRequests, Queue, requestOps, streamFromMessages, streamObserver, } from "./parallelRequests.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":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AO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EACN,6BAA6B,EAC7B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACN,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getGitType = exports.getGitMode = exports.buildGitTreeHierarchy = exports.isInstanceOfISnapshot = exports.getSnapshotTree = exports.blobHeadersBlobName = exports.SummaryCompressionAlgorithm = exports.applyStorageCompression = exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.runWithRetry = exports.calculateMaxWaitTime = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.
|
|
7
|
+
exports.getGitType = exports.getGitMode = exports.buildGitTreeHierarchy = exports.isInstanceOfISnapshot = exports.getSnapshotTree = exports.blobHeadersBlobName = exports.SummaryCompressionAlgorithm = exports.applyStorageCompression = exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.runWithRetry = exports.calculateMaxWaitTime = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.UsageError = exports.DocumentStorageServiceProxy = exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = exports.buildSnapshotTree = void 0;
|
|
8
8
|
var buildSnapshotTree_js_1 = require("./buildSnapshotTree.js");
|
|
9
9
|
Object.defineProperty(exports, "buildSnapshotTree", { enumerable: true, get: function () { return buildSnapshotTree_js_1.buildSnapshotTree; } });
|
|
10
10
|
var blob_js_1 = require("./blob.js");
|
|
@@ -20,7 +20,6 @@ Object.defineProperty(exports, "InsecureUrlResolver", { enumerable: true, get: f
|
|
|
20
20
|
var messageRecognition_js_1 = require("./messageRecognition.js");
|
|
21
21
|
Object.defineProperty(exports, "canBeCoalescedByService", { enumerable: true, get: function () { return messageRecognition_js_1.canBeCoalescedByService; } });
|
|
22
22
|
Object.defineProperty(exports, "isRuntimeMessage", { enumerable: true, get: function () { return messageRecognition_js_1.isRuntimeMessage; } });
|
|
23
|
-
Object.defineProperty(exports, "MessageType2", { enumerable: true, get: function () { return messageRecognition_js_1.MessageType2; } });
|
|
24
23
|
var network_js_1 = require("./network.js");
|
|
25
24
|
Object.defineProperty(exports, "AuthorizationError", { enumerable: true, get: function () { return network_js_1.AuthorizationError; } });
|
|
26
25
|
Object.defineProperty(exports, "canRetryOnError", { enumerable: true, get: function () { return network_js_1.canRetryOnError; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAC1B,qCAA8E;AAArE,wGAAA,aAAa,OAAA;AAAE,wGAAA,aAAa,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAC1D,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,uCAAwC;AAA/B,sGAAA,UAAU,OAAA;AACnB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAC1B,qCAA8E;AAArE,wGAAA,aAAa,OAAA;AAAE,wGAAA,aAAa,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AAC1D,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,uCAAwC;AAA/B,sGAAA,UAAU,OAAA;AACnB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,iEAGiC;AAFhC,gIAAA,uBAAuB,OAAA;AACvB,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AAqB,OAAA;AAAE,sGAAA,UAAU,OAAA;AAAE,sGAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree.js\";\nexport { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from \"./blob.js\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy.js\";\nexport { UsageError } from \"./error.js\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver.js\";\nexport {\n\tcanBeCoalescedByService,\n\tisRuntimeMessage,\n} from \"./messageRecognition.js\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network.js\";\nexport { logNetworkFailure } from \"./networkUtils.js\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests.js\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService.js\";\nexport { RateLimiter } from \"./rateLimiter.js\";\nexport { readAndParse } from \"./readAndParse.js\";\nexport { calculateMaxWaitTime, IProgress, runWithRetry } from \"./runWithRetry.js\";\nexport {\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew.js\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions.js\";\nexport {\n\tapplyStorageCompression,\n\tICompressionStorageConfig,\n\tSummaryCompressionAlgorithm,\n\tblobHeadersBlobName,\n} from \"./adapters/index.js\";\nexport { getSnapshotTree, isInstanceOfISnapshot } from \"./storageUtils.js\";\nexport { buildGitTreeHierarchy, getGitMode, getGitType } from \"./protocol/index.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insecureUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAEN,YAAY,EACZ,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAGrD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IAItD,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAT/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4C;gBAGhD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,GAAE,OAAe;IAGnC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"insecureUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAEN,YAAY,EACZ,YAAY,EACZ,MAAM,6CAA6C,CAAC;AAGrD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IAItD,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAT/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4C;gBAGhD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,GAAE,OAAe;IAGnC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IA+C1E,OAAO,CAAC,aAAa;IAmDR,cAAc,CAC1B,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;IAgBX,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ;CAU1D"}
|
|
@@ -51,14 +51,10 @@ class InsecureUrlResolver {
|
|
|
51
51
|
if (this.isForNodeTest) {
|
|
52
52
|
const [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split("/");
|
|
53
53
|
const relativePath = tmpRelativePath ?? "";
|
|
54
|
-
// TODO why are we non null asserting here?
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
56
54
|
return this.resolveHelper(documentId, relativePath, parsedUrl.search);
|
|
57
55
|
}
|
|
58
56
|
else if (parsedUrl.host === window.location.host) {
|
|
59
57
|
const fullPath = parsedUrl.pathname.substr(1);
|
|
60
|
-
// TODO why are we non null asserting here?
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
62
58
|
const documentId = fullPath.split("/")[0];
|
|
63
59
|
const documentRelativePath = fullPath.slice(documentId.length);
|
|
64
60
|
return this.resolveHelper(documentId, documentRelativePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insecureUrlResolver.js","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAGH,kEAA6D;AAC7D,0EAIqD;AACrD,kDAA0B;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAa,mBAAmB;IAG/B,YACkB,OAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,cAAsB,EACtB,QAAgB,EAChB,MAAc,EACd,gBAAyB,KAAK;QAN9B,YAAO,GAAP,OAAO,CAAQ;QACf,eAAU,GAAV,UAAU,CAAQ;QAClB,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QACtB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,kBAAa,GAAb,aAAa,CAAiB;QAT/B,UAAK,GAAG,IAAI,GAAG,EAAiC,CAAC;IAU/D,CAAC;IAEG,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,yEAAyE;QACzE,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,uBAAY,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/C,MAAM,CAAC,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC/C,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;YACtD,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,GA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AAC;IACZ,CAAC;IAEM,sBAAsB,CAAC,QAAiB;QAC9C,MAAM,gBAAgB,GAAa;YAClC,yEAAyE;YACzE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;YACrE,OAAO,EAAE;gBACR,CAAC,uBAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD;AAhJD,kDAgJC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * https://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n * @internal\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly deltaStreamUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\t// TODO why are we non null asserting here?\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this.resolveHelper(documentId!, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\t// TODO why are we non null asserting here?\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst documentId = fullPath.split(\"/\")[0]!;\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/apis/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tdeltaStreamUrl: this.deltaStreamUrl,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `https://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `https://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tdeltaStreamUrl: this.deltaStreamUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(\n\t\tresolvedUrl: IResolvedUrl,\n\t\trelativeUrl: string,\n\t): Promise<string> {\n\t\tconst parsedUrl = new URL(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"insecureUrlResolver.js","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAGH,kEAA6D;AAC7D,0EAIqD;AACrD,kDAA0B;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAa,mBAAmB;IAG/B,YACkB,OAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,cAAsB,EACtB,QAAgB,EAChB,MAAc,EACd,gBAAyB,KAAK;QAN9B,YAAO,GAAP,OAAO,CAAQ;QACf,eAAU,GAAV,UAAU,CAAQ;QAClB,eAAU,GAAV,UAAU,CAAQ;QAClB,mBAAc,GAAd,cAAc,CAAQ;QAC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AAW,CAAC,GAAG,CAAC,CAAC;QAC3C,MAAM,CAAC,EAAE,AAAD,EAAG,UAAU,CAAC,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9D,yEAAyE;QACzE,IAAA,iBAAM,EAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAExE,IAAI,GAAG,GAAG,WAAW,CAAC;QACtB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;QAED,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAChF,UAAU,CACV,IAAI,GAAG,EAAE,CAAC;IACZ,CAAC;IAEM,sBAAsB,CAAC,QAAiB;QAC9C,MAAM,gBAAgB,GAAa;YAClC,yEAAyE;YACzE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;YACrE,OAAO,EAAE;gBACR,CAAC,uBAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD;AA5ID,kDA4IC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * https://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n * @internal\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly deltaStreamUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\treturn this.resolveHelper(documentId, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\tconst documentId = fullPath.split(\"/\")[0];\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/apis/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tdeltaStreamUrl: this.deltaStreamUrl,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `https://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `https://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tdeltaStreamUrl: this.deltaStreamUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(\n\t\tresolvedUrl: IResolvedUrl,\n\t\trelativeUrl: string,\n\t): Promise<string> {\n\t\tconst parsedUrl = new URL(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
|
|
@@ -12,14 +12,6 @@ import { ISequencedDocumentMessage, IDocumentMessage } from "@fluidframework/dri
|
|
|
12
12
|
export declare function isRuntimeMessage(message: {
|
|
13
13
|
type: string;
|
|
14
14
|
}): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @privateRemarks ADO #1385: staging code changes across layers.
|
|
17
|
-
* Eventually to be replaced by MessageType.accept
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export declare enum MessageType2 {
|
|
21
|
-
Accept = "accept"
|
|
22
|
-
}
|
|
23
15
|
/**
|
|
24
16
|
* @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
|
|
25
17
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageRecognition.d.ts","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,gBAAgB,EAEhB,MAAM,6CAA6C,CAAC;AAErD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEnE;AAED
|
|
1
|
+
{"version":3,"file":"messageRecognition.d.ts","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,gBAAgB,EAEhB,MAAM,6CAA6C,CAAC;AAErD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEnE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,yBAAyB,GAAG,gBAAgB,GACnD,OAAO,CAIT"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.canBeCoalescedByService = exports.
|
|
7
|
+
exports.canBeCoalescedByService = exports.isRuntimeMessage = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/driver-definitions/internal");
|
|
9
9
|
/**
|
|
10
10
|
* Tells if message was sent by container runtime
|
|
@@ -16,15 +16,6 @@ function isRuntimeMessage(message) {
|
|
|
16
16
|
return message.type === internal_1.MessageType.Operation;
|
|
17
17
|
}
|
|
18
18
|
exports.isRuntimeMessage = isRuntimeMessage;
|
|
19
|
-
/**
|
|
20
|
-
* @privateRemarks ADO #1385: staging code changes across layers.
|
|
21
|
-
* Eventually to be replaced by MessageType.accept
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
var MessageType2;
|
|
25
|
-
(function (MessageType2) {
|
|
26
|
-
MessageType2["Accept"] = "accept";
|
|
27
|
-
})(MessageType2 || (exports.MessageType2 = MessageType2 = {}));
|
|
28
19
|
/**
|
|
29
20
|
* @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
|
|
30
21
|
* @internal
|
|
@@ -32,7 +23,7 @@ var MessageType2;
|
|
|
32
23
|
function canBeCoalescedByService(message) {
|
|
33
24
|
// This assumes that in the future relay service may implement coalescing of accept messages,
|
|
34
25
|
// same way it was doing coalescing of immediate noops in the past.
|
|
35
|
-
return message.type === internal_1.MessageType.NoOp || message.type ===
|
|
26
|
+
return message.type === internal_1.MessageType.NoOp || message.type === internal_1.MessageType.Accept;
|
|
36
27
|
}
|
|
37
28
|
exports.canBeCoalescedByService = canBeCoalescedByService;
|
|
38
29
|
//# sourceMappingURL=messageRecognition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAIqD;AAErD;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,sBAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAFD,4CAEC;AAED
|
|
1
|
+
{"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0EAIqD;AAErD;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,sBAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAFD,4CAEC;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,sBAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,sBAAW,CAAC,MAAM,CAAC;AACjF,CAAC;AAND,0DAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tISequencedDocumentMessage,\n\tIDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * Tells if message was sent by container runtime\n * @privateRemarks ADO #1385: To be moved to container-definitions\n * @returns whether the message is a runtime message\n * @internal\n */\nexport function isRuntimeMessage(message: { type: string }): boolean {\n\treturn message.type === MessageType.Operation;\n}\n\n/**\n * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\n * @internal\n */\nexport function canBeCoalescedByService(\n\tmessage: ISequencedDocumentMessage | IDocumentMessage,\n): boolean {\n\t// This assumes that in the future relay service may implement coalescing of accept messages,\n\t// same way it was doing coalescing of immediate noops in the past.\n\treturn message.type === MessageType.NoOp || message.type === MessageType.Accept;\n}\n"]}
|
package/dist/network.d.ts
CHANGED
|
@@ -62,9 +62,9 @@ export declare class DeltaStreamConnectionForbiddenError extends LoggingError im
|
|
|
62
62
|
* @internal
|
|
63
63
|
*/
|
|
64
64
|
export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
|
|
65
|
-
readonly claims: string | undefined;
|
|
66
|
-
readonly tenantId: string | undefined;
|
|
67
65
|
readonly errorType: "authorizationError";
|
|
66
|
+
readonly claims?: string;
|
|
67
|
+
readonly tenantId?: string;
|
|
68
68
|
readonly canRetry = false;
|
|
69
69
|
constructor(message: string, claims: string | undefined, tenantId: string | undefined, props: DriverErrorTelemetryProps);
|
|
70
70
|
}
|
package/dist/network.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,kBAAkB,EAElB,gBAAgB,EAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAEzF;;GAEG;AACH,oBAAY,YAAY;IACvB,OAAO,IAAA;IACP,MAAM,IAAA;IACN,OAAO,IAAA;CACP;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,IAAI,YAAY,CASvC;AAED;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,GAAG;IAClE,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,qBAAa,mBACZ,SAAQ,YACR,YAAW,gBAAgB,EAAE,eAAe;IAS3C,QAAQ,CAAC,QAAQ,EAAE,OAAO;IAP3B;;OAEG;IACH,QAAQ,CAAC,SAAS,wBAAwC;gBAGzD,OAAO,EAAE,MAAM,EACN,QAAQ,EAAE,OAAO,EAC1B,KAAK,EAAE,yBAAyB;CAIjC;AAED;;;GAGG;AACH,qBAAa,uBACZ,SAAQ,YACR,YAAW,gBAAgB,EAAE,eAAe;IAE5C,QAAQ,CAAC,SAAS,uBAAuC;IACzD,QAAQ,CAAC,QAAQ,SAAS;gBAEd,OAAO,EAAE,MAAM,EAAE,KAAK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Ae,UAAW,GAAG,KAAG,OAAmC,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,UAAW,GAAG,KAAG,MAAM,GAAG,SACrB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,UAAW,GAAG,KAAG,MAAM,GAAG,SACuB,CAAC"}
|
package/dist/network.js
CHANGED
|
@@ -76,10 +76,14 @@ DeltaStreamConnectionForbiddenError.errorType = internal_1.DriverErrorTypes.delt
|
|
|
76
76
|
*/
|
|
77
77
|
class AuthorizationError extends internal_2.LoggingError {
|
|
78
78
|
constructor(message, claims, tenantId, props) {
|
|
79
|
+
if (claims !== undefined) {
|
|
80
|
+
props.claims = claims;
|
|
81
|
+
}
|
|
82
|
+
if (tenantId !== undefined) {
|
|
83
|
+
props.tenantId = tenantId;
|
|
84
|
+
}
|
|
79
85
|
// don't log claims or tenantId
|
|
80
86
|
super(message, props, new Set(["claims", "tenantId"]));
|
|
81
|
-
this.claims = claims;
|
|
82
|
-
this.tenantId = tenantId;
|
|
83
87
|
this.errorType = internal_1.DriverErrorTypes.authorizationError;
|
|
84
88
|
this.canRetry = false;
|
|
85
89
|
}
|
package/dist/network.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAOqD;AACrD,uEAAyF;AAEzF;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACR,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED;;;;;GAKG;AACH,SAAgB,QAAQ;IACvB,IACC,OAAO,SAAS,KAAK,QAAQ;QAC7B,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,EACpC,CAAC;QACF,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAA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BAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AADxE,QAAA,sBAAsB,0BACkD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tIAuthorizationError,\n\tILocationRedirectionError,\n\tIResolvedUrl,\n\tIThrottlingWarning,\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * @internal\n */\nexport enum OnlineStatus {\n\tOffline,\n\tOnline,\n\tUnknown,\n}\n\n/**\n * It tells if we have local connection only - we might not have connection to web.\n * No solution for node.js (other than resolve dns names / ping specific sites)\n * Can also use window.addEventListener(\"online\" / \"offline\")\n * @internal\n */\nexport function isOnline(): OnlineStatus {\n\tif (\n\t\ttypeof navigator === \"object\" &&\n\t\tnavigator !== null &&\n\t\ttypeof navigator.onLine === \"boolean\"\n\t) {\n\t\treturn navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n\t}\n\treturn OnlineStatus.Unknown;\n}\n\n/**\n * Telemetry props with driver-specific required properties\n * @internal\n */\nexport type DriverErrorTelemetryProps = ITelemetryBaseProperties & {\n\tdriverVersion: string | undefined;\n};\n\n/**\n * Generic network error class.\n * @internal\n */\nexport class GenericNetworkError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\t/**\n\t * {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}\n\t */\n\treadonly errorType = DriverErrorTypes.genericNetworkError;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * FluidInvalidSchema error class.\n * @internal\n */\nexport class FluidInvalidSchemaError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.fluidInvalidSchema;\n\treadonly canRetry = false;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class DeltaStreamConnectionForbiddenError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\tstatic readonly errorType = DriverErrorTypes.deltaStreamConnectionForbidden;\n\treadonly errorType = DeltaStreamConnectionForbiddenError.errorType;\n\treadonly canRetry = false;\n\treadonly storageOnlyReason: string | undefined;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string) {\n\t\tsuper(message, { ...props, statusCode: 400 });\n\t\tthis.storageOnlyReason = storageOnlyReason;\n\t}\n}\n\n/**\n * @internal\n */\nexport class AuthorizationError\n\textends LoggingError\n\timplements IAuthorizationError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.authorizationError;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly claims: string | undefined,\n\t\treadonly tenantId: string | undefined,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// don't log claims or tenantId\n\t\tsuper(message, props, new Set([\"claims\", \"tenantId\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class LocationRedirectionError\n\textends LoggingError\n\timplements ILocationRedirectionError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.locationRedirection;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly redirectUrl: IResolvedUrl,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// do not log redirectURL\n\t\tsuper(message, props, new Set([\"redirectUrl\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class NetworkErrorBasic<T extends string>\n\textends LoggingError\n\timplements IFluidErrorBase\n{\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, false, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, true, props);\n\t}\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n * @internal\n */\nexport class ThrottlingError\n\textends LoggingError\n\timplements IThrottlingWarning, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.throttlingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly retryAfterSeconds: number,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n\tnew NonRetryableError(message, DriverErrorTypes.writeError, props);\n\n/**\n * @internal\n */\nexport function createGenericNetworkError(\n\tmessage: string,\n\tretryInfo: { canRetry: boolean; retryAfterMs?: number },\n\tprops: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n\tif (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n\t\treturn new ThrottlingError(message, retryInfo.retryAfterMs / 1000, props);\n\t}\n\treturn new GenericNetworkError(message, retryInfo.canRetry, props);\n}\n\n/**\n * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.\n * I.e. asserts or unexpected exceptions in our code result in container failure.\n * @param error - The error to inspect for ability to retry\n * @internal\n */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/**\n * Check retryAfterSeconds property on error\n * @internal\n */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds as number | undefined;\n\n/**\n * Check retryAfterSeconds property on error and convert to ms\n * @internal\n */\nexport const getRetryDelayFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;\n"]}
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAOqD;AACrD,uEAAyF;AAEzF;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,qDAAO,CAAA;AACR,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED;;;;;GAKG;AACH,SAAgB,QAAQ;IACvB,IACC,OAAO,SAAS,KAAK,QAAQ;QAC7B,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,EACpC,CAAC;QACF,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC;IACtE,CAAC;IACD,OAAO,YAAY,CAAC,OAAO,CAAC;AAC7B,CAAC;AATD,4BASC;AAUD;;;GAGG;AACH,MAAa,mBACZ,SAAQ,uBAAY;IAQpB,YACC,OAAe,EACN,QAAiB,EAC1B,KAAgC;QAEhC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAHb,aAAQ,GAAR,QAAQ,CAAS;QAP3B;;WAEG;QACM,cAAS,GAAG,2BAAgB,CAAC,mBAAmB,CAAC;IAQ1D,CAAC;CACD;AAhBD,kDAgBC;AAED;;;GAGG;AACH,MAAa,uBACZ,SAAQ,uBAAY;IAMpB,YAAY,OAAe,EAAE,KAAgC;QAC5D,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAJd,cAAS,GAAG,2BAAgB,CAAC,kBAAkB,CA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CAAC,CAAC;AADvD,QAAA,gBAAgB,oBACuC;AAEpE;;GAEG;AACH,SAAgB,yBAAyB,CACxC,OAAe,EACf,SAAuD,EACvD,KAAgC;IAEhC,IAAI,SAAS,CAAC,YAAY,KAAK,SAAS,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;QAChE,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpE,CAAC;AATD,8DASC;AAED;;;;;GAKG;AACI,MAAM,eAAe,GAAG,CAAC,KAAU,EAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;AAApE,QAAA,eAAe,mBAAqD;AAEjF;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,KAAU,EAAsB,EAAE,CAC/E,KAAK,EAAE,iBAAuC,CAAC;AADnC,QAAA,6BAA6B,iCACM;AAEhD;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAU,EAAsB,EAAE,CACxE,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AADxE,QAAA,sBAAsB,0BACkD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseProperties } from \"@fluidframework/core-interfaces\";\nimport {\n\tIAuthorizationError,\n\tILocationRedirectionError,\n\tIResolvedUrl,\n\tIThrottlingWarning,\n\tDriverErrorTypes,\n\tIDriverErrorBase,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * @internal\n */\nexport enum OnlineStatus {\n\tOffline,\n\tOnline,\n\tUnknown,\n}\n\n/**\n * It tells if we have local connection only - we might not have connection to web.\n * No solution for node.js (other than resolve dns names / ping specific sites)\n * Can also use window.addEventListener(\"online\" / \"offline\")\n * @internal\n */\nexport function isOnline(): OnlineStatus {\n\tif (\n\t\ttypeof navigator === \"object\" &&\n\t\tnavigator !== null &&\n\t\ttypeof navigator.onLine === \"boolean\"\n\t) {\n\t\treturn navigator.onLine ? OnlineStatus.Online : OnlineStatus.Offline;\n\t}\n\treturn OnlineStatus.Unknown;\n}\n\n/**\n * Telemetry props with driver-specific required properties\n * @internal\n */\nexport type DriverErrorTelemetryProps = ITelemetryBaseProperties & {\n\tdriverVersion: string | undefined;\n};\n\n/**\n * Generic network error class.\n * @internal\n */\nexport class GenericNetworkError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\t/**\n\t * {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}\n\t */\n\treadonly errorType = DriverErrorTypes.genericNetworkError;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * FluidInvalidSchema error class.\n * @internal\n */\nexport class FluidInvalidSchemaError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.fluidInvalidSchema;\n\treadonly canRetry = false;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class DeltaStreamConnectionForbiddenError\n\textends LoggingError\n\timplements IDriverErrorBase, IFluidErrorBase\n{\n\tstatic readonly errorType = DriverErrorTypes.deltaStreamConnectionForbidden;\n\treadonly errorType = DeltaStreamConnectionForbiddenError.errorType;\n\treadonly canRetry = false;\n\treadonly storageOnlyReason: string | undefined;\n\n\tconstructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string) {\n\t\tsuper(message, { ...props, statusCode: 400 });\n\t\tthis.storageOnlyReason = storageOnlyReason;\n\t}\n}\n\n/**\n * @internal\n */\nexport class AuthorizationError\n\textends LoggingError\n\timplements IAuthorizationError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.authorizationError;\n\treadonly claims?: string;\n\treadonly tenantId?: string;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\tclaims: string | undefined,\n\t\ttenantId: string | undefined,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tif (claims !== undefined) {\n\t\t\tprops.claims = claims;\n\t\t}\n\t\tif (tenantId !== undefined) {\n\t\t\tprops.tenantId = tenantId;\n\t\t}\n\t\t// don't log claims or tenantId\n\t\tsuper(message, props, new Set([\"claims\", \"tenantId\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class LocationRedirectionError\n\textends LoggingError\n\timplements ILocationRedirectionError, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.locationRedirection;\n\treadonly canRetry = false;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly redirectUrl: IResolvedUrl,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\t// do not log redirectURL\n\t\tsuper(message, props, new Set([\"redirectUrl\"]));\n\t}\n}\n\n/**\n * @internal\n */\nexport class NetworkErrorBasic<T extends string>\n\textends LoggingError\n\timplements IFluidErrorBase\n{\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\treadonly canRetry: boolean,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, false, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport class RetryableError<T extends string> extends NetworkErrorBasic<T> {\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly errorType: T,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, errorType, true, props);\n\t}\n}\n\n/**\n * Throttling error class - used to communicate all throttling errors\n * @internal\n */\nexport class ThrottlingError\n\textends LoggingError\n\timplements IThrottlingWarning, IFluidErrorBase\n{\n\treadonly errorType = DriverErrorTypes.throttlingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\tmessage: string,\n\t\treadonly retryAfterSeconds: number,\n\t\tprops: DriverErrorTelemetryProps,\n\t) {\n\t\tsuper(message, props);\n\t}\n}\n\n/**\n * @internal\n */\nexport const createWriteError = (message: string, props: DriverErrorTelemetryProps) =>\n\tnew NonRetryableError(message, DriverErrorTypes.writeError, props);\n\n/**\n * @internal\n */\nexport function createGenericNetworkError(\n\tmessage: string,\n\tretryInfo: { canRetry: boolean; retryAfterMs?: number },\n\tprops: DriverErrorTelemetryProps,\n): ThrottlingError | GenericNetworkError {\n\tif (retryInfo.retryAfterMs !== undefined && retryInfo.canRetry) {\n\t\treturn new ThrottlingError(message, retryInfo.retryAfterMs / 1000, props);\n\t}\n\treturn new GenericNetworkError(message, retryInfo.canRetry, props);\n}\n\n/**\n * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.\n * I.e. asserts or unexpected exceptions in our code result in container failure.\n * @param error - The error to inspect for ability to retry\n * @internal\n */\nexport const canRetryOnError = (error: any): boolean => error?.canRetry === true;\n\n/**\n * Check retryAfterSeconds property on error\n * @internal\n */\nexport const getRetryDelaySecondsFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds as number | undefined;\n\n/**\n * Check retryAfterSeconds property on error and convert to ms\n * @internal\n */\nexport const getRetryDelayFromError = (error: any): number | undefined =>\n\terror?.retryAfterSeconds !== undefined ? error.retryAfterSeconds * 1000 : undefined;\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/driver-utils";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.3.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/driver-utils";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.3.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.3.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|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