@fluidframework/container-loader 2.10.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/api-report/container-loader.legacy.alpha.api.md +39 -0
- package/dist/container.d.ts +6 -1
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +7 -0
- package/dist/container.js.map +1 -1
- package/dist/createAndLoadContainerUtils.d.ts +125 -0
- package/dist/createAndLoadContainerUtils.d.ts.map +1 -0
- package/dist/createAndLoadContainerUtils.js +50 -0
- package/dist/createAndLoadContainerUtils.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +7 -0
- package/dist/loadPaused.d.ts +4 -3
- package/dist/loadPaused.d.ts.map +1 -1
- package/dist/loadPaused.js +12 -8
- package/dist/loadPaused.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/lib/container.d.ts +6 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +7 -0
- package/lib/container.js.map +1 -1
- package/lib/createAndLoadContainerUtils.d.ts +125 -0
- package/lib/createAndLoadContainerUtils.d.ts.map +1 -0
- package/lib/createAndLoadContainerUtils.js +44 -0
- package/lib/createAndLoadContainerUtils.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +7 -0
- package/lib/loadPaused.d.ts +4 -3
- package/lib/loadPaused.d.ts.map +1 -1
- package/lib/loadPaused.js +12 -8
- package/lib/loadPaused.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/package.json +15 -19
- package/src/container.ts +11 -2
- package/src/createAndLoadContainerUtils.ts +182 -0
- package/src/index.ts +9 -0
- package/src/loadPaused.ts +14 -9
- package/src/packageVersion.ts +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { IContainer, ICodeDetailsLoader, IFluidCodeDetails, type IContainerPolicies } from "@fluidframework/container-definitions/internal";
|
|
6
|
+
import { FluidObject, IConfigProviderBase, IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { IClientDetails } from "@fluidframework/driver-definitions";
|
|
8
|
+
import { IDocumentServiceFactory, IUrlResolver } from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import { ProtocolHandlerBuilder } from "./protocol.js";
|
|
10
|
+
/**
|
|
11
|
+
* Properties necessary for creating and loading a container.
|
|
12
|
+
* @legacy
|
|
13
|
+
* @alpha
|
|
14
|
+
*/
|
|
15
|
+
export interface ICreateAndLoadContainerProps {
|
|
16
|
+
/**
|
|
17
|
+
* The url resolver used by the loader for resolving external urls
|
|
18
|
+
* into Fluid urls such that the container specified by the
|
|
19
|
+
* external url can be loaded.
|
|
20
|
+
*/
|
|
21
|
+
readonly urlResolver: IUrlResolver;
|
|
22
|
+
/**
|
|
23
|
+
* The document service factory take the Fluid url provided
|
|
24
|
+
* by the resolved url and constructs all the necessary services
|
|
25
|
+
* for communication with the container's server.
|
|
26
|
+
*/
|
|
27
|
+
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
28
|
+
/**
|
|
29
|
+
* The code loader handles loading the necessary code
|
|
30
|
+
* for running a container once it is loaded.
|
|
31
|
+
*/
|
|
32
|
+
readonly codeLoader: ICodeDetailsLoader;
|
|
33
|
+
/**
|
|
34
|
+
* A property bag of options/policies used by various layers
|
|
35
|
+
* to control features
|
|
36
|
+
*/
|
|
37
|
+
readonly options?: IContainerPolicies | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Scope is provided to all container and is a set of shared
|
|
40
|
+
* services for container's to integrate with their host environment.
|
|
41
|
+
*/
|
|
42
|
+
readonly scope?: FluidObject | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* The logger that all telemetry should be pushed to.
|
|
45
|
+
*/
|
|
46
|
+
readonly logger?: ITelemetryBaseLogger | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The configuration provider which may be used to control features.
|
|
49
|
+
*/
|
|
50
|
+
readonly configProvider?: IConfigProviderBase | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Optional property for allowing the container to use a custom
|
|
53
|
+
* protocol implementation for handling the quorum and/or the audience.
|
|
54
|
+
*/
|
|
55
|
+
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Disables the Container from reconnecting if false, allows reconnect otherwise.
|
|
58
|
+
*/
|
|
59
|
+
readonly allowReconnect?: boolean | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Client details provided in the override will be merged over the default client.
|
|
62
|
+
*/
|
|
63
|
+
readonly clientDetailsOverride?: IClientDetails | undefined;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Props used to load a container.
|
|
67
|
+
* @legacy
|
|
68
|
+
* @alpha
|
|
69
|
+
*/
|
|
70
|
+
export interface ILoadExistingContainerProps extends ICreateAndLoadContainerProps {
|
|
71
|
+
/**
|
|
72
|
+
* The request to resolve the container.
|
|
73
|
+
*/
|
|
74
|
+
readonly request: IRequest;
|
|
75
|
+
/**
|
|
76
|
+
* Pending local state to be applied to the container.
|
|
77
|
+
*/
|
|
78
|
+
readonly pendingLocalState?: string | undefined;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Props used to create a detached container.
|
|
82
|
+
* @legacy
|
|
83
|
+
* @alpha
|
|
84
|
+
*/
|
|
85
|
+
export interface ICreateDetachedContainerProps extends ICreateAndLoadContainerProps {
|
|
86
|
+
/**
|
|
87
|
+
* The code details for the container to be created.
|
|
88
|
+
*/
|
|
89
|
+
readonly codeDetails: IFluidCodeDetails;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Props used to rehydrate a detached container.
|
|
93
|
+
* @legacy
|
|
94
|
+
* @alpha
|
|
95
|
+
*/
|
|
96
|
+
export interface IRehydrateDetachedContainerProps extends ICreateAndLoadContainerProps {
|
|
97
|
+
/**
|
|
98
|
+
* The serialized state returned by calling serialize on another container
|
|
99
|
+
*/
|
|
100
|
+
readonly serializedState: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Creates a new container using the specified code details but in an unattached state. While unattached, all
|
|
104
|
+
* updates will only be local until the user explicitly attaches the container to a service provider.
|
|
105
|
+
* @param createDetachedContainerProps - Services and properties necessary for creating detached container.
|
|
106
|
+
* @legacy
|
|
107
|
+
* @alpha
|
|
108
|
+
*/
|
|
109
|
+
export declare function createDetachedContainer(createDetachedContainerProps: ICreateDetachedContainerProps): Promise<IContainer>;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a new container using the specified snapshot but in an unattached state. While unattached, all
|
|
112
|
+
* updates will only be local until the user explicitly attaches the container to a service provider.
|
|
113
|
+
* @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.
|
|
114
|
+
* @legacy
|
|
115
|
+
* @alpha
|
|
116
|
+
*/
|
|
117
|
+
export declare function rehydrateDetachedContainer(rehydrateDetachedContainerProps: IRehydrateDetachedContainerProps): Promise<IContainer>;
|
|
118
|
+
/**
|
|
119
|
+
* Loads a container with an existing snapshot from the service.
|
|
120
|
+
* @param loadExistingContainerProps - Services and properties necessary for loading an existing container.
|
|
121
|
+
* @legacy
|
|
122
|
+
* @alpha
|
|
123
|
+
*/
|
|
124
|
+
export declare function loadExistingContainer(loadExistingContainerProps: ILoadExistingContainerProps): Promise<IContainer>;
|
|
125
|
+
//# sourceMappingURL=createAndLoadContainerUtils.d.ts.map
|
|
@@ -0,0 +1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CAC5D;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA4B,SAAQ,4BAA4B;IAChF;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,4BAA4B;IAClF;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;CACxC;AAED;;;;GAIG;AACH,MAAM,WAAW,gCAAiC,SAAQ,4BAA4B;IACrF;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC5C,4BAA4B,EAAE,6BAA6B,GACzD,OAAO,CAAC,UAAU,CAAC,CAMrB;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC/C,+BAA+B,EAAE,gCAAgC,GAC/D,OAAO,CAAC,UAAU,CAAC,CASrB;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAC1C,0BAA0B,EAAE,2BAA2B,GACrD,OAAO,CAAC,UAAU,CAAC,CAMrB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { Loader } from "./loader.js";
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new container using the specified code details but in an unattached state. While unattached, all
|
|
8
|
+
* updates will only be local until the user explicitly attaches the container to a service provider.
|
|
9
|
+
* @param createDetachedContainerProps - Services and properties necessary for creating detached container.
|
|
10
|
+
* @legacy
|
|
11
|
+
* @alpha
|
|
12
|
+
*/
|
|
13
|
+
export async function createDetachedContainer(createDetachedContainerProps) {
|
|
14
|
+
const loader = new Loader(createDetachedContainerProps);
|
|
15
|
+
return loader.createDetachedContainer(createDetachedContainerProps.codeDetails, {
|
|
16
|
+
canReconnect: createDetachedContainerProps.allowReconnect,
|
|
17
|
+
clientDetailsOverride: createDetachedContainerProps.clientDetailsOverride,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new container using the specified snapshot but in an unattached state. While unattached, all
|
|
22
|
+
* updates will only be local until the user explicitly attaches the container to a service provider.
|
|
23
|
+
* @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.
|
|
24
|
+
* @legacy
|
|
25
|
+
* @alpha
|
|
26
|
+
*/
|
|
27
|
+
export async function rehydrateDetachedContainer(rehydrateDetachedContainerProps) {
|
|
28
|
+
const loader = new Loader(rehydrateDetachedContainerProps);
|
|
29
|
+
return loader.rehydrateDetachedContainerFromSnapshot(rehydrateDetachedContainerProps.serializedState, {
|
|
30
|
+
canReconnect: rehydrateDetachedContainerProps.allowReconnect,
|
|
31
|
+
clientDetailsOverride: rehydrateDetachedContainerProps.clientDetailsOverride,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Loads a container with an existing snapshot from the service.
|
|
36
|
+
* @param loadExistingContainerProps - Services and properties necessary for loading an existing container.
|
|
37
|
+
* @legacy
|
|
38
|
+
* @alpha
|
|
39
|
+
*/
|
|
40
|
+
export async function loadExistingContainer(loadExistingContainerProps) {
|
|
41
|
+
const loader = new Loader(loadExistingContainerProps);
|
|
42
|
+
return loader.resolve(loadExistingContainerProps.request, loadExistingContainerProps.pendingLocalState);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=createAndLoadContainerUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAndLoadContainerUtils.js","sourceRoot":"","sources":["../src/createAndLoadContainerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA2GrC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC5C,4BAA2D;IAE3D,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,4BAA4B,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC,uBAAuB,CAAC,4BAA4B,CAAC,WAAW,EAAE;QAC/E,YAAY,EAAE,4BAA4B,CAAC,cAAc;QACzD,qBAAqB,EAAE,4BAA4B,CAAC,qBAAqB;KACzE,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,+BAAiE;IAEjE,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,+BAA+B,CAAC,CAAC;IAC3D,OAAO,MAAM,CAAC,sCAAsC,CACnD,+BAA+B,CAAC,eAAe,EAC/C;QACC,YAAY,EAAE,+BAA+B,CAAC,cAAc;QAC5D,qBAAqB,EAAE,+BAA+B,CAAC,qBAAqB;KAC5E,CACD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAC1C,0BAAuD;IAEvD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,0BAA0B,CAAC,CAAC;IACtD,OAAO,MAAM,CAAC,OAAO,CACpB,0BAA0B,CAAC,OAAO,EAClC,0BAA0B,CAAC,iBAAiB,CAC5C,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainer,\n\tICodeDetailsLoader,\n\tIFluidCodeDetails,\n\ttype IContainerPolicies,\n} from \"@fluidframework/container-definitions/internal\";\nimport {\n\tFluidObject,\n\tIConfigProviderBase,\n\tIRequest,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentServiceFactory,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport { Loader } from \"./loader.js\";\nimport { ProtocolHandlerBuilder } from \"./protocol.js\";\n\n/**\n * Properties necessary for creating and loading a container.\n * @legacy\n * @alpha\n */\nexport interface ICreateAndLoadContainerProps {\n\t/**\n\t * The url resolver used by the loader for resolving external urls\n\t * into Fluid urls such that the container specified by the\n\t * external url can be loaded.\n\t */\n\treadonly urlResolver: IUrlResolver;\n\t/**\n\t * The document service factory take the Fluid url provided\n\t * by the resolved url and constructs all the necessary services\n\t * for communication with the container's server.\n\t */\n\treadonly documentServiceFactory: IDocumentServiceFactory;\n\t/**\n\t * The code loader handles loading the necessary code\n\t * for running a container once it is loaded.\n\t */\n\treadonly codeLoader: ICodeDetailsLoader;\n\n\t/**\n\t * A property bag of options/policies used by various layers\n\t * to control features\n\t */\n\treadonly options?: IContainerPolicies | undefined;\n\n\t/**\n\t * Scope is provided to all container and is a set of shared\n\t * services for container's to integrate with their host environment.\n\t */\n\treadonly scope?: FluidObject | undefined;\n\n\t/**\n\t * The logger that all telemetry should be pushed to.\n\t */\n\treadonly logger?: ITelemetryBaseLogger | undefined;\n\n\t/**\n\t * The configuration provider which may be used to control features.\n\t */\n\treadonly configProvider?: IConfigProviderBase | undefined;\n\n\t/**\n\t * Optional property for allowing the container to use a custom\n\t * protocol implementation for handling the quorum and/or the audience.\n\t */\n\treadonly protocolHandlerBuilder?: ProtocolHandlerBuilder | undefined;\n\n\t/**\n\t * Disables the Container from reconnecting if false, allows reconnect otherwise.\n\t */\n\treadonly allowReconnect?: boolean | undefined;\n\n\t/**\n\t * Client details provided in the override will be merged over the default client.\n\t */\n\treadonly clientDetailsOverride?: IClientDetails | undefined;\n}\n\n/**\n * Props used to load a container.\n * @legacy\n * @alpha\n */\nexport interface ILoadExistingContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The request to resolve the container.\n\t */\n\treadonly request: IRequest;\n\n\t/**\n\t * Pending local state to be applied to the container.\n\t */\n\treadonly pendingLocalState?: string | undefined;\n}\n\n/**\n * Props used to create a detached container.\n * @legacy\n * @alpha\n */\nexport interface ICreateDetachedContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The code details for the container to be created.\n\t */\n\treadonly codeDetails: IFluidCodeDetails;\n}\n\n/**\n * Props used to rehydrate a detached container.\n * @legacy\n * @alpha\n */\nexport interface IRehydrateDetachedContainerProps extends ICreateAndLoadContainerProps {\n\t/**\n\t * The serialized state returned by calling serialize on another container\n\t */\n\treadonly serializedState: string;\n}\n\n/**\n * Creates a new container using the specified code details but in an unattached state. While unattached, all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n * @param createDetachedContainerProps - Services and properties necessary for creating detached container.\n * @legacy\n * @alpha\n */\nexport async function createDetachedContainer(\n\tcreateDetachedContainerProps: ICreateDetachedContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(createDetachedContainerProps);\n\treturn loader.createDetachedContainer(createDetachedContainerProps.codeDetails, {\n\t\tcanReconnect: createDetachedContainerProps.allowReconnect,\n\t\tclientDetailsOverride: createDetachedContainerProps.clientDetailsOverride,\n\t});\n}\n\n/**\n * Creates a new container using the specified snapshot but in an unattached state. While unattached, all\n * updates will only be local until the user explicitly attaches the container to a service provider.\n * @param rehydrateDetachedContainerProps - Services and properties necessary for rehydrating detached container from a previously serialized container's state.\n * @legacy\n * @alpha\n */\nexport async function rehydrateDetachedContainer(\n\trehydrateDetachedContainerProps: IRehydrateDetachedContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(rehydrateDetachedContainerProps);\n\treturn loader.rehydrateDetachedContainerFromSnapshot(\n\t\trehydrateDetachedContainerProps.serializedState,\n\t\t{\n\t\t\tcanReconnect: rehydrateDetachedContainerProps.allowReconnect,\n\t\t\tclientDetailsOverride: rehydrateDetachedContainerProps.clientDetailsOverride,\n\t\t},\n\t);\n}\n\n/**\n * Loads a container with an existing snapshot from the service.\n * @param loadExistingContainerProps - Services and properties necessary for loading an existing container.\n * @legacy\n * @alpha\n */\nexport async function loadExistingContainer(\n\tloadExistingContainerProps: ILoadExistingContainerProps,\n): Promise<IContainer> {\n\tconst loader = new Loader(loadExistingContainerProps);\n\treturn loader.resolve(\n\t\tloadExistingContainerProps.request,\n\t\tloadExistingContainerProps.pendingLocalState,\n\t);\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { ConnectionState } from "./connectionState.js";
|
|
6
6
|
export { IContainerExperimental, waitContainerToCatchUp } from "./container.js";
|
|
7
|
+
export { createDetachedContainer, loadExistingContainer, rehydrateDetachedContainer, ICreateAndLoadContainerProps, ICreateDetachedContainerProps, ILoadExistingContainerProps, IRehydrateDetachedContainerProps, } from "./createAndLoadContainerUtils.js";
|
|
7
8
|
export { ICodeDetailsLoader, IDetachedBlobStorage, IFluidModuleWithDetails, ILoaderOptions, ILoaderProps, ILoaderServices, Loader, } from "./loader.js";
|
|
8
9
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
9
10
|
export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
|
package/lib/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,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACN,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACN,6BAA6B,EAC7B,UAAU,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,gCAAgC,GAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACN,6BAA6B,EAC7B,UAAU,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { ConnectionState } from "./connectionState.js";
|
|
6
6
|
export { waitContainerToCatchUp } from "./container.js";
|
|
7
|
+
export { createDetachedContainer, loadExistingContainer, rehydrateDetachedContainer, } from "./createAndLoadContainerUtils.js";
|
|
7
8
|
export { Loader, } from "./loader.js";
|
|
8
9
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
9
10
|
export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAON,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACN,6BAA6B,GAE7B,MAAM,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { IContainerExperimental, waitContainerToCatchUp } from \"./container.js\";\nexport {\n\tICodeDetailsLoader,\n\tIDetachedBlobStorage,\n\tIFluidModuleWithDetails,\n\tILoaderOptions,\n\tILoaderProps,\n\tILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\tIParsedUrl,\n} from \"./utils.js\";\nexport {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,GAK1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAON,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACN,6BAA6B,GAE7B,MAAM,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { IContainerExperimental, waitContainerToCatchUp } from \"./container.js\";\nexport {\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tICreateAndLoadContainerProps,\n\tICreateDetachedContainerProps,\n\tILoadExistingContainerProps,\n\tIRehydrateDetachedContainerProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport {\n\tICodeDetailsLoader,\n\tIDetachedBlobStorage,\n\tIFluidModuleWithDetails,\n\tILoaderOptions,\n\tILoaderProps,\n\tILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\tIParsedUrl,\n} from \"./utils.js\";\nexport {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\n"]}
|
package/lib/legacy.d.ts
CHANGED
|
@@ -15,19 +15,26 @@ export {
|
|
|
15
15
|
// @legacy APIs
|
|
16
16
|
IBaseProtocolHandler,
|
|
17
17
|
ICodeDetailsLoader,
|
|
18
|
+
ICreateAndLoadContainerProps,
|
|
19
|
+
ICreateDetachedContainerProps,
|
|
18
20
|
IDetachedBlobStorage,
|
|
19
21
|
IFluidModuleWithDetails,
|
|
22
|
+
ILoadExistingContainerProps,
|
|
20
23
|
ILoaderOptions,
|
|
21
24
|
ILoaderProps,
|
|
22
25
|
ILoaderServices,
|
|
23
26
|
IParsedUrl,
|
|
24
27
|
IProtocolHandler,
|
|
25
28
|
IQuorumSnapshot,
|
|
29
|
+
IRehydrateDetachedContainerProps,
|
|
26
30
|
IScribeProtocolState,
|
|
27
31
|
Loader,
|
|
28
32
|
ProtocolHandlerBuilder,
|
|
29
33
|
QuorumClientsSnapshot,
|
|
30
34
|
QuorumProposalsSnapshot,
|
|
35
|
+
createDetachedContainer,
|
|
36
|
+
loadExistingContainer,
|
|
37
|
+
rehydrateDetachedContainer,
|
|
31
38
|
resolveWithLocationRedirectionHandling,
|
|
32
39
|
tryParseCompatibleResolvedUrl,
|
|
33
40
|
waitContainerToCatchUp
|
package/lib/loadPaused.d.ts
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { type IContainer } from "@fluidframework/container-definitions/internal";
|
|
6
6
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { type ILoaderProps } from "./loader.js";
|
|
7
8
|
/**
|
|
8
9
|
* Loads container and leaves it in a state where it does not process any ops.
|
|
9
10
|
* Container instance returned by this function is in special mode where some functionality that is available in normal use will not work correctly
|
|
@@ -23,7 +24,7 @@ import { IRequest } from "@fluidframework/core-interfaces";
|
|
|
23
24
|
* network connectivity issues / ability to cancel (IContainer.disconnect) or close container (IContainer.close)
|
|
24
25
|
* This flow needs to fetch ops (potentially connecting to delta connection), and any retriable errors on this path result in infinite retry.
|
|
25
26
|
* If you need to cancel that process, consider supplying AbortSignal parameter.
|
|
26
|
-
* @param
|
|
27
|
+
* @param loaderProps - The loader props to use to load the container.
|
|
27
28
|
* @param request - request identifying container instance / load parameters. LoaderHeader.loadMode headers are ignored (see above)
|
|
28
29
|
* @param loadToSequenceNumber - optional sequence number. If provided, ops are processed up to this sequence number.
|
|
29
30
|
* @param signal - optional abort signal that can be used to cancel waiting for the ops.
|
|
@@ -31,5 +32,5 @@ import { IRequest } from "@fluidframework/core-interfaces";
|
|
|
31
32
|
*
|
|
32
33
|
* @internal
|
|
33
34
|
*/
|
|
34
|
-
export declare function loadContainerPaused(
|
|
35
|
+
export declare function loadContainerPaused(loaderProps: ILoaderProps, request: IRequest, loadToSequenceNumber?: number, signal?: AbortSignal): Promise<IContainer>;
|
|
35
36
|
//# sourceMappingURL=loadPaused.d.ts.map
|
package/lib/loadPaused.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadPaused.d.ts","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"loadPaused.d.ts","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,KAAK,UAAU,EACf,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAM3D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,mBAAmB,CACxC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,QAAQ,EACjB,oBAAoB,CAAC,EAAE,MAAM,EAC7B,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,UAAU,CAAC,CAwGrB"}
|
package/lib/loadPaused.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { isIDeltaManagerFull, LoaderHeader, } from "@fluidframework/container-definitions/internal";
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { GenericError } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
+
import { loadExistingContainer } from "./createAndLoadContainerUtils.js";
|
|
8
9
|
/* eslint-disable jsdoc/check-indentation */
|
|
9
10
|
/**
|
|
10
11
|
* Loads container and leaves it in a state where it does not process any ops.
|
|
@@ -25,7 +26,7 @@ import { GenericError } from "@fluidframework/telemetry-utils/internal";
|
|
|
25
26
|
* network connectivity issues / ability to cancel (IContainer.disconnect) or close container (IContainer.close)
|
|
26
27
|
* This flow needs to fetch ops (potentially connecting to delta connection), and any retriable errors on this path result in infinite retry.
|
|
27
28
|
* If you need to cancel that process, consider supplying AbortSignal parameter.
|
|
28
|
-
* @param
|
|
29
|
+
* @param loaderProps - The loader props to use to load the container.
|
|
29
30
|
* @param request - request identifying container instance / load parameters. LoaderHeader.loadMode headers are ignored (see above)
|
|
30
31
|
* @param loadToSequenceNumber - optional sequence number. If provided, ops are processed up to this sequence number.
|
|
31
32
|
* @param signal - optional abort signal that can be used to cancel waiting for the ops.
|
|
@@ -33,13 +34,16 @@ import { GenericError } from "@fluidframework/telemetry-utils/internal";
|
|
|
33
34
|
*
|
|
34
35
|
* @internal
|
|
35
36
|
*/
|
|
36
|
-
export async function loadContainerPaused(
|
|
37
|
-
const container = await
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
export async function loadContainerPaused(loaderProps, request, loadToSequenceNumber, signal) {
|
|
38
|
+
const container = await loadExistingContainer({
|
|
39
|
+
...loaderProps,
|
|
40
|
+
request: {
|
|
41
|
+
url: request.url,
|
|
42
|
+
headers: {
|
|
43
|
+
...request.headers,
|
|
44
|
+
// ensure we do not process any ops, such that we can examine container before ops starts to flow.
|
|
45
|
+
[LoaderHeader.loadMode]: { opsBeforeReturn: undefined, deltaConnection: "none" },
|
|
46
|
+
},
|
|
43
47
|
},
|
|
44
48
|
});
|
|
45
49
|
// Force readonly mode - this will ensure we don't receive an error for the lack of join op
|
package/lib/loadPaused.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadPaused.js","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,mBAAmB,EACnB,YAAY,GAEZ,MAAM,gDAAgD,CAAC;AAGxD,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE,4CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,MAAe,EACf,OAAiB,EACjB,oBAA6B,EAC7B,MAAoB;IAEpB,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QACtC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO,EAAE;YACR,GAAG,OAAO,CAAC,OAAO;YAClB,kGAAkG;YAClG,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE;SAChF;KACD,CAAC,CAAC;IAEH,2FAA2F;IAC3F,SAAS,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,EAAE,GAAG,SAAS,CAAC,YAAY,CAAC;IAClC,MAAM,2BAA2B,GAAG,EAAE,CAAC,qBAAqB,CAAC;IAE7D,MAAM,cAAc,GAAG,GAAS,EAAE;QACjC,MAAM,CACL,mBAAmB,CAAC,EAAE,CAAC,EACvB,KAAK,CAAC,0DAA0D,CAChE,CAAC;QACF,mCAAmC;QACnC,KAAK,EAAE,CAAC,OAAO,CAA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AAO,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,4DAA4D;IAC5D,oHAAoH;IACpH,oFAAoF;IACpF,kGAAkG;IAClG,sIAAsI;IACtI,2CAA2C;IAC3C,SAAS,CAAC,OAAO,EAAE,CAAC;IAEpB,oCAAoC;IACpC,MAAM,OAAO;QACZ,8DAA8D;SAC7D,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;QACrB,iEAAiE;QACjE,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,MAAM,KAAK,CAAC;IACb,CAAC,CAAC;SACD,OAAO,CAAC,GAAG,EAAE;QACb,+IAA+I;QAC/I,8HAA8H;QAC9H,kGAAkG;QAClG,SAAS,CAAC,UAAU,EAAE,CAAC;QAEvB,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC/B,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEJ,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,2CAA2C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tILoader,\n\tisIDeltaManagerFull,\n\tLoaderHeader,\n\ttype IContainer,\n} from \"@fluidframework/container-definitions/internal\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { GenericError } from \"@fluidframework/telemetry-utils/internal\";\n\n/* eslint-disable jsdoc/check-indentation */\n\n/**\n * Loads container and leaves it in a state where it does not process any ops.\n * Container instance returned by this function is in special mode where some functionality that is available in normal use will not work correctly\n * with instance of container returned by this function. Some examples:\n * 1. calling IContainer.connect() will have very little impact on this container as it will not process ops.\n * 2. functionality like waitContainerToCatchUp() or waiting for ops in any other way would hand infinitely, as this container is not processing ops\n * 3. No changes can be made to this container - they will be lost.\n *\n * If sequence number is provided, loads up to this sequence number and stops there, otherwise stops immediately after loading snapshot.\n * In all cases, container is returned disconnected & paused, or an exception is thrown\n * Notes:\n * 1. Ignores LoaderHeader.loadMode headers. Container is always returned with ops applied upt to provided sequence number,\n * or no ops applied at all (if sequence number is not provided)\n * 2. This call can hang infinitately if disconnected from internet (or hit some other conditions, like 429 storm).\n * Compare to Container.load() experience (with default settings) - it either returns failure right away, or succeeds, with\n * ops fetching / delta connection happening in parallel / after container load flow, and thus providing an object (Container instance) to observe\n * network connectivity issues / ability to cancel (IContainer.disconnect) or close container (IContainer.close)\n * This flow needs to fetch ops (potentially connecting to delta connection), and any retriable errors on this path result in infinite retry.\n * If you need to cancel that process, consider supplying AbortSignal parameter.\n * @param loader - loader instance to use to load container\n * @param request - request identifying container instance / load parameters. LoaderHeader.loadMode headers are ignored (see above)\n * @param loadToSequenceNumber - optional sequence number. If provided, ops are processed up to this sequence number.\n * @param signal - optional abort signal that can be used to cancel waiting for the ops.\n * @returns IContainer instance\n *\n * @internal\n */\nexport async function loadContainerPaused(\n\tloader: ILoader,\n\trequest: IRequest,\n\tloadToSequenceNumber?: number,\n\tsignal?: AbortSignal,\n): Promise<IContainer> {\n\tconst container = await loader.resolve({\n\t\turl: request.url,\n\t\theaders: {\n\t\t\t...request.headers,\n\t\t\t// ensure we do not process any ops, such that we can examine container before ops starts to flow.\n\t\t\t[LoaderHeader.loadMode]: { opsBeforeReturn: undefined, deltaConnection: \"none\" },\n\t\t},\n\t});\n\n\t// Force readonly mode - this will ensure we don't receive an error for the lack of join op\n\tcontainer.forceReadonly?.(true);\n\n\tconst dm = container.deltaManager;\n\tconst lastProcessedSequenceNumber = dm.initialSequenceNumber;\n\n\tconst pauseContainer = (): void => {\n\t\tassert(\n\t\t\tisIDeltaManagerFull(dm),\n\t\t\t0xa7f /* Delta manager does not have inbound/outbound queues. */,\n\t\t);\n\t\t// eslint-disable-next-line no-void\n\t\tvoid dm.inbound.pause();\n\t\t// eslint-disable-next-line no-void\n\t\tvoid dm.outbound.pause();\n\t};\n\n\t// Happy path - we are already there.\n\tif (\n\t\tloadToSequenceNumber === undefined ||\n\t\tlastProcessedSequenceNumber === loadToSequenceNumber\n\t) {\n\t\t// If we have already reached the desired sequence number, call pauseContainer() to pause immediately.\n\t\tpauseContainer();\n\t\treturn container;\n\t}\n\n\t// If we are trying to pause at a specific sequence number, ensure the latest snapshot is not newer than the desired sequence number.\n\tif (lastProcessedSequenceNumber > loadToSequenceNumber) {\n\t\tconst error = new GenericError(\n\t\t\t\"Cannot satisfy request to pause the container at the specified sequence number. Most recent snapshot is newer than the specified sequence number.\",\n\t\t);\n\t\tcontainer.close(error);\n\t\tthrow error;\n\t}\n\n\tlet opHandler: () => void;\n\tlet onAbort: () => void;\n\tlet onClose: (error?: IErrorBase) => void;\n\n\tconst promise = new Promise<void>((resolve, reject) => {\n\t\tonAbort = (): void => reject(new GenericError(\"Canceled due to cancellation request.\"));\n\t\tonClose = (error?: IErrorBase): void => reject(error);\n\n\t\t// We need to setup a listener to stop op processing once we reach the desired sequence number (if specified).\n\t\topHandler = (): void => {\n\t\t\t// If there is a specified sequence number, keep processing until we reach it.\n\t\t\tif (\n\t\t\t\tloadToSequenceNumber !== undefined &&\n\t\t\t\tdm.lastSequenceNumber >= loadToSequenceNumber\n\t\t\t) {\n\t\t\t\t// Pause op processing once we have processed the desired number of ops.\n\t\t\t\tpauseContainer();\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\n\t\t// If we have not yet reached the desired sequence number, setup a listener to pause once we reach it.\n\t\tsignal?.addEventListener(\"abort\", onAbort);\n\t\tcontainer.on(\"op\", opHandler);\n\t\tcontainer.on(\"closed\", onClose);\n\t});\n\n\t// There are no guarantees on when ops will land in storage.\n\t// No guarantees that driver implements ops caching (i.e. ops observed in previous session can be served from cache)\n\t// or that browser will provide caching capabilities / keep the data (localStorage).\n\t// Thus, we have to ensure we connect to delta storage in order to make forward progress with ops.\n\t// We also instructed not to fetch / apply any ops from storage above (to be able to install callback above before ops are processed),\n\t// connect() call will fetch ops as needed.\n\tcontainer.connect();\n\n\t// Wait for the ops to be processed.\n\tawait promise\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t.catch((error: any) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\tcontainer.close(error);\n\t\t\tthrow error;\n\t\t})\n\t\t.finally(() => {\n\t\t\t// There is not much value in leaving delta connection on. We are not processing ops, we also can't advance to \"connected\" state because of it.\n\t\t\t// We are not sending ops (due to forceReadonly() call above). We are holding collab window and any consensus-based processes.\n\t\t\t// It's better not to have connection in such case, as there are only nagatives, and no positives.\n\t\t\tcontainer.disconnect();\n\n\t\t\tcontainer.off(\"op\", opHandler);\n\t\t\tcontainer.off(\"closed\", onClose);\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t});\n\n\treturn container;\n}\n\n/* eslint-enable jsdoc/check-indentation */\n"]}
|
|
1
|
+
{"version":3,"file":"loadPaused.js","sourceRoot":"","sources":["../src/loadPaused.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,mBAAmB,EACnB,YAAY,GAEZ,MAAM,gDAAgD,CAAC;AAGxD,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,4CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,WAAyB,EACzB,OAAiB,EACjB,oBAA6B,EAC7B,MAAoB;IAEpB,MAAM,SAAS,GAAG,MAAM,qBAAqB,CAAC;QAC7C,GAAG,WAAW;QACd,OAAO,EAAE;YACR,GAAG,EAAE,OAAO,CA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,SAAS,CAAC;AAClB,CAAC;AAED,2CAA2C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tisIDeltaManagerFull,\n\tLoaderHeader,\n\ttype IContainer,\n} from \"@fluidframework/container-definitions/internal\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { GenericError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { loadExistingContainer } from \"./createAndLoadContainerUtils.js\";\nimport { type ILoaderProps } from \"./loader.js\";\n\n/* eslint-disable jsdoc/check-indentation */\n\n/**\n * Loads container and leaves it in a state where it does not process any ops.\n * Container instance returned by this function is in special mode where some functionality that is available in normal use will not work correctly\n * with instance of container returned by this function. Some examples:\n * 1. calling IContainer.connect() will have very little impact on this container as it will not process ops.\n * 2. functionality like waitContainerToCatchUp() or waiting for ops in any other way would hand infinitely, as this container is not processing ops\n * 3. No changes can be made to this container - they will be lost.\n *\n * If sequence number is provided, loads up to this sequence number and stops there, otherwise stops immediately after loading snapshot.\n * In all cases, container is returned disconnected & paused, or an exception is thrown\n * Notes:\n * 1. Ignores LoaderHeader.loadMode headers. Container is always returned with ops applied upt to provided sequence number,\n * or no ops applied at all (if sequence number is not provided)\n * 2. This call can hang infinitately if disconnected from internet (or hit some other conditions, like 429 storm).\n * Compare to Container.load() experience (with default settings) - it either returns failure right away, or succeeds, with\n * ops fetching / delta connection happening in parallel / after container load flow, and thus providing an object (Container instance) to observe\n * network connectivity issues / ability to cancel (IContainer.disconnect) or close container (IContainer.close)\n * This flow needs to fetch ops (potentially connecting to delta connection), and any retriable errors on this path result in infinite retry.\n * If you need to cancel that process, consider supplying AbortSignal parameter.\n * @param loaderProps - The loader props to use to load the container.\n * @param request - request identifying container instance / load parameters. LoaderHeader.loadMode headers are ignored (see above)\n * @param loadToSequenceNumber - optional sequence number. If provided, ops are processed up to this sequence number.\n * @param signal - optional abort signal that can be used to cancel waiting for the ops.\n * @returns IContainer instance\n *\n * @internal\n */\nexport async function loadContainerPaused(\n\tloaderProps: ILoaderProps,\n\trequest: IRequest,\n\tloadToSequenceNumber?: number,\n\tsignal?: AbortSignal,\n): Promise<IContainer> {\n\tconst container = await loadExistingContainer({\n\t\t...loaderProps,\n\t\trequest: {\n\t\t\turl: request.url,\n\t\t\theaders: {\n\t\t\t\t...request.headers,\n\t\t\t\t// ensure we do not process any ops, such that we can examine container before ops starts to flow.\n\t\t\t\t[LoaderHeader.loadMode]: { opsBeforeReturn: undefined, deltaConnection: \"none\" },\n\t\t\t},\n\t\t},\n\t});\n\n\t// Force readonly mode - this will ensure we don't receive an error for the lack of join op\n\tcontainer.forceReadonly?.(true);\n\n\tconst dm = container.deltaManager;\n\tconst lastProcessedSequenceNumber = dm.initialSequenceNumber;\n\n\tconst pauseContainer = (): void => {\n\t\tassert(\n\t\t\tisIDeltaManagerFull(dm),\n\t\t\t0xa7f /* Delta manager does not have inbound/outbound queues. */,\n\t\t);\n\t\t// eslint-disable-next-line no-void\n\t\tvoid dm.inbound.pause();\n\t\t// eslint-disable-next-line no-void\n\t\tvoid dm.outbound.pause();\n\t};\n\n\t// Happy path - we are already there.\n\tif (\n\t\tloadToSequenceNumber === undefined ||\n\t\tlastProcessedSequenceNumber === loadToSequenceNumber\n\t) {\n\t\t// If we have already reached the desired sequence number, call pauseContainer() to pause immediately.\n\t\tpauseContainer();\n\t\treturn container;\n\t}\n\n\t// If we are trying to pause at a specific sequence number, ensure the latest snapshot is not newer than the desired sequence number.\n\tif (lastProcessedSequenceNumber > loadToSequenceNumber) {\n\t\tconst error = new GenericError(\n\t\t\t\"Cannot satisfy request to pause the container at the specified sequence number. Most recent snapshot is newer than the specified sequence number.\",\n\t\t);\n\t\tcontainer.close(error);\n\t\tthrow error;\n\t}\n\n\tlet opHandler: () => void;\n\tlet onAbort: () => void;\n\tlet onClose: (error?: IErrorBase) => void;\n\n\tconst promise = new Promise<void>((resolve, reject) => {\n\t\tonAbort = (): void => reject(new GenericError(\"Canceled due to cancellation request.\"));\n\t\tonClose = (error?: IErrorBase): void => reject(error);\n\n\t\t// We need to setup a listener to stop op processing once we reach the desired sequence number (if specified).\n\t\topHandler = (): void => {\n\t\t\t// If there is a specified sequence number, keep processing until we reach it.\n\t\t\tif (\n\t\t\t\tloadToSequenceNumber !== undefined &&\n\t\t\t\tdm.lastSequenceNumber >= loadToSequenceNumber\n\t\t\t) {\n\t\t\t\t// Pause op processing once we have processed the desired number of ops.\n\t\t\t\tpauseContainer();\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\n\t\t// If we have not yet reached the desired sequence number, setup a listener to pause once we reach it.\n\t\tsignal?.addEventListener(\"abort\", onAbort);\n\t\tcontainer.on(\"op\", opHandler);\n\t\tcontainer.on(\"closed\", onClose);\n\t});\n\n\t// There are no guarantees on when ops will land in storage.\n\t// No guarantees that driver implements ops caching (i.e. ops observed in previous session can be served from cache)\n\t// or that browser will provide caching capabilities / keep the data (localStorage).\n\t// Thus, we have to ensure we connect to delta storage in order to make forward progress with ops.\n\t// We also instructed not to fetch / apply any ops from storage above (to be able to install callback above before ops are processed),\n\t// connect() call will fetch ops as needed.\n\tcontainer.connect();\n\n\t// Wait for the ops to be processed.\n\tawait promise\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t.catch((error: any) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\tcontainer.close(error);\n\t\t\tthrow error;\n\t\t})\n\t\t.finally(() => {\n\t\t\t// There is not much value in leaving delta connection on. We are not processing ops, we also can't advance to \"connected\" state because of it.\n\t\t\t// We are not sending ops (due to forceReadonly() call above). We are holding collab window and any consensus-based processes.\n\t\t\t// It's better not to have connection in such case, as there are only nagatives, and no positives.\n\t\t\tcontainer.disconnect();\n\n\t\t\tcontainer.off(\"op\", opHandler);\n\t\t\tcontainer.off(\"closed\", onClose);\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t});\n\n\treturn container;\n}\n\n/* eslint-enable jsdoc/check-indentation */\n"]}
|
package/lib/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 = "2.
|
|
8
|
+
export declare const pkgVersion = "2.12.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.12.0\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-loader",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Fluid container loader",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -119,13 +119,13 @@
|
|
|
119
119
|
"temp-directory": "nyc/.nyc_output"
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
|
-
"@fluid-internal/client-utils": "~2.
|
|
123
|
-
"@fluidframework/container-definitions": "~2.
|
|
124
|
-
"@fluidframework/core-interfaces": "~2.
|
|
125
|
-
"@fluidframework/core-utils": "~2.
|
|
126
|
-
"@fluidframework/driver-definitions": "~2.
|
|
127
|
-
"@fluidframework/driver-utils": "~2.
|
|
128
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
122
|
+
"@fluid-internal/client-utils": "~2.12.0",
|
|
123
|
+
"@fluidframework/container-definitions": "~2.12.0",
|
|
124
|
+
"@fluidframework/core-interfaces": "~2.12.0",
|
|
125
|
+
"@fluidframework/core-utils": "~2.12.0",
|
|
126
|
+
"@fluidframework/driver-definitions": "~2.12.0",
|
|
127
|
+
"@fluidframework/driver-utils": "~2.12.0",
|
|
128
|
+
"@fluidframework/telemetry-utils": "~2.12.0",
|
|
129
129
|
"@types/events_pkg": "npm:@types/events@^3.0.0",
|
|
130
130
|
"@ungap/structured-clone": "^1.2.0",
|
|
131
131
|
"debug": "^4.3.4",
|
|
@@ -134,16 +134,16 @@
|
|
|
134
134
|
"uuid": "^9.0.0"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@arethetypeswrong/cli": "^0.
|
|
137
|
+
"@arethetypeswrong/cli": "^0.17.1",
|
|
138
138
|
"@biomejs/biome": "~1.9.3",
|
|
139
|
-
"@fluid-internal/client-utils": "~2.
|
|
140
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
141
|
-
"@fluid-private/test-loader-utils": "~2.
|
|
139
|
+
"@fluid-internal/client-utils": "~2.12.0",
|
|
140
|
+
"@fluid-internal/mocha-test-setup": "~2.12.0",
|
|
141
|
+
"@fluid-private/test-loader-utils": "~2.12.0",
|
|
142
142
|
"@fluid-tools/build-cli": "^0.51.0",
|
|
143
143
|
"@fluidframework/build-common": "^2.0.3",
|
|
144
144
|
"@fluidframework/build-tools": "^0.51.0",
|
|
145
|
-
"@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader
|
|
146
|
-
"@fluidframework/eslint-config-fluid": "^5.
|
|
145
|
+
"@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.11.0",
|
|
146
|
+
"@fluidframework/eslint-config-fluid": "^5.6.0",
|
|
147
147
|
"@microsoft/api-extractor": "7.47.8",
|
|
148
148
|
"@types/debug": "^4.1.5",
|
|
149
149
|
"@types/double-ended-queue": "^2.1.0",
|
|
@@ -166,11 +166,7 @@
|
|
|
166
166
|
"typescript": "~5.4.5"
|
|
167
167
|
},
|
|
168
168
|
"typeValidation": {
|
|
169
|
-
"broken": {
|
|
170
|
-
"Interface_IContainerExperimental": {
|
|
171
|
-
"backCompat": false
|
|
172
|
-
}
|
|
173
|
-
},
|
|
169
|
+
"broken": {},
|
|
174
170
|
"entrypoint": "legacy"
|
|
175
171
|
},
|
|
176
172
|
"scripts": {
|
package/src/container.ts
CHANGED
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
IFluidCodeDetailsComparer,
|
|
23
23
|
IFluidModuleWithDetails,
|
|
24
24
|
IGetPendingLocalStateProps,
|
|
25
|
-
IHostLoader,
|
|
26
25
|
IProvideFluidCodeDetailsComparer,
|
|
27
26
|
IProvideRuntimeFactory,
|
|
28
27
|
IRuntime,
|
|
29
28
|
isFluidCodeDetails,
|
|
30
29
|
IDeltaManager,
|
|
31
30
|
ReadOnlyInfo,
|
|
31
|
+
type ILoader,
|
|
32
32
|
} from "@fluidframework/container-definitions/internal";
|
|
33
33
|
import {
|
|
34
34
|
FluidObject,
|
|
@@ -67,6 +67,7 @@ import {
|
|
|
67
67
|
ISequencedDocumentMessage,
|
|
68
68
|
ISignalMessage,
|
|
69
69
|
type ConnectionMode,
|
|
70
|
+
type IContainerPackageInfo,
|
|
70
71
|
} from "@fluidframework/driver-definitions/internal";
|
|
71
72
|
import {
|
|
72
73
|
getSnapshotTree,
|
|
@@ -718,6 +719,14 @@ export class Container
|
|
|
718
719
|
return this._loadedCodeDetails;
|
|
719
720
|
}
|
|
720
721
|
|
|
722
|
+
/**
|
|
723
|
+
* Get the package info for the code details that were used to load the container.
|
|
724
|
+
* @returns The package info for the code details that were used to load the container if it is loaded, undefined otherwise
|
|
725
|
+
*/
|
|
726
|
+
public getContainerPackageInfo?(): IContainerPackageInfo | undefined {
|
|
727
|
+
return getPackageName(this._loadedCodeDetails);
|
|
728
|
+
}
|
|
729
|
+
|
|
721
730
|
private _loadedModule: IFluidModuleWithDetails | undefined;
|
|
722
731
|
|
|
723
732
|
/**
|
|
@@ -2394,7 +2403,7 @@ export class Container
|
|
|
2394
2403
|
|
|
2395
2404
|
// The relative loader will proxy requests to '/' to the loader itself assuming no non-cache flags
|
|
2396
2405
|
// are set. Global requests will still go directly to the loader
|
|
2397
|
-
const maybeLoader: FluidObject<
|
|
2406
|
+
const maybeLoader: FluidObject<ILoader> = this.scope;
|
|
2398
2407
|
const loader = new RelativeLoader(this, maybeLoader.ILoader);
|
|
2399
2408
|
|
|
2400
2409
|
const loadCodeResult = await PerformanceEvent.timedExecAsync(
|