@fluidframework/container-loader 0.59.4000 → 1.0.1
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/.eslintrc.js +1 -1
- package/README.md +1 -1
- package/dist/connectionState.d.ts +15 -3
- package/dist/connectionState.d.ts.map +1 -1
- package/dist/connectionState.js +15 -3
- package/dist/connectionState.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +6 -4
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +21 -6
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +18 -26
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +54 -88
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +6 -4
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +8 -7
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +2 -3
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +0 -3
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/deltaManagerProxy.d.ts +0 -1
- package/dist/deltaManagerProxy.d.ts.map +1 -1
- package/dist/deltaManagerProxy.js +0 -3
- package/dist/deltaManagerProxy.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -13
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +2 -3
- package/dist/loader.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts +0 -1
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js +0 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +1 -2
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +0 -3
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/lib/connectionState.d.ts +15 -3
- package/lib/connectionState.d.ts.map +1 -1
- package/lib/connectionState.js +15 -3
- package/lib/connectionState.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +6 -4
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +21 -6
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +18 -26
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +54 -88
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +6 -4
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +8 -7
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +2 -3
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +0 -3
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/deltaManagerProxy.d.ts +0 -1
- package/lib/deltaManagerProxy.d.ts.map +1 -1
- package/lib/deltaManagerProxy.js +0 -3
- package/lib/deltaManagerProxy.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +1 -13
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +2 -3
- package/lib/loader.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts +0 -1
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js +0 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +1 -2
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +0 -3
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/package.json +25 -25
- package/src/connectionState.ts +20 -6
- package/src/connectionStateHandler.ts +29 -8
- package/src/container.ts +77 -100
- package/src/containerContext.ts +10 -10
- package/src/containerStorageAdapter.ts +1 -6
- package/src/deltaManagerProxy.ts +0 -4
- package/src/index.ts +1 -0
- package/src/loader.ts +4 -21
- package/src/packageVersion.ts +1 -1
- package/src/protocolTreeDocumentStorageService.ts +0 -1
- package/src/retriableDocumentStorageService.ts +0 -8
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
6
|
-
import { IAudience, IContainerContext, IDeltaManager, ILoader, ICriticalContainerError, AttachState, ILoaderOptions, IFluidCodeDetails, ICodeDetailsLoader } from "@fluidframework/container-definitions";
|
|
6
|
+
import { IAudience, IContainerContext, IDeltaManager, ILoader, ICriticalContainerError, AttachState, ILoaderOptions, IFluidCodeDetails, ICodeDetailsLoader, ISnapshotTreeWithBlobContents } from "@fluidframework/container-definitions";
|
|
7
7
|
import { IRequest, IResponse, FluidObject } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
9
9
|
import { IClientConfiguration, IClientDetails, IDocumentMessage, IQuorum, IQuorumClients, ISequencedDocumentMessage, ISignalMessage, ISnapshotTree, ISummaryTree, IVersion, MessageType } from "@fluidframework/protocol-definitions";
|
|
@@ -13,7 +13,7 @@ export declare class ContainerContext implements IContainerContext {
|
|
|
13
13
|
readonly scope: FluidObject;
|
|
14
14
|
private readonly codeLoader;
|
|
15
15
|
private readonly _codeDetails;
|
|
16
|
-
private
|
|
16
|
+
private _baseSnapshot;
|
|
17
17
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
18
18
|
readonly loader: ILoader;
|
|
19
19
|
readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData: any) => number;
|
|
@@ -26,7 +26,9 @@ export declare class ContainerContext implements IContainerContext {
|
|
|
26
26
|
static createOrLoad(container: Container, scope: FluidObject, codeLoader: ICodeDetailsLoader, codeDetails: IFluidCodeDetails, baseSnapshot: ISnapshotTree | undefined, deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, quorum: IQuorum, loader: ILoader, submitFn: (type: MessageType, contents: any, batch: boolean, appData: any) => number, submitSignalFn: (contents: any) => void, closeFn: (error?: ICriticalContainerError) => void, version: string, updateDirtyContainerState: (dirty: boolean) => void, existing: boolean, pendingLocalState?: unknown): Promise<ContainerContext>;
|
|
27
27
|
readonly taggedLogger: ITelemetryLogger;
|
|
28
28
|
get clientId(): string | undefined;
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.
|
|
31
|
+
*/
|
|
30
32
|
get id(): string;
|
|
31
33
|
get clientDetails(): IClientDetails;
|
|
32
34
|
get connected(): boolean;
|
|
@@ -73,7 +75,7 @@ export declare class ContainerContext implements IContainerContext {
|
|
|
73
75
|
* satisfy the incoming constraint code details
|
|
74
76
|
*/
|
|
75
77
|
satisfies(constraintCodeDetails: IFluidCodeDetails): Promise<boolean>;
|
|
76
|
-
notifyAttaching(): void;
|
|
78
|
+
notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;
|
|
77
79
|
private getRuntimeFactory;
|
|
78
80
|
private instantiateRuntime;
|
|
79
81
|
private attachListener;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EACH,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,OAAO,EAEP,uBAAuB,EACvB,WAAW,EACX,cAAc,EAGd,iBA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EAAE,MAAM;IAQxD,OAAO,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG;IAIxE,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO;IAI/C,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAI3C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAItE,oBAAoB,IAAI,OAAO;IAItC;;;OAGG;IACU,SAAS,CAAC,qBAAqB,EAAE,iBAAiB;IAoCxD,eAAe,CAAC,QAAQ,EAAE,6BAA6B;YAQhD,iBAAiB;YAWjB,kBAAkB;IAKhC,OAAO,CAAC,cAAc;YAMR,cAAc;CAqB/B"}
|
package/dist/containerContext.js
CHANGED
|
@@ -40,7 +40,9 @@ class ContainerContext {
|
|
|
40
40
|
get clientId() {
|
|
41
41
|
return this.container.clientId;
|
|
42
42
|
}
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.
|
|
45
|
+
*/
|
|
44
46
|
get id() {
|
|
45
47
|
const resolvedUrl = this.container.resolvedUrl;
|
|
46
48
|
if ((0, driver_utils_1.isFluidResolvedUrl)(resolvedUrl)) {
|
|
@@ -169,7 +171,10 @@ class ContainerContext {
|
|
|
169
171
|
}
|
|
170
172
|
return true;
|
|
171
173
|
}
|
|
172
|
-
notifyAttaching() {
|
|
174
|
+
notifyAttaching(snapshot) {
|
|
175
|
+
var _a, _b;
|
|
176
|
+
this._baseSnapshot = snapshot;
|
|
177
|
+
(_b = (_a = this.runtime).notifyAttaching) === null || _b === void 0 ? void 0 : _b.call(_a, snapshot);
|
|
173
178
|
this.runtime.setAttachState(container_definitions_1.AttachState.Attaching);
|
|
174
179
|
}
|
|
175
180
|
// #region private
|
|
@@ -192,10 +197,6 @@ class ContainerContext {
|
|
|
192
197
|
});
|
|
193
198
|
}
|
|
194
199
|
async loadCodeModule(codeDetails) {
|
|
195
|
-
// load may actually produce a IFluidModule if using a legacy ICodeLoader.
|
|
196
|
-
// Because the type system currently does not capture this in load,
|
|
197
|
-
// explicitly declare the type here to support both cases.
|
|
198
|
-
// See also comment about this below.
|
|
199
200
|
const loadCodeResult = await telemetry_utils_1.PerformanceEvent.timedExecAsync(this.taggedLogger, { eventName: "CodeLoad" }, async () => this.codeLoader.load(codeDetails));
|
|
200
201
|
if ("module" in loadCodeResult) {
|
|
201
202
|
const { module, details } = loadCodeResult;
|
|
@@ -208,7 +209,7 @@ class ContainerContext {
|
|
|
208
209
|
// If "module" is not in the result, we are using a legacy ICodeLoader. Fix the result up with details.
|
|
209
210
|
// Once usage drops to 0 we can remove this compat path.
|
|
210
211
|
this.taggedLogger.sendTelemetryEvent({ eventName: "LegacyCodeLoader" });
|
|
211
|
-
return
|
|
212
|
+
return loadCodeResult;
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
215
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAmE;AACnE,iFAiB+C;AAO/C,+DAAkE;AAclE,qEAAmE;AAGnE,MAAM,sBAAsB,GAAG,iDAAiD,CAAC;AAEjF,MAAa,gBAAgB;IA0GzB,YACqB,SAAoB,EACrB,KAAkB,EACjB,UAA8B,EAC9B,YAA+B,EAC/B,aAAwC,EACzC,YAAwE,EACxF,MAAe,EACC,MAAe,EACf,QAAoF,EACpF,cAAuC,EACvC,OAAkD,EAClD,OAAe,EACf,yBAAmD,EACnD,QAAiB,EACjB,iBAA2B;QAd1B,cAAS,GAAT,SAAS,CAAW;QACrB,UAAK,GAAL,KAAK,CAAa;QACjB,eAAU,GAAV,UAAU,CAAoB;QAC9B,iBAAY,GAAZ,YAAY,CAAmB;QAC/B,kBAAa,GAAb,aAAa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,IAAI,cAAc,EAAE;YAC5B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC;YAC3C,OAAO;gBACH,MAAM;gBACN,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,WAAW;aAClC,CAAC;SACL;aAAM;YACH,wGAAwG;YACxG,wDAAwD;YACxD,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC;YACxE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;SAC3D;IACL,CAAC;CAEJ;AApSD,4CAoSC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, LazyPromise } from \"@fluidframework/common-utils\";\nimport {\n IAudience,\n IContainerContext,\n IDeltaManager,\n ILoader,\n IRuntime,\n ICriticalContainerError,\n AttachState,\n ILoaderOptions,\n IRuntimeFactory,\n IProvideRuntimeFactory,\n IFluidCodeDetails,\n IFluidCodeDetailsComparer,\n IProvideFluidCodeDetailsComparer,\n ICodeDetailsLoader,\n IFluidModuleWithDetails,\n IFluidModule,\n} from \"@fluidframework/container-definitions\";\nimport {\n IRequest,\n IResponse,\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { isFluidResolvedUrl } from \"@fluidframework/driver-utils\";\nimport {\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n IQuorum,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISignalMessage,\n ISnapshotTree,\n ISummaryTree,\n IVersion,\n MessageType,\n} from \"@fluidframework/protocol-definitions\";\nimport { PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { Container } from \"./container\";\n\nconst PackageNotFactoryError = \"Code package does not implement IRuntimeFactory\";\n\nexport class ContainerContext implements IContainerContext {\n public static async createOrLoad(\n container: Container,\n scope: FluidObject,\n codeLoader: ICodeDetailsLoader,\n codeDetails: IFluidCodeDetails,\n baseSnapshot: ISnapshotTree | undefined,\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n quorum: IQuorum,\n loader: ILoader,\n submitFn: (type: MessageType, contents: any, batch: boolean, appData: any) => number,\n submitSignalFn: (contents: any) => void,\n closeFn: (error?: ICriticalContainerError) => void,\n version: string,\n updateDirtyContainerState: (dirty: boolean) => void,\n existing: boolean,\n pendingLocalState?: unknown,\n ): Promise<ContainerContext> {\n const context = new ContainerContext(\n container,\n scope,\n codeLoader,\n codeDetails,\n baseSnapshot,\n deltaManager,\n quorum,\n loader,\n submitFn,\n submitSignalFn,\n closeFn,\n version,\n updateDirtyContainerState,\n existing,\n pendingLocalState);\n await context.instantiateRuntime(existing);\n return context;\n }\n\n public readonly taggedLogger: ITelemetryLogger;\n\n public get clientId(): string | undefined {\n return this.container.clientId;\n }\n\n /** @deprecated Added back to unblock 0.56 integration */\n public get id(): string {\n const resolvedUrl = this.container.resolvedUrl;\n if (isFluidResolvedUrl(resolvedUrl)) {\n return resolvedUrl.id;\n }\n return \"\";\n }\n\n public get clientDetails(): IClientDetails {\n return this.container.clientDetails;\n }\n\n public get connected(): boolean {\n return this.container.connected;\n }\n\n public get canSummarize(): boolean {\n return \"summarize\" in this.runtime;\n }\n\n public get serviceConfiguration(): IClientConfiguration | undefined {\n return this.container.serviceConfiguration;\n }\n\n public get audience(): IAudience {\n return this.container.audience;\n }\n\n public get options(): ILoaderOptions {\n return this.container.options;\n }\n\n public get baseSnapshot() {\n return this._baseSnapshot;\n }\n\n public get storage(): IDocumentStorageService {\n return this.container.storage;\n }\n\n private _runtime: IRuntime | undefined;\n private get runtime() {\n if (this._runtime === undefined) {\n throw new Error(\"Attempted to access runtime before it was defined\");\n }\n return this._runtime;\n }\n\n private _disposed = false;\n\n public get disposed() {\n return this._disposed;\n }\n\n public get codeDetails() { return this._codeDetails; }\n\n private readonly _quorum: IQuorum;\n public get quorum(): IQuorumClients { return this._quorum; }\n\n private readonly _fluidModuleP: Promise<IFluidModuleWithDetails>;\n\n constructor(\n private readonly container: Container,\n public readonly scope: FluidObject,\n private readonly codeLoader: ICodeDetailsLoader,\n private readonly _codeDetails: IFluidCodeDetails,\n private readonly _baseSnapshot: ISnapshotTree | undefined,\n public readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n quorum: IQuorum,\n public readonly loader: ILoader,\n public readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData: any) => number,\n public readonly submitSignalFn: (contents: any) => void,\n public readonly closeFn: (error?: ICriticalContainerError) => void,\n public readonly version: string,\n public readonly updateDirtyContainerState: (dirty: boolean) => void,\n public readonly existing: boolean,\n public readonly pendingLocalState?: unknown,\n\n ) {\n this._quorum = quorum;\n this.taggedLogger = container.subLogger;\n this._fluidModuleP = new LazyPromise<IFluidModuleWithDetails>(\n async () => this.loadCodeModule(_codeDetails),\n );\n this.attachListener();\n }\n\n /**\n * @deprecated - Temporary migratory API, to be removed when customers no longer need it. When removed,\n * ContainerContext should only take an IQuorumClients rather than an IQuorum. See IContainerContext for more\n * details.\n */\n public getSpecifiedCodeDetails(): IFluidCodeDetails | undefined {\n return (this._quorum.get(\"code\") ?? this._quorum.get(\"code2\")) as IFluidCodeDetails | undefined;\n }\n\n public dispose(error?: Error): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n\n this.runtime.dispose(error);\n this._quorum.dispose();\n this.deltaManager.dispose();\n }\n\n public getLoadedFromVersion(): IVersion | undefined {\n return this.container.loadedFromVersion;\n }\n\n public get attachState(): AttachState {\n return this.container.attachState;\n }\n\n /**\n * Create a summary. Used when attaching or serializing a detached container.\n *\n * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n * new storage IDs so requests can be redirected.\n */\n public createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree {\n return this.runtime.createSummary(blobRedirectTable);\n }\n\n public setConnectionState(connected: boolean, clientId?: string) {\n const runtime = this.runtime;\n\n assert(connected === this.connected, 0x0de /* \"Mismatch in connection state while setting\" */);\n\n runtime.setConnectionState(connected, clientId);\n }\n\n public process(message: ISequencedDocumentMessage, local: boolean, context: any) {\n this.runtime.process(message, local, context);\n }\n\n public processSignal(message: ISignalMessage, local: boolean) {\n this.runtime.processSignal(message, local);\n }\n\n public async request(path: IRequest): Promise<IResponse> {\n return this.runtime.request(path);\n }\n\n public async getAbsoluteUrl(relativeUrl: string): Promise<string | undefined> {\n return this.container.getAbsoluteUrl(relativeUrl);\n }\n\n public getPendingLocalState(): unknown {\n return this.runtime.getPendingLocalState();\n }\n\n /**\n * Determines if the current code details of the context\n * satisfy the incoming constraint code details\n */\n public async satisfies(constraintCodeDetails: IFluidCodeDetails) {\n const comparers: IFluidCodeDetailsComparer[] = [];\n\n const maybeCompareCodeLoader = this.codeLoader;\n if (maybeCompareCodeLoader.IFluidCodeDetailsComparer !== undefined) {\n comparers.push(maybeCompareCodeLoader.IFluidCodeDetailsComparer);\n }\n\n const moduleWithDetails = await this._fluidModuleP;\n const maybeCompareExport: Partial<IProvideFluidCodeDetailsComparer> | undefined =\n moduleWithDetails.module?.fluidExport;\n if (maybeCompareExport?.IFluidCodeDetailsComparer !== undefined) {\n comparers.push(maybeCompareExport.IFluidCodeDetailsComparer);\n }\n\n // if there are not comparers it is not possible to know\n // if the current satisfy the incoming, so return false,\n // as assuming they do not satisfy is safer .e.g we will\n // reload, rather than potentially running with\n // incompatible code\n if (comparers.length === 0) {\n return false;\n }\n\n for (const comparer of comparers) {\n const satisfies = await comparer.satisfies(\n moduleWithDetails.details,\n constraintCodeDetails,\n );\n if (satisfies === false) {\n return false;\n }\n }\n return true;\n }\n\n public notifyAttaching() {\n this.runtime.setAttachState(AttachState.Attaching);\n }\n\n // #region private\n\n private async getRuntimeFactory(): Promise<IRuntimeFactory> {\n const fluidExport: FluidObject<IProvideRuntimeFactory> | undefined =\n (await this._fluidModuleP).module?.fluidExport;\n const runtimeFactory = fluidExport?.IRuntimeFactory;\n if (runtimeFactory === undefined) {\n throw new Error(PackageNotFactoryError);\n }\n\n return runtimeFactory;\n }\n\n private async instantiateRuntime(existing: boolean) {\n const runtimeFactory = await this.getRuntimeFactory();\n this._runtime = await runtimeFactory.instantiateRuntime(this, existing);\n }\n\n private attachListener() {\n this.container.once(\"attached\", () => {\n this.runtime.setAttachState(AttachState.Attached);\n });\n }\n\n private async loadCodeModule(codeDetails: IFluidCodeDetails): Promise<IFluidModuleWithDetails> {\n // load may actually produce a IFluidModule if using a legacy ICodeLoader.\n // Because the type system currently does not capture this in load,\n // explicitly declare the type here to support both cases.\n // See also comment about this below.\n const loadCodeResult: IFluidModuleWithDetails | IFluidModule = await PerformanceEvent.timedExecAsync(\n this.taggedLogger,\n { eventName: \"CodeLoad\" },\n async () => this.codeLoader.load(codeDetails),\n );\n\n if (\"module\" in loadCodeResult) {\n const { module, details } = loadCodeResult;\n return {\n module,\n details: details ?? codeDetails,\n };\n } else {\n // If \"module\" is not in the result, we are using a legacy ICodeLoader. Fix the result up with details.\n // Once usage drops to 0 we can remove this compat path.\n this.taggedLogger.sendTelemetryEvent({ eventName: \"LegacyCodeLoader\" });\n return { module: loadCodeResult, details: codeDetails };\n }\n }\n // #endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAmE;AACnE,iFAiB+C;AAO/C,+DAAkE;AAclE,qEAAmE;AAGnE,MAAM,sBAAsB,GAAG,iDAAiD,CAAC;AAEjF,MAAa,gBAAgB;IA4GzB,YACqB,SAAoB,EACrB,KAAkB,EACjB,UAA8B,EAC9B,YAA+B,EACxC,aAAwC,EAChC,YAAwE,EACxF,MAAe,EACC,MAAe,EACf,QAAoF,EACpF,cAAuC,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tD,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,WAA8B;QACvD,MAAM,cAAc,GAAG,MAAM,kCAAgB,CAAC,cAAc,CACxD,IAAI,CAAC,YAAY,EACjB,EAAE,SAAS,EAAE,UAAU,EAAE,EACzB,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAChD,CAAC;QAEF,IAAI,QAAQ,IAAI,cAAc,EAAE;YAC5B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC;YAC3C,OAAO;gBACH,MAAM;gBACN,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,WAAW;aAClC,CAAC;SACL;aAAM;YACH,wGAAwG;YACxG,wDAAwD;YACxD,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC;YACxE,OAAO,cAAc,CAAC;SACzB;IACL,CAAC;CAEJ;AApSD,4CAoSC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert, LazyPromise } from \"@fluidframework/common-utils\";\nimport {\n IAudience,\n IContainerContext,\n IDeltaManager,\n ILoader,\n IRuntime,\n ICriticalContainerError,\n AttachState,\n ILoaderOptions,\n IRuntimeFactory,\n IProvideRuntimeFactory,\n IFluidCodeDetails,\n IFluidCodeDetailsComparer,\n IProvideFluidCodeDetailsComparer,\n ICodeDetailsLoader,\n IFluidModuleWithDetails,\n ISnapshotTreeWithBlobContents,\n} from \"@fluidframework/container-definitions\";\nimport {\n IRequest,\n IResponse,\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { isFluidResolvedUrl } from \"@fluidframework/driver-utils\";\nimport {\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n IQuorum,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISignalMessage,\n ISnapshotTree,\n ISummaryTree,\n IVersion,\n MessageType,\n} from \"@fluidframework/protocol-definitions\";\nimport { PerformanceEvent } from \"@fluidframework/telemetry-utils\";\nimport { Container } from \"./container\";\n\nconst PackageNotFactoryError = \"Code package does not implement IRuntimeFactory\";\n\nexport class ContainerContext implements IContainerContext {\n public static async createOrLoad(\n container: Container,\n scope: FluidObject,\n codeLoader: ICodeDetailsLoader,\n codeDetails: IFluidCodeDetails,\n baseSnapshot: ISnapshotTree | undefined,\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n quorum: IQuorum,\n loader: ILoader,\n submitFn: (type: MessageType, contents: any, batch: boolean, appData: any) => number,\n submitSignalFn: (contents: any) => void,\n closeFn: (error?: ICriticalContainerError) => void,\n version: string,\n updateDirtyContainerState: (dirty: boolean) => void,\n existing: boolean,\n pendingLocalState?: unknown,\n ): Promise<ContainerContext> {\n const context = new ContainerContext(\n container,\n scope,\n codeLoader,\n codeDetails,\n baseSnapshot,\n deltaManager,\n quorum,\n loader,\n submitFn,\n submitSignalFn,\n closeFn,\n version,\n updateDirtyContainerState,\n existing,\n pendingLocalState);\n await context.instantiateRuntime(existing);\n return context;\n }\n\n public readonly taggedLogger: ITelemetryLogger;\n\n public get clientId(): string | undefined {\n return this.container.clientId;\n }\n\n /**\n * DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.\n */\n public get id(): string {\n const resolvedUrl = this.container.resolvedUrl;\n if (isFluidResolvedUrl(resolvedUrl)) {\n return resolvedUrl.id;\n }\n return \"\";\n }\n\n public get clientDetails(): IClientDetails {\n return this.container.clientDetails;\n }\n\n public get connected(): boolean {\n return this.container.connected;\n }\n\n public get canSummarize(): boolean {\n return \"summarize\" in this.runtime;\n }\n\n public get serviceConfiguration(): IClientConfiguration | undefined {\n return this.container.serviceConfiguration;\n }\n\n public get audience(): IAudience {\n return this.container.audience;\n }\n\n public get options(): ILoaderOptions {\n return this.container.options;\n }\n\n public get baseSnapshot() {\n return this._baseSnapshot;\n }\n\n public get storage(): IDocumentStorageService {\n return this.container.storage;\n }\n\n private _runtime: IRuntime | undefined;\n private get runtime() {\n if (this._runtime === undefined) {\n throw new Error(\"Attempted to access runtime before it was defined\");\n }\n return this._runtime;\n }\n\n private _disposed = false;\n\n public get disposed() {\n return this._disposed;\n }\n\n public get codeDetails() { return this._codeDetails; }\n\n private readonly _quorum: IQuorum;\n public get quorum(): IQuorumClients { return this._quorum; }\n\n private readonly _fluidModuleP: Promise<IFluidModuleWithDetails>;\n\n constructor(\n private readonly container: Container,\n public readonly scope: FluidObject,\n private readonly codeLoader: ICodeDetailsLoader,\n private readonly _codeDetails: IFluidCodeDetails,\n private _baseSnapshot: ISnapshotTree | undefined,\n public readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n quorum: IQuorum,\n public readonly loader: ILoader,\n public readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData: any) => number,\n public readonly submitSignalFn: (contents: any) => void,\n public readonly closeFn: (error?: ICriticalContainerError) => void,\n public readonly version: string,\n public readonly updateDirtyContainerState: (dirty: boolean) => void,\n public readonly existing: boolean,\n public readonly pendingLocalState?: unknown,\n\n ) {\n this._quorum = quorum;\n this.taggedLogger = container.subLogger;\n this._fluidModuleP = new LazyPromise<IFluidModuleWithDetails>(\n async () => this.loadCodeModule(_codeDetails),\n );\n this.attachListener();\n }\n\n /**\n * @deprecated - Temporary migratory API, to be removed when customers no longer need it. When removed,\n * ContainerContext should only take an IQuorumClients rather than an IQuorum. See IContainerContext for more\n * details.\n */\n public getSpecifiedCodeDetails(): IFluidCodeDetails | undefined {\n return (this._quorum.get(\"code\") ?? this._quorum.get(\"code2\")) as IFluidCodeDetails | undefined;\n }\n\n public dispose(error?: Error): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n\n this.runtime.dispose(error);\n this._quorum.dispose();\n this.deltaManager.dispose();\n }\n\n public getLoadedFromVersion(): IVersion | undefined {\n return this.container.loadedFromVersion;\n }\n\n public get attachState(): AttachState {\n return this.container.attachState;\n }\n\n /**\n * Create a summary. Used when attaching or serializing a detached container.\n *\n * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported\n * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the\n * new storage IDs so requests can be redirected.\n */\n public createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree {\n return this.runtime.createSummary(blobRedirectTable);\n }\n\n public setConnectionState(connected: boolean, clientId?: string) {\n const runtime = this.runtime;\n\n assert(connected === this.connected, 0x0de /* \"Mismatch in connection state while setting\" */);\n\n runtime.setConnectionState(connected, clientId);\n }\n\n public process(message: ISequencedDocumentMessage, local: boolean, context: any) {\n this.runtime.process(message, local, context);\n }\n\n public processSignal(message: ISignalMessage, local: boolean) {\n this.runtime.processSignal(message, local);\n }\n\n public async request(path: IRequest): Promise<IResponse> {\n return this.runtime.request(path);\n }\n\n public async getAbsoluteUrl(relativeUrl: string): Promise<string | undefined> {\n return this.container.getAbsoluteUrl(relativeUrl);\n }\n\n public getPendingLocalState(): unknown {\n return this.runtime.getPendingLocalState();\n }\n\n /**\n * Determines if the current code details of the context\n * satisfy the incoming constraint code details\n */\n public async satisfies(constraintCodeDetails: IFluidCodeDetails) {\n const comparers: IFluidCodeDetailsComparer[] = [];\n\n const maybeCompareCodeLoader = this.codeLoader;\n if (maybeCompareCodeLoader.IFluidCodeDetailsComparer !== undefined) {\n comparers.push(maybeCompareCodeLoader.IFluidCodeDetailsComparer);\n }\n\n const moduleWithDetails = await this._fluidModuleP;\n const maybeCompareExport: Partial<IProvideFluidCodeDetailsComparer> | undefined =\n moduleWithDetails.module?.fluidExport;\n if (maybeCompareExport?.IFluidCodeDetailsComparer !== undefined) {\n comparers.push(maybeCompareExport.IFluidCodeDetailsComparer);\n }\n\n // if there are not comparers it is not possible to know\n // if the current satisfy the incoming, so return false,\n // as assuming they do not satisfy is safer .e.g we will\n // reload, rather than potentially running with\n // incompatible code\n if (comparers.length === 0) {\n return false;\n }\n\n for (const comparer of comparers) {\n const satisfies = await comparer.satisfies(\n moduleWithDetails.details,\n constraintCodeDetails,\n );\n if (satisfies === false) {\n return false;\n }\n }\n return true;\n }\n\n public notifyAttaching(snapshot: ISnapshotTreeWithBlobContents) {\n this._baseSnapshot = snapshot;\n this.runtime.notifyAttaching?.(snapshot);\n this.runtime.setAttachState(AttachState.Attaching);\n }\n\n // #region private\n\n private async getRuntimeFactory(): Promise<IRuntimeFactory> {\n const fluidExport: FluidObject<IProvideRuntimeFactory> | undefined =\n (await this._fluidModuleP).module?.fluidExport;\n const runtimeFactory = fluidExport?.IRuntimeFactory;\n if (runtimeFactory === undefined) {\n throw new Error(PackageNotFactoryError);\n }\n\n return runtimeFactory;\n }\n\n private async instantiateRuntime(existing: boolean) {\n const runtimeFactory = await this.getRuntimeFactory();\n this._runtime = await runtimeFactory.instantiateRuntime(this, existing);\n }\n\n private attachListener() {\n this.container.once(\"attached\", () => {\n this.runtime.setAttachState(AttachState.Attached);\n });\n }\n\n private async loadCodeModule(codeDetails: IFluidCodeDetails): Promise<IFluidModuleWithDetails> {\n const loadCodeResult = await PerformanceEvent.timedExecAsync(\n this.taggedLogger,\n { eventName: \"CodeLoad\" },\n async () => this.codeLoader.load(codeDetails),\n );\n\n if (\"module\" in loadCodeResult) {\n const { module, details } = loadCodeResult;\n return {\n module,\n details: details ?? codeDetails,\n };\n } else {\n // If \"module\" is not in the result, we are using a legacy ICodeLoader. Fix the result up with details.\n // Once usage drops to 0 we can remove this compat path.\n this.taggedLogger.sendTelemetryEvent({ eventName: \"LegacyCodeLoader\" });\n return loadCodeResult;\n }\n }\n // #endregion\n}\n"]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
6
|
+
import { ISnapshotTreeWithBlobContents } from "@fluidframework/container-definitions";
|
|
6
7
|
import { IDocumentStorageService, IDocumentStorageServicePolicies, ISummaryContext } from "@fluidframework/driver-definitions";
|
|
7
|
-
import { ICreateBlobResponse, ISnapshotTree, ISummaryHandle, ISummaryTree,
|
|
8
|
+
import { ICreateBlobResponse, ISnapshotTree, ISummaryHandle, ISummaryTree, IVersion } from "@fluidframework/protocol-definitions";
|
|
8
9
|
import { IDetachedBlobStorage } from "./loader";
|
|
9
|
-
import { ISnapshotTreeWithBlobContents } from "./utils";
|
|
10
10
|
/**
|
|
11
11
|
* This class wraps the actual storage and make sure no wrong apis are called according to
|
|
12
12
|
* container attach state.
|
|
@@ -22,7 +22,6 @@ export declare class ContainerStorageAdapter implements IDocumentStorageService
|
|
|
22
22
|
getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
|
|
23
23
|
readBlob(id: string): Promise<ArrayBufferLike>;
|
|
24
24
|
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
25
|
-
write(tree: ITree, parents: string[], message: string, ref: string): Promise<IVersion>;
|
|
26
25
|
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
27
26
|
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
|
|
28
27
|
createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerStorageAdapter.d.ts","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACH,uBAAuB,EACvB,+BAA+B,EAC/B,eAAe,EAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACH,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"containerStorageAdapter.d.ts","sourceRoot":"","sources":["../src/containerStorageAd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YAAW,uBAAuB;IAEvD,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,WAAW,EAAE,oBAAoB,EACjC,MAAM,EAAE,gBAAgB;IAGhC,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAIlE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI/D,IAAW,QAAQ,IAAI,+BAA+B,GAAG,SAAS,CAEjE;IAED,IAAW,aAAa,IAAI,MAAM,CAEjC;IAGM,eAAe,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAkB;IACtE,WAAW,EAAE,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAkB;IACxD,KAAK,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAkB;IAChD,wBAAwB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAkB;IACjE,eAAe,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAkB;IAGrE,OAAO,CAAC,SAAS;CASpB"}
|
|
@@ -50,9 +50,6 @@ class ContainerStorageAdapter {
|
|
|
50
50
|
async getVersions(versionId, count) {
|
|
51
51
|
return this.storageGetter().getVersions(versionId, count);
|
|
52
52
|
}
|
|
53
|
-
async write(tree, parents, message, ref) {
|
|
54
|
-
return this.storageGetter().write(tree, parents, message, ref);
|
|
55
|
-
}
|
|
56
53
|
async uploadSummaryWithContext(summary, context) {
|
|
57
54
|
return this.storageGetter().uploadSummaryWithContext(summary, context);
|
|
58
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerStorageAdapter.js","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"containerStorageAdapter.js","sourceRoot":"","sources":["../src/containerStorageAdapter.ts"],"names":[],"mappings":";AAAA;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,IAAI,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAQD,qDAAqD;IAE7C,SAAS;QACb,IAAI;YACA,kEAAkE;YAClE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;SAClE;QAAC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,EAAE,GAAG,CAAC,CAAC;YAC3E,MAAM,GAAG,CAAC;SACb;IACL,CAAC;CACJ;AAvCD,0CAuCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { ISnapshotTreeWithBlobContents } from \"@fluidframework/container-definitions\";\nimport {\n IDocumentStorageService,\n IDocumentStorageServicePolicies,\n ISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport {\n ICreateBlobResponse,\n ISnapshotTree,\n ISummaryHandle,\n ISummaryTree,\n IVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IDetachedBlobStorage } from \"./loader\";\n\n/**\n * This class wraps the actual storage and make sure no wrong apis are called according to\n * container attach state.\n */\nexport class ContainerStorageAdapter implements IDocumentStorageService {\n private readonly blobContents: { [id: string]: ArrayBufferLike; } = {};\n constructor(private readonly storageGetter: () => IDocumentStorageService) {}\n\n public loadSnapshotForRehydratingContainer(snapshotTree: ISnapshotTreeWithBlobContents) {\n this.getBlobContents(snapshotTree);\n }\n\n private getBlobContents(snapshotTree: ISnapshotTreeWithBlobContents) {\n for (const [id, value] of Object.entries(snapshotTree.blobsContents)) {\n this.blobContents[id] = value;\n }\n for (const [_, tree] of Object.entries(snapshotTree.trees)) {\n this.getBlobContents(tree);\n }\n }\n\n public get policies(): IDocumentStorageServicePolicies | undefined {\n // back-compat 0.40 containerRuntime requests policies even in detached container if storage is present\n // and storage is always present in >=0.41.\n try {\n return this.storageGetter().policies;\n } catch (e) {}\n return undefined;\n }\n\n public get repositoryUrl(): string {\n return this.storageGetter().repositoryUrl;\n }\n\n public async getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null> {\n return this.storageGetter().getSnapshotTree(version);\n }\n\n public async readBlob(id: string): Promise<ArrayBufferLike> {\n const blob = this.blobContents[id];\n if (blob !== undefined) {\n return blob;\n }\n return this.storageGetter().readBlob(id);\n }\n\n public async getVersions(versionId: string | null, count: number): Promise<IVersion[]> {\n return this.storageGetter().getVersions(versionId, count);\n }\n\n public async uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string> {\n return this.storageGetter().uploadSummaryWithContext(summary, context);\n }\n\n public async downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree> {\n return this.storageGetter().downloadSummary(handle);\n }\n\n public async createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse> {\n return this.storageGetter().createBlob(file);\n }\n}\n\n/**\n * Storage which only supports createBlob() and readBlob(). This is used with IDetachedBlobStorage to support\n * blobs in detached containers.\n */\nexport class BlobOnlyStorage implements IDocumentStorageService {\n constructor(\n private readonly blobStorage: IDetachedBlobStorage,\n private readonly logger: ITelemetryLogger,\n ) { }\n\n public async createBlob(content: ArrayBufferLike): Promise<ICreateBlobResponse> {\n return this.blobStorage.createBlob(content);\n }\n\n public async readBlob(blobId: string): Promise<ArrayBufferLike> {\n return this.blobStorage.readBlob(blobId);\n }\n\n public get policies(): IDocumentStorageServicePolicies | undefined {\n return this.notCalled();\n }\n\n public get repositoryUrl(): string {\n return this.notCalled();\n }\n\n /* eslint-disable @typescript-eslint/unbound-method */\n public getSnapshotTree: () => Promise<ISnapshotTree | null> = this.notCalled;\n public getVersions: () => Promise<IVersion[]> = this.notCalled;\n public write: () => Promise<IVersion> = this.notCalled;\n public uploadSummaryWithContext: () => Promise<string> = this.notCalled;\n public downloadSummary: () => Promise<ISummaryTree> = this.notCalled;\n /* eslint-enable @typescript-eslint/unbound-method */\n\n private notCalled(): never {\n try {\n // some browsers may not populate stack unless exception is thrown\n throw new Error(\"BlobOnlyStorage not implemented method used\");\n } catch (err) {\n this.logger.sendErrorEvent({ eventName: \"BlobOnlyStorageWrongCall\" }, err);\n throw err;\n }\n }\n}\n"]}
|
|
@@ -45,7 +45,6 @@ export declare class DeltaManagerProxy extends EventForwarder<IDeltaManagerEvent
|
|
|
45
45
|
get readOnlyInfo(): ReadOnlyInfo;
|
|
46
46
|
constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>);
|
|
47
47
|
dispose(): void;
|
|
48
|
-
close(): void;
|
|
49
48
|
submitSignal(content: any): void;
|
|
50
49
|
flush(): void;
|
|
51
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltaManagerProxy.d.ts","sourceRoot":"","sources":["../src/deltaManagerProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACjB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAE,YAAW,WAAW,CAAC,CAAC,CAAC;IAatF,OAAO,CAAC,QAAQ,CAAC,KAAK;IAZlC,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,IAAI,IAAI,OAAO,CAEzB;gBAE4B,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAI3C,IAAI,IAAI,CAAC,GAAG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W,qBAAqB,IAAI,MAAM,CAEzC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAED,IAAW,WAAW,0CAErB;IAED,IAAW,kBAAkB,WAE5B;IAED,IAAW,qBAAqB,IAAI,MAAM,CAEzC;IAED,IAAW,2BAA2B,YAErC;IAED,IAAW,aAAa,IAAI,cAAc,CAEzC;IAED,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,cAAc,IAAI,MAAM,CAElC;IAED,IAAW,oBAAoB,IAAI,oBAAoB,GAAG,SAAS,CAElE;IAED,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,YAAY,IAAI,YAAY,CAEtC;gBAE4B,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAQ9F,OAAO,IAAI,IAAI;IAOf,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAIhC,KAAK,IAAI,IAAI;CAGvB"}
|
|
@@ -104,9 +104,6 @@ class DeltaManagerProxy extends common_utils_1.EventForwarder {
|
|
|
104
104
|
this.inboundSignal.dispose();
|
|
105
105
|
super.dispose();
|
|
106
106
|
}
|
|
107
|
-
close() {
|
|
108
|
-
return this.deltaManager.close();
|
|
109
|
-
}
|
|
110
107
|
submitSignal(content) {
|
|
111
108
|
return this.deltaManager.submitSignal(content);
|
|
112
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltaManagerProxy.js","sourceRoot":"","sources":["../src/deltaManagerProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,+DAA8D;AAS9D;;GAEG;AACH,MAAa,eAAmB,SAAQ,6BAAoC;IAaxE,YAA6B,KAAqB;QAC9C,KAAK,CAAC,KAAK,CAAC,CAAC;QADY,UAAK,GAAL,KAAK,CAAgB;IAElD,CAAC;IAdD,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,IAAW,MAAM;QACb,OAA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AAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QAC7B,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IAEM,YAAY,CAAC,OAAY;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK;QACR,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;CACJ;AAjFD,8CAiFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IDeltaManager,\n IDeltaManagerEvents,\n IDeltaQueue,\n IDeltaSender,\n IDeltaQueueEvents,\n ReadOnlyInfo,\n} from \"@fluidframework/container-definitions\";\nimport { EventForwarder } from \"@fluidframework/common-utils\";\nimport {\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalMessage,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Proxy to the real IDeltaQueue - used to restrict access\n */\nexport class DeltaQueueProxy<T> extends EventForwarder<IDeltaQueueEvents<T>> implements IDeltaQueue<T> {\n public get paused(): boolean {\n return this.queue.paused;\n }\n\n public get length(): number {\n return this.queue.length;\n }\n\n public get idle(): boolean {\n return this.queue.idle;\n }\n\n constructor(private readonly queue: IDeltaQueue<T>) {\n super(queue);\n }\n\n public peek(): T | undefined {\n return this.queue.peek();\n }\n\n public toArray(): T[] {\n return this.queue.toArray();\n }\n\n // back-compat: usage removed in 0.33, remove in future versions\n public async systemPause(): Promise<void> {\n return this.pause();\n }\n\n public async pause(): Promise<void> {\n return this.queue.pause();\n }\n\n // back-compat: usage removed in 0.33, remove in future versions\n public async systemResume(): Promise<void> {\n return this.resume();\n }\n\n public async resume(): Promise<void> {\n this.queue.resume();\n }\n\n public async waitTillProcessingDone() {\n return this.queue.waitTillProcessingDone();\n }\n}\n\n/**\n * Proxy to the real IDeltaManager - used to restrict access\n */\nexport class DeltaManagerProxy\n extends EventForwarder<IDeltaManagerEvents>\n implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {\n public readonly inbound: IDeltaQueue<ISequencedDocumentMessage>;\n public readonly outbound: IDeltaQueue<IDocumentMessage[]>;\n public readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n public get IDeltaSender(): IDeltaSender {\n return this;\n }\n\n public get minimumSequenceNumber(): number {\n return this.deltaManager.minimumSequenceNumber;\n }\n\n public get lastSequenceNumber(): number {\n return this.deltaManager.lastSequenceNumber;\n }\n\n public get lastMessage() {\n return this.deltaManager.lastMessage;\n }\n\n public get lastKnownSeqNumber() {\n return this.deltaManager.lastKnownSeqNumber;\n }\n\n public get initialSequenceNumber(): number {\n return this.deltaManager.initialSequenceNumber;\n }\n\n public get hasCheckpointSequenceNumber() {\n return this.deltaManager.hasCheckpointSequenceNumber;\n }\n\n public get clientDetails(): IClientDetails {\n return this.deltaManager.clientDetails;\n }\n\n public get version(): string {\n return this.deltaManager.version;\n }\n\n public get maxMessageSize(): number {\n return this.deltaManager.maxMessageSize;\n }\n\n public get serviceConfiguration(): IClientConfiguration | undefined {\n return this.deltaManager.serviceConfiguration;\n }\n\n public get active(): boolean {\n return this.deltaManager.active;\n }\n\n public get readOnlyInfo(): ReadOnlyInfo {\n return this.deltaManager.readOnlyInfo;\n }\n\n constructor(private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {\n super(deltaManager);\n\n this.inbound = new DeltaQueueProxy(deltaManager.inbound);\n this.outbound = new DeltaQueueProxy(deltaManager.outbound);\n this.inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);\n }\n\n public dispose(): void {\n this.inbound.dispose();\n this.outbound.dispose();\n this.inboundSignal.dispose();\n super.dispose();\n }\n\n public submitSignal(content: any): void {\n return this.deltaManager.submitSignal(content);\n }\n\n public flush(): void {\n return this.deltaManager.flush();\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { ConnectionState } from "./connectionState";
|
|
6
|
-
export { Container, IContainerLoadOptions, IContainerConfig, waitContainerToCatchUp, } from "./container";
|
|
6
|
+
export { Container, IContainerLoadOptions, IContainerConfig, IPendingContainerState, waitContainerToCatchUp, } from "./container";
|
|
7
7
|
export { ICodeDetailsLoader, IDetachedBlobStorage, IFluidModuleWithDetails, ILoaderOptions, ILoaderProps, ILoaderServices, Loader, RelativeLoader, } from "./loader";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACH,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,MAAM,EACN,cAAc,GACjB,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACH,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,MAAM,EACN,cAAc,GACjB,MAAM,UAAU,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,yCAMqB;AALjB,sGAAA,SAAS,OAAA;AAIT,mHAAA,sBAAsB,OAAA;AAE1B,mCASkB;AAFd,gGAAA,MAAM,OAAA;AACN,wGAAA,cAAc,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState\";\nexport {\n Container,\n IContainerLoadOptions,\n IContainerConfig,\n IPendingContainerState,\n waitContainerToCatchUp,\n} from \"./container\";\nexport {\n ICodeDetailsLoader,\n IDetachedBlobStorage,\n IFluidModuleWithDetails,\n ILoaderOptions,\n ILoaderProps,\n ILoaderServices,\n Loader,\n RelativeLoader,\n} from \"./loader\";\n"]}
|
package/dist/loader.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ITelemetryBaseLogger, ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
6
6
|
import { FluidObject, IFluidRouter, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { IContainer, IFluidModule, IHostLoader, ILoader, ILoaderOptions as ILoaderOptions1,
|
|
7
|
+
import { IContainer, IFluidModule, IHostLoader, ILoader, ILoaderOptions as ILoaderOptions1, IProvideFluidCodeDetailsComparer, IFluidCodeDetails } from "@fluidframework/container-definitions";
|
|
8
8
|
import { IConfigProviderBase } from "@fluidframework/telemetry-utils";
|
|
9
9
|
import { IDocumentServiceFactory, IDocumentStorageService, IUrlResolver } from "@fluidframework/driver-definitions";
|
|
10
10
|
import { Container } from "./container";
|
|
@@ -81,12 +81,6 @@ export interface ILoaderProps {
|
|
|
81
81
|
* services for container's to integrate with their host environment.
|
|
82
82
|
*/
|
|
83
83
|
readonly scope?: FluidObject;
|
|
84
|
-
/**
|
|
85
|
-
* Proxy loader factories for loading containers via proxy in other contexts,
|
|
86
|
-
* like web workers, or worker threads.
|
|
87
|
-
* @deprecated Not recommended for general use and will be removed in an upcoming release.
|
|
88
|
-
*/
|
|
89
|
-
readonly proxyLoaderFactories?: Map<string, IProxyLoaderFactory>;
|
|
90
84
|
/**
|
|
91
85
|
* The logger that all telemetry should be pushed to.
|
|
92
86
|
*/
|
|
@@ -131,12 +125,6 @@ export interface ILoaderServices {
|
|
|
131
125
|
* services for container's to integrate with their host environment.
|
|
132
126
|
*/
|
|
133
127
|
readonly scope: FluidObject;
|
|
134
|
-
/**
|
|
135
|
-
* Proxy loader factories for loading containers via proxy in other contexts,
|
|
136
|
-
* like web workers, or worker threads.
|
|
137
|
-
* @deprecated Not recommended for general use and will be removed in an upcoming release.
|
|
138
|
-
*/
|
|
139
|
-
readonly proxyLoaderFactories: Map<string, IProxyLoaderFactory>;
|
|
140
128
|
/**
|
|
141
129
|
* The logger downstream consumers should construct their loggers from
|
|
142
130
|
*/
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EACH,WAAW,EACX,YAAY,EACZ,QAAQ,EAER,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names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AO,YAAW,WAAW;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyC;IACpE,SAAgB,QAAQ,EAAE,eAAe,CAAC;IAC1C,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;gBAE3B,WAAW,EAAE,YAAY;IA6BrC,IAAW,YAAY,IAAI,YAAY,CAAiB;IAE3C,uBAAuB,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC;IAmB5E,sCAAsC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI7E,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAW3E,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAU3D,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,mBAAmB;YAcb,WAAW;IA+DzB,OAAO,KAAK,cAAc,GAEzB;IAED,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,WAAW;YAqBL,aAAa;CAiB9B"}
|
package/dist/loader.js
CHANGED
|
@@ -83,7 +83,7 @@ function createCachedResolver(resolver) {
|
|
|
83
83
|
*/
|
|
84
84
|
class Loader {
|
|
85
85
|
constructor(loaderProps) {
|
|
86
|
-
var _a, _b
|
|
86
|
+
var _a, _b;
|
|
87
87
|
this.containers = new Map();
|
|
88
88
|
const scope = Object.assign({}, loaderProps.scope);
|
|
89
89
|
if (((_a = loaderProps.options) === null || _a === void 0 ? void 0 : _a.provideScopeLoader) !== false) {
|
|
@@ -101,7 +101,6 @@ class Loader {
|
|
|
101
101
|
options: (_b = loaderProps.options) !== null && _b !== void 0 ? _b : {},
|
|
102
102
|
scope,
|
|
103
103
|
subLogger: subMc.logger,
|
|
104
|
-
proxyLoaderFactories: (_c = loaderProps.proxyLoaderFactories) !== null && _c !== void 0 ? _c : new Map(),
|
|
105
104
|
detachedBlobStorage: loaderProps.detachedBlobStorage,
|
|
106
105
|
};
|
|
107
106
|
this.mc = (0, telemetry_utils_1.loggerToMonitoringContext)(telemetry_utils_1.ChildLogger.create(this.services.subLogger, "Loader"));
|
|
@@ -190,7 +189,7 @@ class Loader {
|
|
|
190
189
|
}
|
|
191
190
|
else {
|
|
192
191
|
container =
|
|
193
|
-
await this.loadContainer(request, resolvedAsFluid, pendingLocalState
|
|
192
|
+
await this.loadContainer(request, resolvedAsFluid, pendingLocalState);
|
|
194
193
|
}
|
|
195
194
|
if (container.deltaManager.lastSequenceNumber <= fromSequenceNumber) {
|
|
196
195
|
await new Promise((resolve, reject) => {
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AASlC,iFAW+C;AAC/C,qEASyC;AASzC,+DAIsC;AACtC,2CAAwC;AACxC,mCAA+C;AAC/C,qDAA8C;AAE9C,SAAS,WAAW,CAAC,OAAiB;IAClC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QAC/B,OAAO,IAAI,CAAC;KACf;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,oCAAY,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AACzD,CAAC;AAED,MAAa,cAAc;IACvB,YACqB,SAAoB,EACpB,MAA2B;QAD3B,cAAS,GAAT,SAAS,CAAW;QACpB,WAAM,GAAN,MAAM,CAAqB;IAEhD,CAAC;IAED,IAAW,YAAY,KAAmB,OAAO,IAAI,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,OAAiB;;QAClC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAC7B,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE;gBACtB,OAAO,IAAI,CAAC,SAAS,CAAC;aACzB;iBAAM;gBACH,MAAM,WAAW,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AO,CAAC,CAAC;QAEhG,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE1D,OAAO;YACH,QAAQ;YACR,kBAAkB;SACrB,CAAC;IACN,CAAC;IAEO,KAAK,CAAC,aAAa,CACvB,OAAiB,EACjB,QAA2B,EAC3B,iBAA2B;;QAE3B,OAAO,qBAAS,CAAC,IAAI,CACjB,IAAI,EACJ;YACI,YAAY,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAG,oCAAY,CAAC,SAAS,CAAC;YACvD,qBAAqB,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAG,oCAAY,CAAC,aAAa,CAAC;YACpE,WAAW,EAAE,QAAQ;YACrB,OAAO,EAAE,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAG,oCAAY,CAAC,OAAO,CAAC,mCAAI,SAAS;YAC7D,QAAQ,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAG,oCAAY,CAAC,QAAQ,CAAC;SACrD,EACD,iBAAiB,CACpB,CAAC;IACN,CAAC;CACJ;AAnND,wBAmNC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport { ITelemetryBaseLogger, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport {\n FluidObject,\n IFluidRouter,\n IRequest,\n IRequestHeader,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IContainer,\n IFluidModule,\n IHostLoader,\n ILoader,\n IPendingLocalState,\n ILoaderOptions as ILoaderOptions1,\n IProxyLoaderFactory,\n LoaderHeader,\n IProvideFluidCodeDetailsComparer,\n IFluidCodeDetails,\n} from \"@fluidframework/container-definitions\";\nimport {\n ChildLogger,\n DebugLogger,\n IConfigProviderBase,\n loggerToMonitoringContext,\n mixinMonitoringContext,\n MonitoringContext,\n PerformanceEvent,\n sessionStorageConfigProvider,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n IDocumentServiceFactory,\n IDocumentStorageService,\n IFluidResolvedUrl,\n IResolvedUrl,\n IUrlResolver,\n} from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n ensureFluidResolvedUrl,\n MultiUrlResolver,\n MultiDocumentServiceFactory,\n} from \"@fluidframework/driver-utils\";\nimport { Container } from \"./container\";\nimport { IParsedUrl, parseUrl } from \"./utils\";\nimport { pkgVersion } from \"./packageVersion\";\n\nfunction canUseCache(request: IRequest): boolean {\n if (request.headers === undefined) {\n return true;\n }\n\n return request.headers[LoaderHeader.cache] !== false;\n}\n\nexport class RelativeLoader implements ILoader {\n constructor(\n private readonly container: Container,\n private readonly loader: ILoader | undefined,\n ) {\n }\n\n public get IFluidRouter(): IFluidRouter { return this; }\n\n public async resolve(request: IRequest): Promise<IContainer> {\n if (request.url.startsWith(\"/\")) {\n if (canUseCache(request)) {\n return this.container;\n } else {\n const resolvedUrl = this.container.resolvedUrl;\n ensureFluidResolvedUrl(resolvedUrl);\n const container = await Container.load(\n this.loader as Loader,\n {\n canReconnect: request.headers?.[LoaderHeader.reconnect],\n clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],\n resolvedUrl: { ...resolvedUrl },\n version: request.headers?.[LoaderHeader.version] ?? undefined,\n loadMode: request.headers?.[LoaderHeader.loadMode],\n },\n );\n return container;\n }\n }\n\n if (this.loader === undefined) {\n throw new Error(\"Cannot resolve external containers\");\n }\n return this.loader.resolve(request);\n }\n\n public async request(request: IRequest): Promise<IResponse> {\n if (request.url.startsWith(\"/\")) {\n const container = await this.resolve(request);\n return container.request(request);\n }\n\n if (this.loader === undefined) {\n return {\n status: 404,\n value: \"Cannot request external containers\",\n mimeType: \"plain/text\",\n };\n }\n return this.loader.request(request);\n }\n}\n\nfunction createCachedResolver(resolver: IUrlResolver) {\n const cacheResolver = Object.create(resolver) as IUrlResolver;\n const resolveCache = new Map<string, Promise<IResolvedUrl | undefined>>();\n cacheResolver.resolve = async (request: IRequest): Promise<IResolvedUrl | undefined> => {\n if (!canUseCache(request)) {\n return resolver.resolve(request);\n }\n if (!resolveCache.has(request.url)) {\n resolveCache.set(request.url, resolver.resolve(request));\n }\n\n return resolveCache.get(request.url);\n };\n return cacheResolver;\n}\n\nexport interface ILoaderOptions extends ILoaderOptions1 {\n summarizeProtocolTree?: boolean;\n}\n\n/**\n * @deprecated IFluidModuleWithDetails interface is moved to\n * {@link @fluidframework/container-definition#IFluidModuleWithDetails}\n * to have all the code loading modules in one package. #8193\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */\n module: IFluidModule;\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,\n * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * @deprecated ICodeDetailsLoader interface is moved to {@link @fluidframework/container-definition#ICodeDetailsLoader}\n * to have code loading modules in one package. #8193\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that is capable to interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * Services and properties necessary for creating a loader\n */\nexport interface ILoaderProps {\n /**\n * The url resolver used by the loader for resolving external urls\n * into Fluid urls such that the container specified by the\n * external url can be loaded.\n */\n readonly urlResolver: IUrlResolver;\n /**\n * The document service factory take the Fluid url provided\n * by the resolved url and constructs all the necessary services\n * for communication with the container's server.\n */\n readonly documentServiceFactory: IDocumentServiceFactory;\n /**\n * The code loader handles loading the necessary code\n * for running a container once it is loaded.\n */\n readonly codeLoader: ICodeDetailsLoader;\n\n /**\n * A property bag of options used by various layers\n * to control features\n */\n readonly options?: ILoaderOptions;\n\n /**\n * Scope is provided to all container and is a set of shared\n * services for container's to integrate with their host environment.\n */\n readonly scope?: FluidObject;\n\n /**\n * Proxy loader factories for loading containers via proxy in other contexts,\n * like web workers, or worker threads.\n * @deprecated Not recommended for general use and will be removed in an upcoming release.\n */\n readonly proxyLoaderFactories?: Map<string, IProxyLoaderFactory>;\n\n /**\n * The logger that all telemetry should be pushed to.\n */\n readonly logger?: ITelemetryBaseLogger;\n\n /**\n * Blobs storage for detached containers.\n */\n readonly detachedBlobStorage?: IDetachedBlobStorage;\n\n /**\n * The configuration provider which may be used to control features.\n */\n readonly configProvider?: IConfigProviderBase;\n}\n\n/**\n * Services and properties used by and exposed by the loader\n */\nexport interface ILoaderServices {\n /**\n * The url resolver used by the loader for resolving external urls\n * into Fluid urls such that the container specified by the\n * external url can be loaded.\n */\n readonly urlResolver: IUrlResolver;\n /**\n * The document service factory take the Fluid url provided\n * by the resolved url and constructs all the necessary services\n * for communication with the container's server.\n */\n readonly documentServiceFactory: IDocumentServiceFactory;\n /**\n * The code loader handles loading the necessary code\n * for running a container once it is loaded.\n */\n readonly codeLoader: ICodeDetailsLoader;\n\n /**\n * A property bag of options used by various layers\n * to control features\n */\n readonly options: ILoaderOptions;\n\n /**\n * Scope is provided to all container and is a set of shared\n * services for container's to integrate with their host environment.\n */\n readonly scope: FluidObject;\n\n /**\n * Proxy loader factories for loading containers via proxy in other contexts,\n * like web workers, or worker threads.\n * @deprecated Not recommended for general use and will be removed in an upcoming release.\n */\n readonly proxyLoaderFactories: Map<string, IProxyLoaderFactory>;\n\n /**\n * The logger downstream consumers should construct their loggers from\n */\n readonly subLogger: ITelemetryLogger;\n\n /**\n * Blobs storage for detached containers.\n */\n readonly detachedBlobStorage?: IDetachedBlobStorage;\n}\n\n/**\n * Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support\n * blobs in detached containers.\n */\nexport type IDetachedBlobStorage = Pick<IDocumentStorageService, \"createBlob\" | \"readBlob\"> & {\n size: number;\n /**\n * Return an array of all blob IDs present in storage\n */\n getBlobIds(): string[];\n };\n\n/**\n * Manages Fluid resource loading\n */\nexport class Loader implements IHostLoader {\n private readonly containers = new Map<string, Promise<Container>>();\n public readonly services: ILoaderServices;\n private readonly mc: MonitoringContext;\n\n constructor(loaderProps: ILoaderProps) {\n const scope: FluidObject<ILoader> = { ...loaderProps.scope };\n if (loaderProps.options?.provideScopeLoader !== false) {\n scope.ILoader = this;\n }\n const telemetryProps = {\n loaderId: uuid(),\n loaderVersion: pkgVersion,\n };\n\n const subMc = mixinMonitoringContext(\n DebugLogger.mixinDebugLogger(\"fluid:telemetry\", loaderProps.logger, { all: telemetryProps }),\n sessionStorageConfigProvider.value,\n loaderProps.configProvider,\n );\n\n this.services = {\n urlResolver: createCachedResolver(MultiUrlResolver.create(loaderProps.urlResolver)),\n documentServiceFactory: MultiDocumentServiceFactory.create(loaderProps.documentServiceFactory),\n codeLoader: loaderProps.codeLoader,\n options: loaderProps.options ?? {},\n scope,\n subLogger: subMc.logger,\n proxyLoaderFactories: loaderProps.proxyLoaderFactories ?? new Map<string, IProxyLoaderFactory>(),\n detachedBlobStorage: loaderProps.detachedBlobStorage,\n };\n this.mc = loggerToMonitoringContext(\n ChildLogger.create(this.services.subLogger, \"Loader\"));\n }\n\n public get IFluidRouter(): IFluidRouter { return this; }\n\n public async createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer> {\n const container = await Container.createDetached(\n this,\n codeDetails,\n );\n\n if (this.cachingEnabled) {\n container.once(\"attached\", () => {\n ensureFluidResolvedUrl(container.resolvedUrl);\n const parsedUrl = parseUrl(container.resolvedUrl.url);\n if (parsedUrl !== undefined) {\n this.addToContainerCache(parsedUrl.id, Promise.resolve(container));\n }\n });\n }\n\n return container;\n }\n\n public async rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer> {\n return Container.rehydrateDetachedFromSnapshot(this, snapshot);\n }\n\n public async resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer> {\n const eventName = pendingLocalState === undefined ? \"Resolve\" : \"ResolveWithPendingState\";\n return PerformanceEvent.timedExecAsync(this.mc.logger, { eventName }, async () => {\n const resolved = await this.resolveCore(\n request,\n pendingLocalState !== undefined ? JSON.parse(pendingLocalState) : undefined,\n );\n return resolved.container;\n });\n }\n\n public async request(request: IRequest): Promise<IResponse> {\n return PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: \"Request\" }, async () => {\n const resolved = await this.resolveCore(request);\n return resolved.container.request({\n ...request,\n url: `${resolved.parsed.path}${resolved.parsed.query}`,\n });\n });\n }\n\n private getKeyForContainerCache(request: IRequest, parsedUrl: IParsedUrl): string {\n const key = request.headers?.[LoaderHeader.version] !== undefined\n ? `${parsedUrl.id}@${request.headers[LoaderHeader.version]}`\n : parsedUrl.id;\n return key;\n }\n\n private addToContainerCache(key: string, containerP: Promise<Container>) {\n this.containers.set(key, containerP);\n containerP.then((container) => {\n // If the container is closed or becomes closed after we resolve it, remove it from the cache.\n if (container.closed) {\n this.containers.delete(key);\n } else {\n container.once(\"closed\", () => {\n this.containers.delete(key);\n });\n }\n }).catch((error) => {});\n }\n\n private async resolveCore(\n request: IRequest,\n pendingLocalState?: IPendingLocalState,\n ): Promise<{ container: Container; parsed: IParsedUrl; }> {\n const resolvedAsFluid = await this.services.urlResolver.resolve(request);\n ensureFluidResolvedUrl(resolvedAsFluid);\n\n // Parse URL into data stores\n const parsed = parseUrl(resolvedAsFluid.url);\n if (parsed === undefined) {\n throw new Error(`Invalid URL ${resolvedAsFluid.url}`);\n }\n\n if (pendingLocalState !== undefined) {\n const parsedPendingUrl = parseUrl(pendingLocalState.url);\n if (parsedPendingUrl?.id !== parsed.id ||\n parsedPendingUrl?.path.replace(/\\/$/, \"\") !== parsed.path.replace(/\\/$/, \"\")) {\n const message = `URL ${resolvedAsFluid.url} does not match pending state URL ${pendingLocalState.url}`;\n throw new Error(message);\n }\n }\n\n const { canCache, fromSequenceNumber } = this.parseHeader(parsed, request);\n const shouldCache = pendingLocalState !== undefined ? false : canCache;\n\n let container: Container;\n if (shouldCache) {\n const key = this.getKeyForContainerCache(request, parsed);\n const maybeContainer = await this.containers.get(key);\n if (maybeContainer !== undefined) {\n container = maybeContainer;\n } else {\n const containerP =\n this.loadContainer(\n request,\n resolvedAsFluid);\n this.addToContainerCache(key, containerP);\n container = await containerP;\n }\n } else {\n container =\n await this.loadContainer(\n request,\n resolvedAsFluid,\n pendingLocalState?.pendingRuntimeState);\n }\n\n if (container.deltaManager.lastSequenceNumber <= fromSequenceNumber) {\n await new Promise<void>((resolve, reject) => {\n function opHandler(message: ISequencedDocumentMessage) {\n if (message.sequenceNumber > fromSequenceNumber) {\n resolve();\n container.removeListener(\"op\", opHandler);\n }\n }\n\n container.on(\"op\", opHandler);\n });\n }\n\n return { container, parsed };\n }\n\n private get cachingEnabled() {\n return this.services.options.cache !== false;\n }\n\n private canCacheForRequest(headers: IRequestHeader): boolean {\n return this.cachingEnabled && headers[LoaderHeader.cache] !== false;\n }\n\n private parseHeader(parsed: IParsedUrl, request: IRequest) {\n let fromSequenceNumber = -1;\n\n request.headers = request.headers ?? {};\n\n const headerSeqNum = request.headers[LoaderHeader.sequenceNumber];\n if (headerSeqNum !== undefined) {\n fromSequenceNumber = headerSeqNum;\n }\n\n // If set in both query string and headers, use query string\n request.headers[LoaderHeader.version] = parsed.version ?? request.headers[LoaderHeader.version];\n\n const canCache = this.canCacheForRequest(request.headers);\n\n return {\n canCache,\n fromSequenceNumber,\n };\n }\n\n private async loadContainer(\n request: IRequest,\n resolved: IFluidResolvedUrl,\n pendingLocalState?: unknown,\n ): Promise<Container> {\n return Container.load(\n this,\n {\n canReconnect: request.headers?.[LoaderHeader.reconnect],\n clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],\n resolvedUrl: resolved,\n version: request.headers?.[LoaderHeader.version] ?? undefined,\n loadMode: request.headers?.[LoaderHeader.loadMode],\n },\n pendingLocalState,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAkC;AASlC,iFAS+C;AAC/C,qEASyC;AASzC,+DAIsC;AACtC,2CAAgE;AAChE,mCAA+C;AAC/C,qDAA8C;AAE9C,SAAS,WAAW,CAAC,OAAiB;IAClC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QAC/B,OAAO,IAAI,CAAC;KACf;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,oCAAY,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AACzD,CAAC;AAED,MAAa,cAAc;IACvB,YACqB,SAAoB,EACpB,MAA2B;QAD3B,cAAS,GAAT,SAAS,CAAW;QACpB,WAAM,GAAN,MAAM,CAAqB;IAEhD,CAAC;IAED,IAAW,YAAY,KAAmB,OAAO,IAAI,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,OAAiB;;QAClC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAC7B,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE;gBACtB,OAAO,IAAI,CAAC,SAAS,CAAC;aACzB;iBAAM;gBACH,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;gBAC/C,IAAA,qCAAsB,EAAC,WAAW,CAAC,CAAC;gBACpC,MAAM,SAAS,GAAG,MAAM,qBAAS,CAAC,IAAI,CAClC,IAAI,CAAC,MAAgB,EACrB;oBACI,YAAY,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAG,oCAAY,CAAC,SAAS,CAAC;oBACvD,qBAAqB,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAG,oCAAY,CAAC,aAAa,CAAC;oBACpE,WAAW,oBAAO,WAAW,CAAE;oBAC/B,OAAO,EAAE,MAAA,MAAA,OAA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AAY,CAAC,OAAO,CAAC,mCAAI,SAAS;YAC7D,QAAQ,EAAE,MAAA,OAAO,CAAC,OAAO,0CAAG,oCAAY,CAAC,QAAQ,CAAC;SACrD,EACD,iBAAiB,CACpB,CAAC;IACN,CAAC;CACJ;AAlND,wBAkNC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { v4 as uuid } from \"uuid\";\nimport { ITelemetryBaseLogger, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport {\n FluidObject,\n IFluidRouter,\n IRequest,\n IRequestHeader,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IContainer,\n IFluidModule,\n IHostLoader,\n ILoader,\n ILoaderOptions as ILoaderOptions1,\n LoaderHeader,\n IProvideFluidCodeDetailsComparer,\n IFluidCodeDetails,\n} from \"@fluidframework/container-definitions\";\nimport {\n ChildLogger,\n DebugLogger,\n IConfigProviderBase,\n loggerToMonitoringContext,\n mixinMonitoringContext,\n MonitoringContext,\n PerformanceEvent,\n sessionStorageConfigProvider,\n} from \"@fluidframework/telemetry-utils\";\nimport {\n IDocumentServiceFactory,\n IDocumentStorageService,\n IFluidResolvedUrl,\n IResolvedUrl,\n IUrlResolver,\n} from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n ensureFluidResolvedUrl,\n MultiUrlResolver,\n MultiDocumentServiceFactory,\n} from \"@fluidframework/driver-utils\";\nimport { Container, IPendingContainerState } from \"./container\";\nimport { IParsedUrl, parseUrl } from \"./utils\";\nimport { pkgVersion } from \"./packageVersion\";\n\nfunction canUseCache(request: IRequest): boolean {\n if (request.headers === undefined) {\n return true;\n }\n\n return request.headers[LoaderHeader.cache] !== false;\n}\n\nexport class RelativeLoader implements ILoader {\n constructor(\n private readonly container: Container,\n private readonly loader: ILoader | undefined,\n ) {\n }\n\n public get IFluidRouter(): IFluidRouter { return this; }\n\n public async resolve(request: IRequest): Promise<IContainer> {\n if (request.url.startsWith(\"/\")) {\n if (canUseCache(request)) {\n return this.container;\n } else {\n const resolvedUrl = this.container.resolvedUrl;\n ensureFluidResolvedUrl(resolvedUrl);\n const container = await Container.load(\n this.loader as Loader,\n {\n canReconnect: request.headers?.[LoaderHeader.reconnect],\n clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],\n resolvedUrl: { ...resolvedUrl },\n version: request.headers?.[LoaderHeader.version] ?? undefined,\n loadMode: request.headers?.[LoaderHeader.loadMode],\n },\n );\n return container;\n }\n }\n\n if (this.loader === undefined) {\n throw new Error(\"Cannot resolve external containers\");\n }\n return this.loader.resolve(request);\n }\n\n public async request(request: IRequest): Promise<IResponse> {\n if (request.url.startsWith(\"/\")) {\n const container = await this.resolve(request);\n return container.request(request);\n }\n\n if (this.loader === undefined) {\n return {\n status: 404,\n value: \"Cannot request external containers\",\n mimeType: \"plain/text\",\n };\n }\n return this.loader.request(request);\n }\n}\n\nfunction createCachedResolver(resolver: IUrlResolver) {\n const cacheResolver = Object.create(resolver) as IUrlResolver;\n const resolveCache = new Map<string, Promise<IResolvedUrl | undefined>>();\n cacheResolver.resolve = async (request: IRequest): Promise<IResolvedUrl | undefined> => {\n if (!canUseCache(request)) {\n return resolver.resolve(request);\n }\n if (!resolveCache.has(request.url)) {\n resolveCache.set(request.url, resolver.resolve(request));\n }\n\n return resolveCache.get(request.url);\n };\n return cacheResolver;\n}\n\nexport interface ILoaderOptions extends ILoaderOptions1 {\n summarizeProtocolTree?: boolean;\n}\n\n/**\n * @deprecated IFluidModuleWithDetails interface is moved to\n * {@link @fluidframework/container-definition#IFluidModuleWithDetails}\n * to have all the code loading modules in one package. #8193\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /** Fluid code module that implements the runtime factory needed to instantiate the container runtime. */\n module: IFluidModule;\n /**\n * Code details associated with the module. Represents a document schema this module supports.\n * If the code loader implements the {@link @fluidframework/core-interfaces#IFluidCodeDetailsComparer} interface,\n * it'll be called to determine whether the module code details satisfy the new code proposal in the quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\n * @deprecated ICodeDetailsLoader interface is moved to {@link @fluidframework/container-definition#ICodeDetailsLoader}\n * to have code loading modules in one package. #8193\n * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as\n * a package name and package version range.\n */\nexport interface ICodeDetailsLoader\n extends Partial<IProvideFluidCodeDetailsComparer> {\n /**\n * Load the code module (package) that is capable to interact with the document.\n *\n * @param source - Code proposal that articulates the current schema the document is written in.\n * @returns - Code module entry point along with the code details associated with it.\n */\n load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * Services and properties necessary for creating a loader\n */\nexport interface ILoaderProps {\n /**\n * The url resolver used by the loader for resolving external urls\n * into Fluid urls such that the container specified by the\n * external url can be loaded.\n */\n readonly urlResolver: IUrlResolver;\n /**\n * The document service factory take the Fluid url provided\n * by the resolved url and constructs all the necessary services\n * for communication with the container's server.\n */\n readonly documentServiceFactory: IDocumentServiceFactory;\n /**\n * The code loader handles loading the necessary code\n * for running a container once it is loaded.\n */\n readonly codeLoader: ICodeDetailsLoader;\n\n /**\n * A property bag of options used by various layers\n * to control features\n */\n readonly options?: ILoaderOptions;\n\n /**\n * Scope is provided to all container and is a set of shared\n * services for container's to integrate with their host environment.\n */\n readonly scope?: FluidObject;\n\n /**\n * The logger that all telemetry should be pushed to.\n */\n readonly logger?: ITelemetryBaseLogger;\n\n /**\n * Blobs storage for detached containers.\n */\n readonly detachedBlobStorage?: IDetachedBlobStorage;\n\n /**\n * The configuration provider which may be used to control features.\n */\n readonly configProvider?: IConfigProviderBase;\n}\n\n/**\n * Services and properties used by and exposed by the loader\n */\nexport interface ILoaderServices {\n /**\n * The url resolver used by the loader for resolving external urls\n * into Fluid urls such that the container specified by the\n * external url can be loaded.\n */\n readonly urlResolver: IUrlResolver;\n /**\n * The document service factory take the Fluid url provided\n * by the resolved url and constructs all the necessary services\n * for communication with the container's server.\n */\n readonly documentServiceFactory: IDocumentServiceFactory;\n /**\n * The code loader handles loading the necessary code\n * for running a container once it is loaded.\n */\n readonly codeLoader: ICodeDetailsLoader;\n\n /**\n * A property bag of options used by various layers\n * to control features\n */\n readonly options: ILoaderOptions;\n\n /**\n * Scope is provided to all container and is a set of shared\n * services for container's to integrate with their host environment.\n */\n readonly scope: FluidObject;\n\n /**\n * The logger downstream consumers should construct their loggers from\n */\n readonly subLogger: ITelemetryLogger;\n\n /**\n * Blobs storage for detached containers.\n */\n readonly detachedBlobStorage?: IDetachedBlobStorage;\n}\n\n/**\n * Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support\n * blobs in detached containers.\n */\nexport type IDetachedBlobStorage = Pick<IDocumentStorageService, \"createBlob\" | \"readBlob\"> & {\n size: number;\n /**\n * Return an array of all blob IDs present in storage\n */\n getBlobIds(): string[];\n };\n\n/**\n * Manages Fluid resource loading\n */\nexport class Loader implements IHostLoader {\n private readonly containers = new Map<string, Promise<Container>>();\n public readonly services: ILoaderServices;\n private readonly mc: MonitoringContext;\n\n constructor(loaderProps: ILoaderProps) {\n const scope: FluidObject<ILoader> = { ...loaderProps.scope };\n if (loaderProps.options?.provideScopeLoader !== false) {\n scope.ILoader = this;\n }\n const telemetryProps = {\n loaderId: uuid(),\n loaderVersion: pkgVersion,\n };\n\n const subMc = mixinMonitoringContext(\n DebugLogger.mixinDebugLogger(\"fluid:telemetry\", loaderProps.logger, { all: telemetryProps }),\n sessionStorageConfigProvider.value,\n loaderProps.configProvider,\n );\n\n this.services = {\n urlResolver: createCachedResolver(MultiUrlResolver.create(loaderProps.urlResolver)),\n documentServiceFactory: MultiDocumentServiceFactory.create(loaderProps.documentServiceFactory),\n codeLoader: loaderProps.codeLoader,\n options: loaderProps.options ?? {},\n scope,\n subLogger: subMc.logger,\n detachedBlobStorage: loaderProps.detachedBlobStorage,\n };\n this.mc = loggerToMonitoringContext(\n ChildLogger.create(this.services.subLogger, \"Loader\"));\n }\n\n public get IFluidRouter(): IFluidRouter { return this; }\n\n public async createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer> {\n const container = await Container.createDetached(\n this,\n codeDetails,\n );\n\n if (this.cachingEnabled) {\n container.once(\"attached\", () => {\n ensureFluidResolvedUrl(container.resolvedUrl);\n const parsedUrl = parseUrl(container.resolvedUrl.url);\n if (parsedUrl !== undefined) {\n this.addToContainerCache(parsedUrl.id, Promise.resolve(container));\n }\n });\n }\n\n return container;\n }\n\n public async rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer> {\n return Container.rehydrateDetachedFromSnapshot(this, snapshot);\n }\n\n public async resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer> {\n const eventName = pendingLocalState === undefined ? \"Resolve\" : \"ResolveWithPendingState\";\n return PerformanceEvent.timedExecAsync(this.mc.logger, { eventName }, async () => {\n const resolved = await this.resolveCore(\n request,\n pendingLocalState !== undefined ? JSON.parse(pendingLocalState) : undefined,\n );\n return resolved.container;\n });\n }\n\n public async request(request: IRequest): Promise<IResponse> {\n return PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: \"Request\" }, async () => {\n const resolved = await this.resolveCore(request);\n return resolved.container.request({\n ...request,\n url: `${resolved.parsed.path}${resolved.parsed.query}`,\n });\n });\n }\n\n private getKeyForContainerCache(request: IRequest, parsedUrl: IParsedUrl): string {\n const key = request.headers?.[LoaderHeader.version] !== undefined\n ? `${parsedUrl.id}@${request.headers[LoaderHeader.version]}`\n : parsedUrl.id;\n return key;\n }\n\n private addToContainerCache(key: string, containerP: Promise<Container>) {\n this.containers.set(key, containerP);\n containerP.then((container) => {\n // If the container is closed or becomes closed after we resolve it, remove it from the cache.\n if (container.closed) {\n this.containers.delete(key);\n } else {\n container.once(\"closed\", () => {\n this.containers.delete(key);\n });\n }\n }).catch((error) => {});\n }\n\n private async resolveCore(\n request: IRequest,\n pendingLocalState?: IPendingContainerState,\n ): Promise<{ container: Container; parsed: IParsedUrl; }> {\n const resolvedAsFluid = await this.services.urlResolver.resolve(request);\n ensureFluidResolvedUrl(resolvedAsFluid);\n\n // Parse URL into data stores\n const parsed = parseUrl(resolvedAsFluid.url);\n if (parsed === undefined) {\n throw new Error(`Invalid URL ${resolvedAsFluid.url}`);\n }\n\n if (pendingLocalState !== undefined) {\n const parsedPendingUrl = parseUrl(pendingLocalState.url);\n if (parsedPendingUrl?.id !== parsed.id ||\n parsedPendingUrl?.path.replace(/\\/$/, \"\") !== parsed.path.replace(/\\/$/, \"\")) {\n const message = `URL ${resolvedAsFluid.url} does not match pending state URL ${pendingLocalState.url}`;\n throw new Error(message);\n }\n }\n\n const { canCache, fromSequenceNumber } = this.parseHeader(parsed, request);\n const shouldCache = pendingLocalState !== undefined ? false : canCache;\n\n let container: Container;\n if (shouldCache) {\n const key = this.getKeyForContainerCache(request, parsed);\n const maybeContainer = await this.containers.get(key);\n if (maybeContainer !== undefined) {\n container = maybeContainer;\n } else {\n const containerP =\n this.loadContainer(\n request,\n resolvedAsFluid);\n this.addToContainerCache(key, containerP);\n container = await containerP;\n }\n } else {\n container =\n await this.loadContainer(\n request,\n resolvedAsFluid,\n pendingLocalState);\n }\n\n if (container.deltaManager.lastSequenceNumber <= fromSequenceNumber) {\n await new Promise<void>((resolve, reject) => {\n function opHandler(message: ISequencedDocumentMessage) {\n if (message.sequenceNumber > fromSequenceNumber) {\n resolve();\n container.removeListener(\"op\", opHandler);\n }\n }\n\n container.on(\"op\", opHandler);\n });\n }\n\n return { container, parsed };\n }\n\n private get cachingEnabled() {\n return this.services.options.cache !== false;\n }\n\n private canCacheForRequest(headers: IRequestHeader): boolean {\n return this.cachingEnabled && headers[LoaderHeader.cache] !== false;\n }\n\n private parseHeader(parsed: IParsedUrl, request: IRequest) {\n let fromSequenceNumber = -1;\n\n request.headers = request.headers ?? {};\n\n const headerSeqNum = request.headers[LoaderHeader.sequenceNumber];\n if (headerSeqNum !== undefined) {\n fromSequenceNumber = headerSeqNum;\n }\n\n // If set in both query string and headers, use query string\n request.headers[LoaderHeader.version] = parsed.version ?? request.headers[LoaderHeader.version];\n\n const canCache = this.canCacheForRequest(request.headers);\n\n return {\n canCache,\n fromSequenceNumber,\n };\n }\n\n private async loadContainer(\n request: IRequest,\n resolved: IFluidResolvedUrl,\n pendingLocalState?: IPendingContainerState,\n ): Promise<Container> {\n return Container.load(\n this,\n {\n canReconnect: request.headers?.[LoaderHeader.reconnect],\n clientDetailsOverride: request.headers?.[LoaderHeader.clientDetails],\n resolvedUrl: resolved,\n version: request.headers?.[LoaderHeader.version] ?? undefined,\n loadMode: request.headers?.[LoaderHeader.loadMode],\n },\n pendingLocalState,\n );\n }\n}\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/container-loader";
|
|
8
|
-
export declare const pkgVersion = "0.
|
|
8
|
+
export declare const pkgVersion = "1.0.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,UAAU,CAAC"}
|
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/container-loader";
|
|
11
|
-
exports.pkgVersion = "0.
|
|
11
|
+
exports.pkgVersion = "1.0.1";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|