@fluidframework/driver-utils 2.0.0-dev.3.1.0.125672 → 2.0.0-dev.4.1.0.148229
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/dist/fluidResolvedUrl.d.ts +8 -0
- package/dist/fluidResolvedUrl.d.ts.map +1 -1
- package/dist/fluidResolvedUrl.js +8 -0
- package/dist/fluidResolvedUrl.js.map +1 -1
- package/dist/index.d.ts +4 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -21
- package/dist/index.js.map +1 -1
- package/dist/messageRecognition.d.ts +0 -20
- package/dist/messageRecognition.d.ts.map +1 -1
- package/dist/messageRecognition.js +1 -37
- package/dist/messageRecognition.js.map +1 -1
- package/dist/network.d.ts +0 -15
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js.map +1 -1
- package/dist/networkUtils.d.ts +0 -10
- package/dist/networkUtils.d.ts.map +1 -1
- package/dist/networkUtils.js +1 -32
- package/dist/networkUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/parallelRequests.d.ts.map +1 -1
- package/dist/parallelRequests.js +33 -14
- package/dist/parallelRequests.js.map +1 -1
- package/dist/summaryForCreateNew.d.ts +21 -1
- package/dist/summaryForCreateNew.d.ts.map +1 -1
- package/dist/summaryForCreateNew.js +26 -1
- package/dist/summaryForCreateNew.js.map +1 -1
- package/dist/treeConversions.d.ts.map +1 -1
- package/dist/treeConversions.js +8 -9
- package/dist/treeConversions.js.map +1 -1
- package/lib/fluidResolvedUrl.d.ts +8 -0
- package/lib/fluidResolvedUrl.d.ts.map +1 -1
- package/lib/fluidResolvedUrl.js +8 -0
- package/lib/fluidResolvedUrl.js.map +1 -1
- package/lib/index.d.ts +4 -11
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -10
- package/lib/index.js.map +1 -1
- package/lib/messageRecognition.d.ts +0 -20
- package/lib/messageRecognition.d.ts.map +1 -1
- package/lib/messageRecognition.js +0 -35
- package/lib/messageRecognition.js.map +1 -1
- package/lib/network.d.ts +0 -15
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js.map +1 -1
- package/lib/networkUtils.d.ts +0 -10
- package/lib/networkUtils.d.ts.map +1 -1
- package/lib/networkUtils.js +0 -30
- package/lib/networkUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/parallelRequests.d.ts.map +1 -1
- package/lib/parallelRequests.js +34 -15
- package/lib/parallelRequests.js.map +1 -1
- package/lib/summaryForCreateNew.d.ts +21 -1
- package/lib/summaryForCreateNew.d.ts.map +1 -1
- package/lib/summaryForCreateNew.js +24 -0
- package/lib/summaryForCreateNew.js.map +1 -1
- package/lib/treeConversions.d.ts.map +1 -1
- package/lib/treeConversions.js +8 -9
- package/lib/treeConversions.js.map +1 -1
- package/package.json +52 -75
- package/src/fluidResolvedUrl.ts +8 -0
- package/src/index.ts +4 -19
- package/src/messageRecognition.ts +0 -36
- package/src/network.ts +0 -16
- package/src/networkUtils.ts +0 -32
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +37 -18
- package/src/summaryForCreateNew.ts +48 -2
- package/src/treeConversions.ts +8 -9
- package/dist/blobAggregationStorage.d.ts +0 -43
- package/dist/blobAggregationStorage.d.ts.map +0 -1
- package/dist/blobAggregationStorage.js +0 -323
- package/dist/blobAggregationStorage.js.map +0 -1
- package/dist/blobCacheStorageService.d.ts +0 -16
- package/dist/blobCacheStorageService.d.ts.map +0 -1
- package/dist/blobCacheStorageService.js +0 -29
- package/dist/blobCacheStorageService.js.map +0 -1
- package/dist/emptyDocumentDeltaStorageService.d.ts +0 -13
- package/dist/emptyDocumentDeltaStorageService.d.ts.map +0 -1
- package/dist/emptyDocumentDeltaStorageService.js +0 -20
- package/dist/emptyDocumentDeltaStorageService.js.map +0 -1
- package/dist/mapWithExpiration.d.ts +0 -34
- package/dist/mapWithExpiration.d.ts.map +0 -1
- package/dist/mapWithExpiration.js +0 -105
- package/dist/mapWithExpiration.js.map +0 -1
- package/dist/multiDocumentServiceFactory.d.ts +0 -16
- package/dist/multiDocumentServiceFactory.d.ts.map +0 -1
- package/dist/multiDocumentServiceFactory.js +0 -63
- package/dist/multiDocumentServiceFactory.js.map +0 -1
- package/dist/multiUrlResolver.d.ts +0 -20
- package/dist/multiUrlResolver.d.ts.map +0 -1
- package/dist/multiUrlResolver.js +0 -45
- package/dist/multiUrlResolver.js.map +0 -1
- package/dist/treeUtils.d.ts +0 -51
- package/dist/treeUtils.d.ts.map +0 -1
- package/dist/treeUtils.js +0 -85
- package/dist/treeUtils.js.map +0 -1
- package/lib/blobAggregationStorage.d.ts +0 -43
- package/lib/blobAggregationStorage.d.ts.map +0 -1
- package/lib/blobAggregationStorage.js +0 -318
- package/lib/blobAggregationStorage.js.map +0 -1
- package/lib/blobCacheStorageService.d.ts +0 -16
- package/lib/blobCacheStorageService.d.ts.map +0 -1
- package/lib/blobCacheStorageService.js +0 -25
- package/lib/blobCacheStorageService.js.map +0 -1
- package/lib/emptyDocumentDeltaStorageService.d.ts +0 -13
- package/lib/emptyDocumentDeltaStorageService.d.ts.map +0 -1
- package/lib/emptyDocumentDeltaStorageService.js +0 -16
- package/lib/emptyDocumentDeltaStorageService.js.map +0 -1
- package/lib/mapWithExpiration.d.ts +0 -34
- package/lib/mapWithExpiration.d.ts.map +0 -1
- package/lib/mapWithExpiration.js +0 -101
- package/lib/mapWithExpiration.js.map +0 -1
- package/lib/multiDocumentServiceFactory.d.ts +0 -16
- package/lib/multiDocumentServiceFactory.d.ts.map +0 -1
- package/lib/multiDocumentServiceFactory.js +0 -59
- package/lib/multiDocumentServiceFactory.js.map +0 -1
- package/lib/multiUrlResolver.d.ts +0 -20
- package/lib/multiUrlResolver.d.ts.map +0 -1
- package/lib/multiUrlResolver.js +0 -40
- package/lib/multiUrlResolver.js.map +0 -1
- package/lib/treeUtils.d.ts +0 -51
- package/lib/treeUtils.d.ts.map +0 -1
- package/lib/treeUtils.js +0 -80
- package/lib/treeUtils.js.map +0 -1
- package/src/blobAggregationStorage.ts +0 -420
- package/src/blobCacheStorageService.ts +0 -35
- package/src/emptyDocumentDeltaStorageService.ts +0 -25
- package/src/mapWithExpiration.ts +0 -124
- package/src/multiDocumentServiceFactory.ts +0 -91
- package/src/multiUrlResolver.ts +0 -48
- package/src/treeUtils.ts +0 -107
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/multiDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,qBAAa,2BAA4B,YAAW,uBAAuB;WAC5D,MAAM,CACnB,sBAAsB,EAAE,uBAAuB,GAAG,uBAAuB,EAAE;IAoB5E,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAuC;gBAExE,wBAAwB,EAAE,uBAAuB,EAAE;IAM/D,SAAgB,YAAY,WAAW;IACjC,qBAAqB,CAC1B,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAgBf,eAAe,CAC3B,gBAAgB,EAAE,YAAY,EAC9B,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAmB5B"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { parse } from "url";
|
|
6
|
-
import { ensureFluidResolvedUrl } from "./fluidResolvedUrl";
|
|
7
|
-
export class MultiDocumentServiceFactory {
|
|
8
|
-
constructor(documentServiceFactories) {
|
|
9
|
-
this.protocolName = "none:";
|
|
10
|
-
this.protocolToDocumentFactoryMap = new Map();
|
|
11
|
-
documentServiceFactories.forEach((factory) => {
|
|
12
|
-
this.protocolToDocumentFactoryMap.set(factory.protocolName, factory);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
static create(documentServiceFactory) {
|
|
16
|
-
if (Array.isArray(documentServiceFactory)) {
|
|
17
|
-
const factories = [];
|
|
18
|
-
documentServiceFactory.forEach((factory) => {
|
|
19
|
-
const maybeMulti = factory;
|
|
20
|
-
if (maybeMulti.protocolToDocumentFactoryMap !== undefined) {
|
|
21
|
-
factories.push(...maybeMulti.protocolToDocumentFactoryMap.values());
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
factories.push(factory);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
if (factories.length === 1) {
|
|
28
|
-
return factories[0];
|
|
29
|
-
}
|
|
30
|
-
return new MultiDocumentServiceFactory(factories);
|
|
31
|
-
}
|
|
32
|
-
return documentServiceFactory;
|
|
33
|
-
}
|
|
34
|
-
async createDocumentService(resolvedUrl, logger, clientIsSummarizer) {
|
|
35
|
-
ensureFluidResolvedUrl(resolvedUrl);
|
|
36
|
-
const urlObj = parse(resolvedUrl.url);
|
|
37
|
-
if (urlObj.protocol === undefined || urlObj.protocol === null) {
|
|
38
|
-
throw new Error("No protocol provided");
|
|
39
|
-
}
|
|
40
|
-
const factory = this.protocolToDocumentFactoryMap.get(urlObj.protocol);
|
|
41
|
-
if (factory === undefined) {
|
|
42
|
-
throw new Error("Unknown Fluid protocol");
|
|
43
|
-
}
|
|
44
|
-
return factory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
|
|
45
|
-
}
|
|
46
|
-
async createContainer(createNewSummary, createNewResolvedUrl, logger, clientIsSummarizer) {
|
|
47
|
-
ensureFluidResolvedUrl(createNewResolvedUrl);
|
|
48
|
-
const urlObj = parse(createNewResolvedUrl.url);
|
|
49
|
-
if (urlObj.protocol === undefined || urlObj.protocol === null) {
|
|
50
|
-
throw new Error("No protocol provided");
|
|
51
|
-
}
|
|
52
|
-
const factory = this.protocolToDocumentFactoryMap.get(urlObj.protocol);
|
|
53
|
-
if (factory === undefined) {
|
|
54
|
-
throw new Error("Unknown Fluid protocol");
|
|
55
|
-
}
|
|
56
|
-
return factory.createContainer(createNewSummary, createNewResolvedUrl, logger, clientIsSummarizer);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=multiDocumentServiceFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiDocumentServiceFactory.js","sourceRoot":"","sources":["../src/multiDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAQ5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,OAAO,2BAA2B;IAwBvC,YAAY,wBAAmD;QAM/C,iBAAY,GAAG,OAAO,CAAC;QALtC,IAAI,CAAC,4BAA4B,GAAG,IAAI,GAAG,EAAE,CAAC;QAC9C,wBAAwB,CAAC,OAAO,CAAC,CAAC,OAAgC,EAAE,EAAE;YACrE,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACJ,CAAC;IA5BM,MAAM,CAAC,MAAM,CACnB,sBAA2E;QAE3E,IAAI,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAAE;YAC1C,MAAM,SAAS,GAA8B,EAAE,CAAC;YAChD,sBAAsB,CAAC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AC7C,MAAM,MAAM,GAAG,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE;YAC9D,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;SACxC;QACD,MAAM,OAAO,GAAwC,IAAI,CAAC,4BAA4B,CAAC,GAAG,CACzF,MAAM,CAAC,QAAQ,CACf,CAAC;QACF,IAAI,OAAO,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC1C;QACD,OAAO,OAAO,CAAC,eAAe,CAC7B,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,EACN,kBAAkB,CAClB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport {\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n\tIDocumentService,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { ensureFluidResolvedUrl } from \"./fluidResolvedUrl\";\n\nexport class MultiDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tdocumentServiceFactory: IDocumentServiceFactory | IDocumentServiceFactory[],\n\t) {\n\t\tif (Array.isArray(documentServiceFactory)) {\n\t\t\tconst factories: IDocumentServiceFactory[] = [];\n\t\t\tdocumentServiceFactory.forEach((factory) => {\n\t\t\t\tconst maybeMulti = factory as MultiDocumentServiceFactory;\n\t\t\t\tif (maybeMulti.protocolToDocumentFactoryMap !== undefined) {\n\t\t\t\t\tfactories.push(...maybeMulti.protocolToDocumentFactoryMap.values());\n\t\t\t\t} else {\n\t\t\t\t\tfactories.push(factory);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (factories.length === 1) {\n\t\t\t\treturn factories[0];\n\t\t\t}\n\t\t\treturn new MultiDocumentServiceFactory(factories);\n\t\t}\n\t\treturn documentServiceFactory;\n\t}\n\n\tprivate readonly protocolToDocumentFactoryMap: Map<string, IDocumentServiceFactory>;\n\n\tconstructor(documentServiceFactories: IDocumentServiceFactory[]) {\n\t\tthis.protocolToDocumentFactoryMap = new Map();\n\t\tdocumentServiceFactories.forEach((factory: IDocumentServiceFactory) => {\n\t\t\tthis.protocolToDocumentFactoryMap.set(factory.protocolName, factory);\n\t\t});\n\t}\n\tpublic readonly protocolName = \"none:\";\n\tasync createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tensureFluidResolvedUrl(resolvedUrl);\n\t\tconst urlObj = parse(resolvedUrl.url);\n\t\tif (urlObj.protocol === undefined || urlObj.protocol === null) {\n\t\t\tthrow new Error(\"No protocol provided\");\n\t\t}\n\t\tconst factory: IDocumentServiceFactory | undefined = this.protocolToDocumentFactoryMap.get(\n\t\t\turlObj.protocol,\n\t\t);\n\t\tif (factory === undefined) {\n\t\t\tthrow new Error(\"Unknown Fluid protocol\");\n\t\t}\n\n\t\treturn factory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tensureFluidResolvedUrl(createNewResolvedUrl);\n\t\tconst urlObj = parse(createNewResolvedUrl.url);\n\t\tif (urlObj.protocol === undefined || urlObj.protocol === null) {\n\t\t\tthrow new Error(\"No protocol provided\");\n\t\t}\n\t\tconst factory: IDocumentServiceFactory | undefined = this.protocolToDocumentFactoryMap.get(\n\t\t\turlObj.protocol,\n\t\t);\n\t\tif (factory === undefined) {\n\t\t\tthrow new Error(\"Unknown Fluid protocol\");\n\t\t}\n\t\treturn factory.createContainer(\n\t\t\tcreateNewSummary,\n\t\t\tcreateNewResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IRequest } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
|
|
7
|
-
/**
|
|
8
|
-
* Resolver that takes a list of url resolvers and then try each of them to resolve the url.
|
|
9
|
-
* @param resolversList - List of url resolvers to be used to resolve the request.
|
|
10
|
-
* @param request - Request to be resolved.
|
|
11
|
-
*/
|
|
12
|
-
export declare function configurableUrlResolver(resolversList: IUrlResolver[], request: IRequest): Promise<IResolvedUrl | undefined>;
|
|
13
|
-
export declare class MultiUrlResolver implements IUrlResolver {
|
|
14
|
-
private readonly urlResolvers;
|
|
15
|
-
static create(urlResolver: IUrlResolver | IUrlResolver[]): IUrlResolver;
|
|
16
|
-
private constructor();
|
|
17
|
-
resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
|
|
18
|
-
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=multiUrlResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiUrlResolver.d.ts","sourceRoot":"","sources":["../src/multiUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEhF;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC5C,aAAa,EAAE,YAAY,EAAE,EAC7B,OAAO,EAAE,QAAQ,GACf,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CASnC;AAED,qBAAa,gBAAiB,YAAW,YAAY;IAWhC,OAAO,CAAC,QAAQ,CAAC,YAAY;WAVnC,MAAM,CAAC,WAAW,EAAE,YAAY,GAAG,YAAY,EAAE;IAU/D,OAAO;IAED,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAItD,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG5F"}
|
package/lib/multiUrlResolver.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Resolver that takes a list of url resolvers and then try each of them to resolve the url.
|
|
7
|
-
* @param resolversList - List of url resolvers to be used to resolve the request.
|
|
8
|
-
* @param request - Request to be resolved.
|
|
9
|
-
*/
|
|
10
|
-
export async function configurableUrlResolver(resolversList, request) {
|
|
11
|
-
let resolved;
|
|
12
|
-
for (const resolver of resolversList) {
|
|
13
|
-
resolved = await resolver.resolve(Object.assign({}, request));
|
|
14
|
-
if (resolved !== undefined) {
|
|
15
|
-
return resolved;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
export class MultiUrlResolver {
|
|
21
|
-
constructor(urlResolvers) {
|
|
22
|
-
this.urlResolvers = urlResolvers;
|
|
23
|
-
}
|
|
24
|
-
static create(urlResolver) {
|
|
25
|
-
if (Array.isArray(urlResolver)) {
|
|
26
|
-
if (urlResolver.length === 1) {
|
|
27
|
-
return urlResolver[0];
|
|
28
|
-
}
|
|
29
|
-
return new MultiUrlResolver(urlResolver);
|
|
30
|
-
}
|
|
31
|
-
return urlResolver;
|
|
32
|
-
}
|
|
33
|
-
async resolve(request) {
|
|
34
|
-
return configurableUrlResolver(this.urlResolvers, request);
|
|
35
|
-
}
|
|
36
|
-
async getAbsoluteUrl(resolvedUrl, relativeUrl) {
|
|
37
|
-
throw new Error("Not implmented");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=multiUrlResolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiUrlResolver.js","sourceRoot":"","sources":["../src/multiUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC5C,aAA6B,EAC7B,OAAiB;IAEjB,IAAI,QAAkC,CAAC;IACvC,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE;QACrC,QAAQ,GAAG,MAAM,QAAQ,CAAC,OAAO,mBAAM,OAAO,EAAG,CAAC;QAClD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC3B,OAAO,QAAQ,CAAC;SAChB;KACD;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,OAAO,gBAAgB;IAW5B,YAAqC,YAA4B;QAA5B,iBAAY,GAAZ,YAAY,CAAgB;IAAG,CAAC;IAV9D,MAAM,CAAC,MAAM,CAAC,WAA0C;QAC9D,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAC/B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC7B,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;aACtB;YACD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;SACzC;QACD,OAAO,WAAW,CAAC;IACpB,CAAC;IAID,KAAK,CAAC,OAAO,CAAC,OAAiB;QAC9B,OAAO,uBAAuB,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,WAAyB,EAAE,WAAmB;QACzE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACnC,CAAC;CACD","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 { IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\n\n/**\n * Resolver that takes a list of url resolvers and then try each of them to resolve the url.\n * @param resolversList - List of url resolvers to be used to resolve the request.\n * @param request - Request to be resolved.\n */\nexport async function configurableUrlResolver(\n\tresolversList: IUrlResolver[],\n\trequest: IRequest,\n): Promise<IResolvedUrl | undefined> {\n\tlet resolved: IResolvedUrl | undefined;\n\tfor (const resolver of resolversList) {\n\t\tresolved = await resolver.resolve({ ...request });\n\t\tif (resolved !== undefined) {\n\t\t\treturn resolved;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nexport class MultiUrlResolver implements IUrlResolver {\n\tpublic static create(urlResolver: IUrlResolver | IUrlResolver[]) {\n\t\tif (Array.isArray(urlResolver)) {\n\t\t\tif (urlResolver.length === 1) {\n\t\t\t\treturn urlResolver[0];\n\t\t\t}\n\t\t\treturn new MultiUrlResolver(urlResolver);\n\t\t}\n\t\treturn urlResolver;\n\t}\n\n\tprivate constructor(private readonly urlResolvers: IUrlResolver[]) {}\n\n\tasync resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\treturn configurableUrlResolver(this.urlResolvers, request);\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tthrow new Error(\"Not implmented\");\n\t}\n}\n"]}
|
package/lib/treeUtils.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { SummaryType, ISnapshotTree, ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
6
|
-
/**
|
|
7
|
-
* Summary tree assembler props
|
|
8
|
-
*/
|
|
9
|
-
export interface ISummaryTreeAssemblerProps {
|
|
10
|
-
/**
|
|
11
|
-
* Indicates that this tree is unreferenced. If this is not present, the tree is considered referenced.
|
|
12
|
-
*/
|
|
13
|
-
unreferenced?: true;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Summary tree assembler (without stats collection).
|
|
17
|
-
*/
|
|
18
|
-
export declare class SummaryTreeAssembler {
|
|
19
|
-
private readonly props?;
|
|
20
|
-
private attachmentCounter;
|
|
21
|
-
private readonly summaryTree;
|
|
22
|
-
constructor(props?: ISummaryTreeAssemblerProps | undefined);
|
|
23
|
-
/**
|
|
24
|
-
* Get final summary
|
|
25
|
-
*/
|
|
26
|
-
get summary(): ISummaryTree;
|
|
27
|
-
/**
|
|
28
|
-
* Add blob to summary
|
|
29
|
-
*/
|
|
30
|
-
addBlob(key: string, content: string | Uint8Array): void;
|
|
31
|
-
/**
|
|
32
|
-
* Add handle to summary
|
|
33
|
-
*/
|
|
34
|
-
addHandle(key: string, handleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment, handle: string): void;
|
|
35
|
-
/**
|
|
36
|
-
* Add tree to summary
|
|
37
|
-
*/
|
|
38
|
-
addTree(key: string, summary: ISummaryTree): void;
|
|
39
|
-
/**
|
|
40
|
-
* Add attachment to summary
|
|
41
|
-
*/
|
|
42
|
-
addAttachment(id: string): void;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Helper function that converts ISnapshotTree and blobs to ISummaryTree
|
|
46
|
-
* @param snapshot - Source snapshot tree
|
|
47
|
-
* @param blobs - Blobs cache
|
|
48
|
-
* @returns Converted snapshot in ISummaryTree format
|
|
49
|
-
*/
|
|
50
|
-
export declare function convertSnapshotAndBlobsToSummaryTree(snapshot: ISnapshotTree, blobs: Map<string, ArrayBuffer>): ISummaryTree;
|
|
51
|
-
//# sourceMappingURL=treeUtils.d.ts.map
|
package/lib/treeUtils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"treeUtils.d.ts","sourceRoot":"","sources":["../src/treeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,WAAW,EACX,aAAa,EACb,YAAY,EAEZ,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,oBAAoB;IAIpB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAHnC,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyC;gBAExC,KAAK,CAAC,wCAA4B;IAE/D;;OAEG;IACH,IAAW,OAAO,IAAI,YAAY,CAMjC;IAED;;OAEG;IACI,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAO/D;;OAEG;IACI,SAAS,CACf,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,UAAU,EACxE,MAAM,EAAE,MAAM,GACZ,IAAI;IAQP;;OAEG;IACI,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAIxD;;OAEG;IACI,aAAa,CAAC,EAAE,EAAE,MAAM;CAG/B;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CACnD,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAC7B,YAAY,CAcd"}
|
package/lib/treeUtils.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { assert, IsoBuffer } from "@fluidframework/common-utils";
|
|
6
|
-
import { SummaryType, } from "@fluidframework/protocol-definitions";
|
|
7
|
-
/**
|
|
8
|
-
* Summary tree assembler (without stats collection).
|
|
9
|
-
*/
|
|
10
|
-
export class SummaryTreeAssembler {
|
|
11
|
-
constructor(props) {
|
|
12
|
-
this.props = props;
|
|
13
|
-
this.attachmentCounter = 0;
|
|
14
|
-
this.summaryTree = {};
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Get final summary
|
|
18
|
-
*/
|
|
19
|
-
get summary() {
|
|
20
|
-
var _a;
|
|
21
|
-
return {
|
|
22
|
-
type: SummaryType.Tree,
|
|
23
|
-
tree: Object.assign({}, this.summaryTree),
|
|
24
|
-
unreferenced: (_a = this.props) === null || _a === void 0 ? void 0 : _a.unreferenced,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Add blob to summary
|
|
29
|
-
*/
|
|
30
|
-
addBlob(key, content) {
|
|
31
|
-
this.summaryTree[key] = {
|
|
32
|
-
type: SummaryType.Blob,
|
|
33
|
-
content,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Add handle to summary
|
|
38
|
-
*/
|
|
39
|
-
addHandle(key, handleType, handle) {
|
|
40
|
-
this.summaryTree[key] = {
|
|
41
|
-
type: SummaryType.Handle,
|
|
42
|
-
handleType,
|
|
43
|
-
handle,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Add tree to summary
|
|
48
|
-
*/
|
|
49
|
-
addTree(key, summary) {
|
|
50
|
-
this.summaryTree[key] = summary;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Add attachment to summary
|
|
54
|
-
*/
|
|
55
|
-
addAttachment(id) {
|
|
56
|
-
this.summaryTree[this.attachmentCounter++] = { id, type: SummaryType.Attachment };
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Helper function that converts ISnapshotTree and blobs to ISummaryTree
|
|
61
|
-
* @param snapshot - Source snapshot tree
|
|
62
|
-
* @param blobs - Blobs cache
|
|
63
|
-
* @returns Converted snapshot in ISummaryTree format
|
|
64
|
-
*/
|
|
65
|
-
export function convertSnapshotAndBlobsToSummaryTree(snapshot, blobs) {
|
|
66
|
-
const assembler = new SummaryTreeAssembler({
|
|
67
|
-
unreferenced: snapshot.unreferenced,
|
|
68
|
-
});
|
|
69
|
-
for (const [path, id] of Object.entries(snapshot.blobs)) {
|
|
70
|
-
const blob = blobs.get(id);
|
|
71
|
-
assert(blob !== undefined, 0x2dd /* "Cannot find blob for a given id" */);
|
|
72
|
-
assembler.addBlob(path, IsoBuffer.from(blob).toString("utf-8"));
|
|
73
|
-
}
|
|
74
|
-
for (const [key, tree] of Object.entries(snapshot.trees)) {
|
|
75
|
-
const subtree = convertSnapshotAndBlobsToSummaryTree(tree, blobs);
|
|
76
|
-
assembler.addTree(key, subtree);
|
|
77
|
-
}
|
|
78
|
-
return assembler.summary;
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=treeUtils.js.map
|
package/lib/treeUtils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"treeUtils.js","sourceRoot":"","sources":["../src/treeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACN,WAAW,GAIX,MAAM,sCAAsC,CAAC;AAY9C;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAIhC,YAA6B,KAAkC;QAAlC,UAAK,GAAL,KAAK,CAA6B;QAHvD,sBAAiB,GAAW,CAAC,CAAC;QACrB,gBAAW,GAAsC,EAAE,CAAC;IAEH,CAAC;IAEnE;;OAEG;IACH,I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AC,uCAAuC,CAAC,CAAC;QAC1E,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;KAChE;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACzD,MAAM,OAAO,GAAG,oCAAoC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAClE,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAChC;IACD,OAAO,SAAS,CAAC,OAAO,CAAC;AAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, IsoBuffer } from \"@fluidframework/common-utils\";\nimport {\n\tSummaryType,\n\tISnapshotTree,\n\tISummaryTree,\n\tSummaryObject,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Summary tree assembler props\n */\nexport interface ISummaryTreeAssemblerProps {\n\t/**\n\t * Indicates that this tree is unreferenced. If this is not present, the tree is considered referenced.\n\t */\n\tunreferenced?: true;\n}\n\n/**\n * Summary tree assembler (without stats collection).\n */\nexport class SummaryTreeAssembler {\n\tprivate attachmentCounter: number = 0;\n\tprivate readonly summaryTree: { [path: string]: SummaryObject } = {};\n\n\tconstructor(private readonly props?: ISummaryTreeAssemblerProps) {}\n\n\t/**\n\t * Get final summary\n\t */\n\tpublic get summary(): ISummaryTree {\n\t\treturn {\n\t\t\ttype: SummaryType.Tree,\n\t\t\ttree: { ...this.summaryTree },\n\t\t\tunreferenced: this.props?.unreferenced,\n\t\t};\n\t}\n\n\t/**\n\t * Add blob to summary\n\t */\n\tpublic addBlob(key: string, content: string | Uint8Array): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Blob,\n\t\t\tcontent,\n\t\t};\n\t}\n\n\t/**\n\t * Add handle to summary\n\t */\n\tpublic addHandle(\n\t\tkey: string,\n\t\thandleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment,\n\t\thandle: string,\n\t): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Handle,\n\t\t\thandleType,\n\t\t\thandle,\n\t\t};\n\t}\n\n\t/**\n\t * Add tree to summary\n\t */\n\tpublic addTree(key: string, summary: ISummaryTree): void {\n\t\tthis.summaryTree[key] = summary;\n\t}\n\n\t/**\n\t * Add attachment to summary\n\t */\n\tpublic addAttachment(id: string) {\n\t\tthis.summaryTree[this.attachmentCounter++] = { id, type: SummaryType.Attachment };\n\t}\n}\n\n/**\n * Helper function that converts ISnapshotTree and blobs to ISummaryTree\n * @param snapshot - Source snapshot tree\n * @param blobs - Blobs cache\n * @returns Converted snapshot in ISummaryTree format\n */\nexport function convertSnapshotAndBlobsToSummaryTree(\n\tsnapshot: ISnapshotTree,\n\tblobs: Map<string, ArrayBuffer>,\n): ISummaryTree {\n\tconst assembler = new SummaryTreeAssembler({\n\t\tunreferenced: snapshot.unreferenced,\n\t});\n\tfor (const [path, id] of Object.entries(snapshot.blobs)) {\n\t\tconst blob = blobs.get(id);\n\t\tassert(blob !== undefined, 0x2dd /* \"Cannot find blob for a given id\" */);\n\t\tassembler.addBlob(path, IsoBuffer.from(blob).toString(\"utf-8\"));\n\t}\n\tfor (const [key, tree] of Object.entries(snapshot.trees)) {\n\t\tconst subtree = convertSnapshotAndBlobsToSummaryTree(tree, blobs);\n\t\tassembler.addTree(key, subtree);\n\t}\n\treturn assembler.summary;\n}\n"]}
|