@fluidframework/container-definitions 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.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/.eslintrc.js +18 -19
- package/README.md +5 -5
- package/api-extractor.json +2 -2
- package/dist/audience.d.ts +3 -3
- package/dist/audience.d.ts.map +1 -1
- package/dist/audience.js.map +1 -1
- package/dist/browserPackage.d.ts.map +1 -1
- package/dist/browserPackage.js +3 -3
- package/dist/browserPackage.js.map +1 -1
- package/dist/deltas.d.ts.map +1 -1
- package/dist/deltas.js.map +1 -1
- package/dist/error.d.ts +13 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/fluidModule.d.ts.map +1 -1
- package/dist/fluidModule.js.map +1 -1
- package/dist/fluidPackage.d.ts.map +1 -1
- package/dist/fluidPackage.js +5 -6
- package/dist/fluidPackage.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 +9 -2
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/runtime.d.ts +12 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/tokenProvider.d.ts +9 -0
- package/dist/tokenProvider.d.ts.map +1 -1
- package/dist/tokenProvider.js +3 -0
- package/dist/tokenProvider.js.map +1 -1
- package/lib/audience.d.ts +3 -3
- package/lib/audience.d.ts.map +1 -1
- package/lib/audience.js.map +1 -1
- package/lib/browserPackage.d.ts.map +1 -1
- package/lib/browserPackage.js +3 -3
- package/lib/browserPackage.js.map +1 -1
- package/lib/deltas.d.ts.map +1 -1
- package/lib/deltas.js.map +1 -1
- package/lib/error.d.ts +13 -0
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/fluidModule.d.ts.map +1 -1
- package/lib/fluidModule.js.map +1 -1
- package/lib/fluidPackage.d.ts.map +1 -1
- package/lib/fluidPackage.js +5 -6
- package/lib/fluidPackage.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/loader.d.ts +9 -2
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js.map +1 -1
- package/lib/runtime.d.ts +12 -2
- package/lib/runtime.d.ts.map +1 -1
- package/lib/runtime.js.map +1 -1
- package/lib/tokenProvider.d.ts +9 -0
- package/lib/tokenProvider.d.ts.map +1 -1
- package/lib/tokenProvider.js +3 -0
- package/lib/tokenProvider.js.map +1 -1
- package/package.json +34 -33
- package/prettier.config.cjs +1 -1
- package/src/audience.ts +25 -22
- package/src/browserPackage.ts +33 -34
- package/src/deltas.ts +267 -257
- package/src/error.ts +71 -58
- package/src/fluidModule.ts +1 -1
- package/src/fluidPackage.ts +86 -84
- package/src/index.ts +51 -47
- package/src/loader.ts +505 -507
- package/src/runtime.ts +160 -149
- package/src/tokenProvider.ts +11 -2
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +8 -12
package/.eslintrc.js
CHANGED
|
@@ -4,24 +4,23 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
],
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: ["./tsconfig.json", "./src/test/types/tsconfig.json"],
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
// This library is used in the browser, so we don't want dependencies on most node libraries.
|
|
14
|
+
"import/no-nodejs-modules": ["error", { allow: ["events"] }],
|
|
15
|
+
},
|
|
16
|
+
overrides: [
|
|
17
|
+
{
|
|
18
|
+
// Rules only for test files
|
|
19
|
+
files: ["*.spec.ts", "src/test/**"],
|
|
20
|
+
rules: {
|
|
21
|
+
// Test files are run in node only so additional node libraries can be used.
|
|
22
|
+
"import/no-nodejs-modules": ["error", { allow: ["assert", "events"] }],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
],
|
|
27
26
|
};
|
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ This package contains the interfaces and types concerning the Loader and loading
|
|
|
4
4
|
|
|
5
5
|
Some important interfaces in here include:
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
which allows the code supporting the running Container to be swapped out during a session.
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
- **ILoader, IContainer** - Interfaces allowing the Host to load and interact with a Container
|
|
8
|
+
- **IContainerContext** - Proxy between the Host and the running instance of a Container,
|
|
9
|
+
which allows the code supporting the running Container to be swapped out during a session.
|
|
10
|
+
- **IRuntime / IRuntimeFactory** - Contract necessary for the ContainerContext to "boot" a Container at runtime.
|
|
11
|
+
- **IDeltaManager / IDeltaQueue** - Abstraction over the Container's view of the ops being transmitted to/from storage.
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-common-strict.json"
|
|
4
4
|
}
|
package/dist/audience.d.ts
CHANGED
|
@@ -13,9 +13,9 @@ export interface IAudienceOwner extends IAudience {
|
|
|
13
13
|
*/
|
|
14
14
|
addMember(clientId: string, details: IClient): void;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* Removes a client from the audience. Only emits an event if a client is actually removed
|
|
17
|
+
* @returns if a client was removed from the audience
|
|
18
|
+
*/
|
|
19
19
|
removeMember(clientId: string): boolean;
|
|
20
20
|
}
|
|
21
21
|
/**
|
package/dist/audience.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAChD;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEpD;;;OAGG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC9C;;OAEG;IACH,EAAE,CACD,KAAK,EAAE,WAAW,GAAG,cAAc,EACnC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,GACnD,IAAI,CAAC;IAER;;OAEG;IACH,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACjD"}
|
package/dist/audience.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audience.js","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Manages the state and the members for {@link IAudience}\n */\nexport interface IAudienceOwner extends IAudience {\n
|
|
1
|
+
{"version":3,"file":"audience.js","sourceRoot":"","sources":["../src/audience.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventEmitter } from \"events\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Manages the state and the members for {@link IAudience}\n */\nexport interface IAudienceOwner extends IAudience {\n\t/**\n\t * Adds a new client to the audience\n\t */\n\taddMember(clientId: string, details: IClient): void;\n\n\t/**\n\t * Removes a client from the audience. Only emits an event if a client is actually removed\n\t * @returns if a client was removed from the audience\n\t */\n\tremoveMember(clientId: string): boolean;\n}\n\n/**\n * Audience represents all clients connected to the op stream, both read-only and read/write.\n *\n * See {@link https://nodejs.org/api/events.html#class-eventemitter | here} for an overview of the `EventEmitter`\n * class.\n */\nexport interface IAudience extends EventEmitter {\n\t/**\n\t * See {@link https://nodejs.dev/learn/the-nodejs-event-emitter | here} for an overview of `EventEmitter.on`.\n\t */\n\ton(\n\t\tevent: \"addMember\" | \"removeMember\",\n\t\tlistener: (clientId: string, client: IClient) => void,\n\t): this;\n\n\t/**\n\t * List all clients connected to the op stream, keyed off their clientId\n\t */\n\tgetMembers(): Map<string, IClient>;\n\n\t/**\n\t * Get details about the connected client with the specified clientId,\n\t * or undefined if the specified client isn't connected\n\t */\n\tgetMember(clientId: string): IClient | undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserPackage.d.ts","sourceRoot":"","sources":["../src/browserPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAkB,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;
|
|
1
|
+
{"version":3,"file":"browserPackage.d.ts","sourceRoot":"","sources":["../src/browserPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAkB,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAChF;;;OAGG;IACH,GAAG,EAAE;QACJ;;;WAGG;QACH,KAAK,EAAE,MAAM,EAAE,CAAC;QAEhB;;;WAGG;QACH,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IAC1D;;OAEG;IACH,KAAK,EAAE;QACN;;WAEG;QACH,OAAO,EAAE,+BAA+B,CAAC;QACzC;;WAEG;QACH,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB,CAAC;KAChD,CAAC;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,aAAc,GAAG,+CAGC,CAAC"}
|
package/dist/browserPackage.js
CHANGED
|
@@ -12,9 +12,9 @@ const fluidPackage_1 = require("./fluidPackage");
|
|
|
12
12
|
*/
|
|
13
13
|
const isFluidBrowserPackage = (maybePkg) => {
|
|
14
14
|
var _a, _b, _c, _d, _e, _f;
|
|
15
|
-
return (0, fluidPackage_1.isFluidPackage)(maybePkg)
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
return (0, fluidPackage_1.isFluidPackage)(maybePkg) &&
|
|
16
|
+
typeof ((_c = (_b = (_a = maybePkg === null || maybePkg === void 0 ? void 0 : maybePkg.fluid) === null || _a === void 0 ? void 0 : _a.browser) === null || _b === void 0 ? void 0 : _b.umd) === null || _c === void 0 ? void 0 : _c.library) === "string" &&
|
|
17
|
+
Array.isArray((_f = (_e = (_d = maybePkg === null || maybePkg === void 0 ? void 0 : maybePkg.fluid) === null || _d === void 0 ? void 0 : _d.browser) === null || _e === void 0 ? void 0 : _e.umd) === null || _f === void 0 ? void 0 : _f.files);
|
|
18
18
|
};
|
|
19
19
|
exports.isFluidBrowserPackage = isFluidBrowserPackage;
|
|
20
20
|
//# sourceMappingURL=browserPackage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserPackage.js","sourceRoot":"","sources":["../src/browserPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAAyF;
|
|
1
|
+
{"version":3,"file":"browserPackage.js","sourceRoot":"","sources":["../src/browserPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAAyF;AA4CzF;;;GAGG;AACI,MAAM,qBAAqB,GAAG,CAAC,QAAa,EAA8C,EAAE;;IAClG,OAAA,IAAA,6BAAc,EAAC,QAAQ,CAAC;QACxB,OAAO,CAAA,MAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,0CAAE,OAAO,0CAAE,GAAG,0CAAE,OAAO,CAAA,KAAK,QAAQ;QAC1D,KAAK,CAAC,OAAO,CAAC,MAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,0CAAE,OAAO,0CAAE,GAAG,0CAAE,KAAK,CAAC,CAAA;CAAA,CAAC;AAHxC,QAAA,qBAAqB,yBAGmB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidPackage, isFluidPackage, IFluidPackageEnvironment } from \"./fluidPackage\";\n\n/**\n * A specific Fluid package environment for browsers\n */\nexport interface IFluidBrowserPackageEnvironment extends IFluidPackageEnvironment {\n\t/**\n\t * The Universal Module Definition (umd) target specifics the scripts necessary for\n\t * loading a packages in a browser environment and finding its entry point.\n\t */\n\tumd: {\n\t\t/**\n\t\t * The bundled js files for loading this package.\n\t\t * These files will be loaded and executed in order.\n\t\t */\n\t\tfiles: string[];\n\n\t\t/**\n\t\t * The global name that the script entry points will be exposed.\n\t\t * This entry point should be an {@link @fluidframework/container-definitions#IFluidModule}.\n\t\t */\n\t\tlibrary: string;\n\t};\n}\n\n/**\n * A Fluid package for specification for browser environments\n */\nexport interface IFluidBrowserPackage extends IFluidPackage {\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IFluidPackage.fluid}\n\t */\n\tfluid: {\n\t\t/**\n\t\t * The browser specific package information for this package\n\t\t */\n\t\tbrowser: IFluidBrowserPackageEnvironment;\n\t\t/**\n\t\t * {@inheritDoc @fluidframework/core-interfaces#IFluidPackage.fluid.environment}\n\t\t */\n\t\t[environment: string]: IFluidPackageEnvironment;\n\t};\n}\n\n/**\n * Determines if any object is an IFluidBrowserPackage\n * @param maybePkg - The object to check for compatibility with IFluidBrowserPackage\n */\nexport const isFluidBrowserPackage = (maybePkg: any): maybePkg is Readonly<IFluidBrowserPackage> =>\n\tisFluidPackage(maybePkg) &&\n\ttypeof maybePkg?.fluid?.browser?.umd?.library === \"string\" &&\n\tArray.isArray(maybePkg?.fluid?.browser?.umd?.files);\n"]}
|
package/dist/deltas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltas.d.ts","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"deltas.d.ts","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,cAAc,EACd,MAAM,EACN,WAAW,EACX,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,YAAY,EACZ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;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;OAEG;IACH,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC;IAEtB;;OAEG;IACH,OAAO,IAAI,CAAC,EAAE,CAAC;IAEf;;;OAGG;IACH,sBAAsB,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACvE;AAED,oBAAY,YAAY,GACrB;IACA,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;CACpC,GACD;IACA,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC7B,CAAC"}
|
package/dist/deltas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas.\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n\n /**\n * @deprecated No replacement API recommended.\n */\n existing: boolean;\n\n /**\n * @deprecated No replacement API recommended.\n */\n mode: ConnectionMode;\n\n /**\n * @deprecated No replacement API recommended.\n */\n version: string;\n\n /**\n * @deprecated No replacement API recommended.\n */\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n\n /**\n * Last known sequence number to ordering service at the time of connection.\n *\n * @remarks\n *\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's the best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/**\n * Events emitted by {@link IDeltaManager}.\n */\nexport interface IDeltaManagerEvents extends IEvent {\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n\n /**\n * Emitted immediately after processing an incoming operation (op).\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IDeltaManager}.\n *\n * Listener parameters:\n *\n * - `message`: The op that was processed.\n *\n * - `processingTime`: The amount of time it took to process the inbound operation (op), expressed in milliseconds.\n */\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"allSentOpsAckd\", listener: () => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"pong\", listener: (latency: number) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"processTime\", listener: (latency: number) => void);\n\n /**\n * Emitted when the {@link IDeltaManager} completes connecting to the Fluid service.\n *\n * @remarks\n * This occurs once we've received the connect_document_success message from the server,\n * and happens prior to the client's join message (if there is a join message).\n *\n * Listener parameters:\n *\n * - `details`: Connection metadata.\n *\n * - `opsBehind`: An estimate of far behind the client is relative to the service in terms of ops.\n * Will not be specified if an estimate cannot be determined.\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n\n /**\n * Emitted when the {@link IDeltaManager} becomes disconnected from the Fluid service.\n *\n * @remarks Listener parameters:\n *\n * - `reason`: Describes the reason for which the delta manager was disconnected.\n */\n (event: \"disconnect\", listener: (reason: string) => void);\n\n /**\n * Emitted when read/write permissions change.\n *\n * @remarks Listener parameters:\n *\n * - `readonly`: Whether or not the delta manager is now read-only.\n */\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/**\n * Events emitted by {@link IDeltaQueue}.\n */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n /**\n * Emitted when a task is enqueued.\n *\n * @remarks Listener parameters:\n *\n * - `task`: The task being enqueued.\n */\n (event: \"push\", listener: (task: T) => void);\n\n /**\n * Emitted immediately after processing an enqueued task and removing it from the queue.\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IDeltaQueue}.\n *\n * Listener parameters:\n *\n * - `task`: The task that was processed.\n */\n (event: \"op\", listener: (task: T) => void);\n\n /**\n * Emitted when the queue of tasks to process is emptied.\n *\n * @remarks Listener parameters:\n *\n * - `count`: The number of events (`T`) processed before becoming idle.\n *\n * - `duration`: The amount of time it took to process elements (in milliseconds).\n *\n * @see {@link IDeltaQueue.idle}\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle.\n * I.e. there are no remaining messages to processes.\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue.\n *\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n /**\n * returns number of ops processed and time it took to process these ops.\n * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)\n */\n waitTillProcessingDone(): Promise<{ count: number; duration: number; }>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDisposable,\n\tIEventProvider,\n\tIEvent,\n\tIErrorEvent,\n} from \"@fluidframework/common-definitions\";\nimport {\n\tConnectionMode,\n\tIClientConfiguration,\n\tIClientDetails,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas.\n */\nexport interface IConnectionDetails {\n\tclientId: string;\n\tclaims: ITokenClaims;\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\texisting: boolean;\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\tmode: ConnectionMode;\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\tversion: string;\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\tinitialClients: ISignalClient[];\n\tserviceConfiguration: IClientConfiguration;\n\n\t/**\n\t * Last known sequence number to ordering service at the time of connection.\n\t *\n\t * @remarks\n\t *\n\t * It may lap actual last sequence number (quite a bit, if container is very active).\n\t * But it's the best information for client to figure out how far it is behind, at least\n\t * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n\t * that is likely to be more up-to-date.\n\t */\n\tcheckpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n\t/**\n\t * Processes the message.\n\t */\n\tprocess: (message: ISequencedDocumentMessage) => void;\n\n\t/**\n\t * Processes the signal.\n\t */\n\tprocessSignal: (message: ISignalMessage) => void;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender {\n\t/**\n\t * Flush all pending messages through the outbound queue\n\t */\n\tflush(): void;\n}\n\n/**\n * Events emitted by {@link IDeltaManager}.\n */\nexport interface IDeltaManagerEvents extends IEvent {\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n\n\t/**\n\t * Emitted immediately after processing an incoming operation (op).\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IDeltaManager}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `message`: The op that was processed.\n\t *\n\t * - `processingTime`: The amount of time it took to process the inbound operation (op), expressed in milliseconds.\n\t */\n\t(event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"allSentOpsAckd\", listener: () => void);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"pong\", listener: (latency: number) => void);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"processTime\", listener: (latency: number) => void);\n\n\t/**\n\t * Emitted when the {@link IDeltaManager} completes connecting to the Fluid service.\n\t *\n\t * @remarks\n\t * This occurs once we've received the connect_document_success message from the server,\n\t * and happens prior to the client's join message (if there is a join message).\n\t *\n\t * Listener parameters:\n\t *\n\t * - `details`: Connection metadata.\n\t *\n\t * - `opsBehind`: An estimate of far behind the client is relative to the service in terms of ops.\n\t * Will not be specified if an estimate cannot be determined.\n\t */\n\t(event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n\n\t/**\n\t * Emitted when the {@link IDeltaManager} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `reason`: Describes the reason for which the delta manager was disconnected.\n\t */\n\t(event: \"disconnect\", listener: (reason: string) => void);\n\n\t/**\n\t * Emitted when read/write permissions change.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `readonly`: Whether or not the delta manager is now read-only.\n\t */\n\t(event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U>\n\textends IEventProvider<IDeltaManagerEvents>,\n\t\tIDeltaSender,\n\t\tIDisposable {\n\t/** The queue of inbound delta messages */\n\treadonly inbound: IDeltaQueue<T>;\n\n\t/** The queue of outbound delta messages */\n\treadonly outbound: IDeltaQueue<U[]>;\n\n\t/** The queue of inbound delta signals */\n\treadonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n\t/** The current minimum sequence number */\n\treadonly minimumSequenceNumber: number;\n\n\t/** The last sequence number processed by the delta manager */\n\treadonly lastSequenceNumber: number;\n\n\t/** The last message processed by the delta manager */\n\treadonly lastMessage: ISequencedDocumentMessage | undefined;\n\n\t/** The latest sequence number the delta manager is aware of */\n\treadonly lastKnownSeqNumber: number;\n\n\t/** The initial sequence number set when attaching the op handler */\n\treadonly initialSequenceNumber: number;\n\n\t/**\n\t * Tells if current connection has checkpoint information.\n\t * I.e. we know how far behind the client was at the time of establishing connection\n\t */\n\treadonly hasCheckpointSequenceNumber: boolean;\n\n\t/** Details of client */\n\treadonly clientDetails: IClientDetails;\n\n\t/** Protocol version being used to communicate with the service */\n\treadonly version: string;\n\n\t/** Max message size allowed to the delta manager */\n\treadonly maxMessageSize: number;\n\n\t/** Service configuration provided by the service. */\n\treadonly serviceConfiguration: IClientConfiguration | undefined;\n\n\t/** Flag to indicate whether the client can write or not. */\n\treadonly active: boolean;\n\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t/** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n\tsubmitSignal(content: any): void;\n}\n\n/**\n * Events emitted by {@link IDeltaQueue}.\n */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n\t/**\n\t * Emitted when a task is enqueued.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `task`: The task being enqueued.\n\t */\n\t(event: \"push\", listener: (task: T) => void);\n\n\t/**\n\t * Emitted immediately after processing an enqueued task and removing it from the queue.\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IDeltaQueue}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `task`: The task that was processed.\n\t */\n\t(event: \"op\", listener: (task: T) => void);\n\n\t/**\n\t * Emitted when the queue of tasks to process is emptied.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `count`: The number of events (`T`) processed before becoming idle.\n\t *\n\t * - `duration`: The amount of time it took to process elements (in milliseconds).\n\t *\n\t * @see {@link IDeltaQueue.idle}\n\t */\n\t(event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n\t/**\n\t * Flag indicating whether or not the queue was paused\n\t */\n\tpaused: boolean;\n\n\t/**\n\t * The number of messages remaining in the queue\n\t */\n\tlength: number;\n\n\t/**\n\t * Flag indicating whether or not the queue is idle.\n\t * I.e. there are no remaining messages to processes.\n\t */\n\tidle: boolean;\n\n\t/**\n\t * Pauses processing on the queue.\n\t *\n\t * @returns A promise which resolves when processing has been paused.\n\t */\n\tpause(): Promise<void>;\n\n\t/**\n\t * Resumes processing on the queue\n\t */\n\tresume(): void;\n\n\t/**\n\t * Peeks at the next message in the queue\n\t */\n\tpeek(): T | undefined;\n\n\t/**\n\t * Returns all the items in the queue as an array. Does not remove them from the queue.\n\t */\n\ttoArray(): T[];\n\n\t/**\n\t * returns number of ops processed and time it took to process these ops.\n\t * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)\n\t */\n\twaitTillProcessingDone(): Promise<{ count: number; duration: number }>;\n}\n\nexport type ReadOnlyInfo =\n\t| {\n\t\t\treadonly readonly: false | undefined;\n\t }\n\t| {\n\t\t\treadonly readonly: true;\n\t\t\t/** read-only because forceReadOnly() was called */\n\t\t\treadonly forced: boolean;\n\t\t\t/** read-only because client does not have write permissions for document */\n\t\t\treadonly permissions: boolean | undefined;\n\t\t\t/** read-only with no delta stream connection */\n\t\t\treadonly storageOnly: boolean;\n\t };\n"]}
|
package/dist/error.d.ts
CHANGED
|
@@ -73,6 +73,19 @@ export interface ContainerWarning extends IErrorBase {
|
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Represents errors raised on container.
|
|
76
|
+
*
|
|
77
|
+
* @see
|
|
78
|
+
*
|
|
79
|
+
* The following are commonly thrown error types, but `errorType` could be any string.
|
|
80
|
+
*
|
|
81
|
+
* - {@link @fluidframework/container-definitions#ContainerErrorType}
|
|
82
|
+
*
|
|
83
|
+
* - {@link @fluidframework/driver-definitions#DriverErrorType}
|
|
84
|
+
*
|
|
85
|
+
* - {@link @fluidframework/odsp-driver-definitions#OdspErrorType}
|
|
86
|
+
*
|
|
87
|
+
* - {@link @fluidframework/routerlicious-driver#RouterliciousErrorType}
|
|
88
|
+
*
|
|
76
89
|
*/
|
|
77
90
|
export declare type ICriticalContainerError = IErrorBase;
|
|
78
91
|
/**
|
package/dist/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;GAEG;AACH,oBAA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WAAW,kBAAmB,SAAQ,UAAU;IACrD,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,eAAe,CAAC;IACvD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC"}
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,IAAY,kBA+BX;AA/BD,WAAY,kBAAkB;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,IAAY,kBA+BX;AA/BD,WAAY,kBAAkB;IAC7B;;OAEG;IACH,mDAA6B,CAAA;IAE7B;;OAEG;IACH,yDAAmC,CAAA;IAEnC;;OAEG;IACH,iEAA2C,CAAA;IAE3C;;OAEG;IACH,iEAA2C,CAAA;IAE3C;;OAEG;IACH,+CAAyB,CAAA;IAEzB;;;OAGG;IACH,6EAAuD,CAAA;AACxD,CAAC,EA/BW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QA+B7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\n\n/**\n * Different error types the Container may report out to the Host\n */\nexport enum ContainerErrorType {\n\t/**\n\t * Some error, most likely an exception caught by runtime and propagated to container as critical error\n\t */\n\tgenericError = \"genericError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError = \"throttlingError\",\n\n\t/**\n\t * Data loss error detected by Container / DeltaManager. Likely points to storage issue.\n\t */\n\tdataCorruptionError = \"dataCorruptionError\",\n\n\t/**\n\t * Error encountered when processing an operation. May correlate with data corruption.\n\t */\n\tdataProcessingError = \"dataProcessingError\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t */\n\tusageError = \"usageError\",\n\n\t/**\n\t * Error indicating an client session has expired. Currently this only happens when GC is allowed on a document and\n\t * aids in safely deleting unused objects.\n\t */\n\tclientSessionExpiredError = \"clientSessionExpiredError\",\n}\n\n/**\n * Base interface for all errors and warnings at container level\n */\nexport interface IErrorBase extends Partial<Error> {\n\t/** errorType is a union of error types from\n\t * - container\n\t * - runtime\n\t * - drivers\n\t */\n\treadonly errorType: string;\n\n\t/**\n\t * See Error.message\n\t * Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)\n\t * If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result\n\t * of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.\n\t */\n\treadonly message: string;\n\t/** See Error.name */\n\treadonly name?: string;\n\t/** See Error.stack */\n\treadonly stack?: string;\n\t/**\n\t * Returns all properties of this error object that are either safe to log\n\t * or explicitly tagged as containing privacy-sensitive data.\n\t */\n\tgetTelemetryProperties?(): ITelemetryProperties;\n}\n\n/**\n * Represents warnings raised on container.\n */\nexport interface ContainerWarning extends IErrorBase {\n\t/**\n\t * Whether this error has already been logged. Used to avoid logging errors twice.\n\t *\n\t * @defaultValue `false`\n\t */\n\tlogged?: boolean;\n}\n\n/**\n * Represents errors raised on container.\n *\n * @see\n *\n * The following are commonly thrown error types, but `errorType` could be any string.\n *\n * - {@link @fluidframework/container-definitions#ContainerErrorType}\n *\n * - {@link @fluidframework/driver-definitions#DriverErrorType}\n *\n * - {@link @fluidframework/odsp-driver-definitions#OdspErrorType}\n *\n * - {@link @fluidframework/routerlicious-driver#RouterliciousErrorType}\n *\n */\nexport type ICriticalContainerError = IErrorBase;\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n */\nexport interface IGenericError extends IErrorBase {\n\treadonly errorType: ContainerErrorType.genericError;\n\terror?: any;\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\nexport interface IUsageError extends IErrorBase {\n\treadonly errorType: ContainerErrorType.usageError;\n}\n\n/**\n * Warning emitted when requests to storage are being throttled\n */\nexport interface IThrottlingWarning extends IErrorBase {\n\treadonly errorType: ContainerErrorType.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidModule.d.ts","sourceRoot":"","sources":["../src/fluidModule.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,WAAW,YAAY;
|
|
1
|
+
{"version":3,"file":"fluidModule.d.ts","sourceRoot":"","sources":["../src/fluidModule.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC5B,WAAW,EAAE,WAAW,CAAC,eAAe,GAAG,gCAAgC,CAAC,CAAC;CAC7E"}
|
package/dist/fluidModule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidModule.js","sourceRoot":"","sources":["../src/fluidModule.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\nimport { IProvideFluidCodeDetailsComparer } from \"./fluidPackage\";\nimport { IRuntimeFactory } from \"./runtime\";\n\nexport interface IFluidModule {\n
|
|
1
|
+
{"version":3,"file":"fluidModule.js","sourceRoot":"","sources":["../src/fluidModule.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\nimport { IProvideFluidCodeDetailsComparer } from \"./fluidPackage\";\nimport { IRuntimeFactory } from \"./runtime\";\n\nexport interface IFluidModule {\n\tfluidExport: FluidObject<IRuntimeFactory & IProvideFluidCodeDetailsComparer>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidPackage.d.ts","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,wBAAwB;
|
|
1
|
+
{"version":3,"file":"fluidPackage.d.ts","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,CAAC,MAAM,EAAE,MAAM,GACZ,SAAS,GACT;QACA;;;;WAIG;QACH,KAAK,EAAE,MAAM,EAAE,CAAC;QAEhB;;;;WAIG;QACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB,CAAC;CACL;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE;QACN;;;WAGG;QACH,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,wBAAwB,CAAC;KAC5D,CAAC;IACF;;;;OAIG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAS,GAAG,mCACoD,CAAC;AAE5F;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEnD;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAC1C;AAED,eAAO,MAAM,kBAAkB,YAAa,OAAO,2CAQlD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,gCAClB,CAAC;AAE7B,MAAM,WAAW,gCAAgC;IAChD,QAAQ,CAAC,yBAAyB,EAAE,yBAAyB,CAAC;CAC9D;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,gCAAgC;IAClF;;;;;OAKG;IACH,SAAS,CAAC,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzF;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACjF"}
|
package/dist/fluidPackage.js
CHANGED
|
@@ -9,15 +9,14 @@ exports.IFluidCodeDetailsComparer = exports.isFluidCodeDetails = exports.isFluid
|
|
|
9
9
|
* Check if the package.json defines a Fluid package
|
|
10
10
|
* @param pkg - the package json data to check if it is a Fluid package.
|
|
11
11
|
*/
|
|
12
|
-
const isFluidPackage = (pkg) => typeof pkg === "object"
|
|
13
|
-
&& typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string"
|
|
14
|
-
&& typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
|
|
12
|
+
const isFluidPackage = (pkg) => typeof pkg === "object" && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.name) === "string" && typeof (pkg === null || pkg === void 0 ? void 0 : pkg.fluid) === "object";
|
|
15
13
|
exports.isFluidPackage = isFluidPackage;
|
|
16
14
|
const isFluidCodeDetails = (details) => {
|
|
17
15
|
const maybeCodeDetails = details;
|
|
18
|
-
return typeof maybeCodeDetails === "object"
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
return (typeof maybeCodeDetails === "object" &&
|
|
17
|
+
(typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package) === "string" ||
|
|
18
|
+
(0, exports.isFluidPackage)(maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.package)) &&
|
|
19
|
+
((maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === undefined || typeof (maybeCodeDetails === null || maybeCodeDetails === void 0 ? void 0 : maybeCodeDetails.config) === "object"));
|
|
21
20
|
};
|
|
22
21
|
exports.isFluidCodeDetails = isFluidCodeDetails;
|
|
23
22
|
exports.IFluidCodeDetailsComparer = "IFluidCodeDetailsComparer";
|
package/dist/fluidPackage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"fluidPackage.js","sourceRoot":"","sources":["../src/fluidPackage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0DH;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAkC,EAAE,CAC1E,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAA,KAAK,QAAQ,IAAI,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAA,KAAK,QAAQ,CAAC;AAD/E,QAAA,cAAc,kBACiE;AA4BrF,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAA0C,EAAE;IAC9F,MAAM,gBAAgB,GAAG,OAAiD,CAAC;IAC3E,OAAO,CACN,OAAO,gBAAgB,KAAK,QAAQ;QACpC,CAAC,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAA,KAAK,QAAQ;YAC7C,IAAA,sBAAc,EAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,CAAC,CAAC;QAC3C,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,SAAS,IAAI,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,CAAA,KAAK,QAAQ,CAAC,CACxF,CAAC;AACH,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B;AAEW,QAAA,yBAAyB,GACrC,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Specifies an environment on Fluid property of a IFluidPackage.\n */\nexport interface IFluidPackageEnvironment {\n\t/**\n\t * The name of the target. For a browser environment, this could be umd for scripts\n\t * or css for styles.\n\t */\n\t[target: string]:\n\t\t| undefined\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * List of files for the target. These can be relative or absolute.\n\t\t\t\t * The code loader should resolve relative paths, and validate all\n\t\t\t\t * full urls.\n\t\t\t\t */\n\t\t\t\tfiles: string[];\n\n\t\t\t\t/**\n\t\t\t\t * General access for extended fields as specific usages will\n\t\t\t\t * likely have additional infornamation like a definition\n\t\t\t\t * of Library, the entrypoint for umd packages.\n\t\t\t\t */\n\t\t\t\t[key: string]: unknown;\n\t\t };\n}\n\n/**\n * Fluid-specific properties expected on a package to be loaded by the code loader.\n * While compatible with the npm package format it is not necessary that that package is an\n * npm package:\n * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}\n */\nexport interface IFluidPackage {\n\t/**\n\t * The name of the package that this code represnets\n\t */\n\tname: string;\n\t/**\n\t * This object represents the Fluid specific properties of the package\n\t */\n\tfluid: {\n\t\t/**\n\t\t * The name of the of the environment. This should be something like browser, or node\n\t\t * and contain the necessary targets for loading this code in that environment.\n\t\t */\n\t\t[environment: string]: undefined | IFluidPackageEnvironment;\n\t};\n\t/**\n\t * General access for extended fields as specific usages will\n\t * likely have additional infornamation like a definition of\n\t * compatible versions, or deployment information like rings or rollouts.\n\t */\n\t[key: string]: unknown;\n}\n\n/**\n * Check if the package.json defines a Fluid package\n * @param pkg - the package json data to check if it is a Fluid package.\n */\nexport const isFluidPackage = (pkg: any): pkg is Readonly<IFluidPackage> =>\n\ttypeof pkg === \"object\" && typeof pkg?.name === \"string\" && typeof pkg?.fluid === \"object\";\n\n/**\n * Package manager configuration. Provides a key value mapping of config values\n */\nexport interface IFluidCodeDetailsConfig {\n\treadonly [key: string]: string;\n}\n\n/**\n * Data structure used to describe the code to load on the Fluid document\n */\nexport interface IFluidCodeDetails {\n\t/**\n\t * The code package to be used on the Fluid document. This is either the package name which will be loaded\n\t * from a package manager. Or the expanded Fluid package.\n\t */\n\treadonly package: string | Readonly<IFluidPackage>;\n\n\t/**\n\t * Configuration details. This includes links to the package manager and base CDNs.\n\t *\n\t * @remarks This is strictly consumer-defined data.\n\t * Its contents and semantics (including whether or not this data is present) are completely up to the consumer.\n\t */\n\treadonly config?: IFluidCodeDetailsConfig;\n}\n\nexport const isFluidCodeDetails = (details: unknown): details is Readonly<IFluidCodeDetails> => {\n\tconst maybeCodeDetails = details as Partial<IFluidCodeDetails> | undefined;\n\treturn (\n\t\ttypeof maybeCodeDetails === \"object\" &&\n\t\t(typeof maybeCodeDetails?.package === \"string\" ||\n\t\t\tisFluidPackage(maybeCodeDetails?.package)) &&\n\t\t(maybeCodeDetails?.config === undefined || typeof maybeCodeDetails?.config === \"object\")\n\t);\n};\n\nexport const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer =\n\t\"IFluidCodeDetailsComparer\";\n\nexport interface IProvideFluidCodeDetailsComparer {\n\treadonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;\n}\n\n/**\n * Provides capability to compare Fluid code details.\n */\nexport interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {\n\t/**\n\t * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.\n\t *\n\t * Similar semantics to:\n\t * {@link https://github.com/npm/node-semver#usage}\n\t */\n\tsatisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * Return a number representing the ascending sort order of the `a` and `b` code details:\n\t *\n\t * - `< 0` if `a < b`.\n\t *\n\t * - `= 0` if `a === b`.\n\t *\n\t * - `> 0` if `a > b`.\n\t *\n\t * - `undefined` if `a` is not comparable to `b`.\n\t *\n\t * Similar semantics to:\n\t * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}\n\t */\n\tcompare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
export { IAudience, IAudienceOwner } from "./audience";
|
|
11
|
-
export { IFluidBrowserPackage, IFluidBrowserPackageEnvironment, isFluidBrowserPackage } from "./browserPackage";
|
|
11
|
+
export { IFluidBrowserPackage, IFluidBrowserPackageEnvironment, isFluidBrowserPackage, } from "./browserPackage";
|
|
12
12
|
export { IConnectionDetails, IDeltaHandlerStrategy, IDeltaManager, IDeltaManagerEvents, IDeltaSender, IDeltaQueue, IDeltaQueueEvents, ReadOnlyInfo, } from "./deltas";
|
|
13
13
|
export { ContainerErrorType, ContainerWarning, ICriticalContainerError, IErrorBase, IGenericError, IUsageError, IThrottlingWarning, } from "./error";
|
|
14
14
|
export { ConnectionState, ICodeAllowList, ICodeDetailsLoader, IContainer, IContainerEvents, IContainerLoadMode, IFluidCodeResolver, IFluidModuleWithDetails, IHostLoader, ILoader, ILoaderHeader, ILoaderOptions, IPendingLocalState, IProvideLoader, IResolvedFluidCodeDetails, ISnapshotTreeWithBlobContents, LoaderHeader, } from "./loader";
|
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;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EACN,oBAAoB,EACpB,+BAA+B,EAC/B,qBAAqB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,OAAO,EACP,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,6BAA6B,EAC7B,YAAY,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,gCAAgC,EAChC,cAAc,EACd,kBAAkB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,QAAQ,EACR,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,mDAI0B;AADzB,uHAAA,qBAAqB,OAAA;AAYtB,iCAQiB;AAPhB,2GAAA,kBAAkB,OAAA;AAQnB,mCAkBkB;AADjB,sGAAA,YAAY,OAAA;AAGb,+CASwB;AALvB,yHAAA,yBAAyB,OAAA;AAGzB,8GAAA,cAAc,OAAA;AACd,kHAAA,kBAAkB,OAAA;AAEnB,qCAOmB;AANlB,sGAAA,WAAW,OAAA;AAKX,0GAAA,eAAe,OAAA;AAEhB,iDAAkF;AAAzE,oHAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * This library contains the interfaces and types concerning the `Loader` and loading the `Container`.\n *\n * @packageDocumentation\n */\n\nexport { IAudience, IAudienceOwner } from \"./audience\";\nexport {\n\tIFluidBrowserPackage,\n\tIFluidBrowserPackageEnvironment,\n\tisFluidBrowserPackage,\n} from \"./browserPackage\";\nexport {\n\tIConnectionDetails,\n\tIDeltaHandlerStrategy,\n\tIDeltaManager,\n\tIDeltaManagerEvents,\n\tIDeltaSender,\n\tIDeltaQueue,\n\tIDeltaQueueEvents,\n\tReadOnlyInfo,\n} from \"./deltas\";\nexport {\n\tContainerErrorType,\n\tContainerWarning,\n\tICriticalContainerError,\n\tIErrorBase,\n\tIGenericError,\n\tIUsageError,\n\tIThrottlingWarning,\n} from \"./error\";\nexport {\n\tConnectionState,\n\tICodeAllowList,\n\tICodeDetailsLoader,\n\tIContainer,\n\tIContainerEvents,\n\tIContainerLoadMode,\n\tIFluidCodeResolver,\n\tIFluidModuleWithDetails,\n\tIHostLoader,\n\tILoader,\n\tILoaderHeader,\n\tILoaderOptions,\n\tIPendingLocalState,\n\tIProvideLoader,\n\tIResolvedFluidCodeDetails,\n\tISnapshotTreeWithBlobContents,\n\tLoaderHeader,\n} from \"./loader\";\nexport { IFluidModule } from \"./fluidModule\";\nexport {\n\tIFluidPackage,\n\tIFluidPackageEnvironment,\n\tIFluidCodeDetails,\n\tIFluidCodeDetailsComparer,\n\tIFluidCodeDetailsConfig,\n\tIProvideFluidCodeDetailsComparer,\n\tisFluidPackage,\n\tisFluidCodeDetails,\n} from \"./fluidPackage\";\nexport {\n\tAttachState,\n\tIBatchMessage,\n\tIContainerContext,\n\tIProvideRuntimeFactory,\n\tIRuntime,\n\tIRuntimeFactory,\n} from \"./runtime\";\nexport { IFluidTokenProvider, IProvideFluidTokenProvider } from \"./tokenProvider\";\n"]}
|
package/dist/loader.d.ts
CHANGED
|
@@ -73,8 +73,13 @@ export interface IFluidCodeResolver {
|
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Code AllowListing Interface
|
|
76
|
+
*
|
|
77
|
+
* @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.
|
|
76
78
|
*/
|
|
77
79
|
export interface ICodeAllowList {
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.
|
|
82
|
+
*/
|
|
78
83
|
testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;
|
|
79
84
|
}
|
|
80
85
|
/**
|
|
@@ -230,8 +235,8 @@ export declare namespace ConnectionState {
|
|
|
230
235
|
*/
|
|
231
236
|
type EstablishingConnection = 3;
|
|
232
237
|
/**
|
|
233
|
-
|
|
234
|
-
|
|
238
|
+
* The container has an inbound connection only, and is catching up to the latest known state from the service.
|
|
239
|
+
*/
|
|
235
240
|
type CatchingUp = 1;
|
|
236
241
|
/**
|
|
237
242
|
* The container is fully connected and syncing.
|
|
@@ -301,6 +306,8 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
|
|
|
301
306
|
/**
|
|
302
307
|
* Closes the container and returns serialized local state intended to be
|
|
303
308
|
* given to a newly loaded container.
|
|
309
|
+
* @experimental
|
|
310
|
+
* {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}
|
|
304
311
|
*/
|
|
305
312
|
closeAndGetPendingLocalState(): string;
|
|
306
313
|
/**
|
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;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,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,CAAA;KAAE,CAAC;CACzD"}
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2gBH;;GAEG;AACH,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACpB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACvB,CAAC,EAtBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISequencedProposal,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport {\n IFluidCodeDetails,\n IFluidPackage,\n IProvideFluidCodeDetailsComparer,\n} from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n /**\n * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n */\n module: IFluidModule;\n\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 * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n * quorum.\n */\n details: IFluidCodeDetails;\n}\n\n/**\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 can 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 * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n /**\n * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n */\n readonly resolvedPackage: Readonly<IFluidPackage>;\n /**\n * If not undefined, this id will be used to cache the entry point for the code package\n */\n readonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n /**\n * Resolves a Fluid code details into a form that can be loaded.\n * @param details - The Fluid code details to resolve.\n * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n * an optional resolvedPackageCacheId if the loaded package should be cached.\n */\n resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n */\nexport interface ICodeAllowList {\n testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\nexport interface IContainerEvents extends IEvent {\n /**\n * Emitted when the readonly state of the container changes.\n *\n * @remarks Listener parameters:\n *\n * - `readonly`: Whether or not the container is now in a readonly state.\n *\n * @see {@link IContainer.readOnlyInfo}\n */\n (event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n /**\n * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.connect}\n */\n (event: \"connected\", listener: (clientId: string) => void);\n\n /**\n * Fires when new container code details have been proposed, prior to acceptance.\n *\n * @remarks Listener parameters:\n *\n * - `codeDetails`: The code details being proposed.\n *\n * - `proposal`: NOT RECOMMENDED FOR USE.\n *\n * @see {@link IContainer.proposeCodeDetails}\n */\n (event: \"codeDetailsProposed\", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n /**\n * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n *\n * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n *\n * @see\n *\n * - {@link IContainer.connectionState}\n *\n * - {@link IContainer.disconnect}\n */\n (event: \"disconnected\", listener: () => void);\n\n /**\n * Emitted when a {@link AttachState.Detached | detached} container is\n * {@link AttachState.Attached | attached} to the Fluid service.\n *\n * @see\n *\n * - {@link IContainer.attachState}\n *\n * - {@link IContainer.attach}\n */\n (event: \"attached\", listener: () => void);\n\n /**\n * Emitted when the {@link IContainer} is closed, which permanently disables it.\n *\n * @remarks Listener parameters:\n *\n * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n *\n * @see {@link IContainer.close}\n */\n (event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n /**\n * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n *\n * @remarks Listener parameters:\n *\n * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n *\n * @see {@link IContainer.dispose}\n */\n (event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n /**\n * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n * For now, use of this should be avoided when possible.\n *\n * Listener parameters:\n *\n * - `error`: The warning describing the encountered state.\n */\n (event: \"warning\", listener: (error: ContainerWarning) => void);\n\n /**\n * Emitted immediately after processing an incoming operation (op).\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IContainer}.\n *\n * Listener parameters:\n *\n * - `message`: The op that was processed.\n */\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n /**\n * Emitted upon the first local change while the Container is in the \"saved\" state.\n * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"dirty\", listener: (dirty: boolean) => void);\n\n /**\n * Emitted when all local changes/edits have been acknowledged by the service.\n * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n *\n * @remarks Listener parameters:\n *\n * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n *\n * @see {@link IContainer.isDirty}\n */\n (event: \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n /**\n * The container is not connected to the delta server.\n * Note - When in this state the container may be about to reconnect,\n * or may remain disconnected until explicitly told to connect.\n */\n export type Disconnected = 0;\n\n /**\n * The container is disconnected but actively trying to establish a new connection.\n * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n */\n export type EstablishingConnection = 3;\n\n /**\n * The container has an inbound connection only, and is catching up to the latest known state from the service.\n */\n export type CatchingUp = 1;\n\n /**\n * The container is fully connected and syncing.\n */\n export type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n | ConnectionState.Disconnected\n | ConnectionState.EstablishingConnection\n | ConnectionState.CatchingUp\n | ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\n /**\n * The Delta Manager supporting the op stream for this Container\n */\n deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n /**\n * The collection of write clients which were connected as of the current sequence number.\n * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Represents the resolved url to the Container.\n * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n */\n resolvedUrl: IResolvedUrl | undefined;\n\n /**\n * Indicates the attachment state of the container to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Get the code details that are currently specified for the container.\n * @returns The current code details if any are specified, undefined if none are specified.\n */\n getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Get the code details that were used to load the container.\n * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n * loaded.\n */\n getLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n /**\n * Returns true if the container has been closed, otherwise false.\n */\n readonly closed: boolean;\n\n /**\n * Whether or not there are any local changes that have not been saved.\n */\n readonly isDirty: boolean;\n\n /**\n * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n * The container is not expected to be used anymore once it is disposed.\n *\n * @param error - If the container is being disposed due to error, this provides details about the error that\n * resulted in disposing it.\n */\n dispose?(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container.\n *\n * @param error - If the container is being closed due to error, this provides details about the error that\n * resulted in closing it.\n */\n close(error?: ICriticalContainerError): void;\n\n /**\n * Closes the container and returns serialized local state intended to be\n * given to a newly loaded container.\n */\n closeAndGetPendingLocalState(): string;\n\n /**\n * Propose new code details that define the code to be loaded for this container's runtime.\n *\n * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n */\n proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n /**\n * Attaches the Container to the Container specified by the given Request.\n *\n * @privateRemarks\n *\n * TODO - in the case of failure options should give a retry policy.\n * Or some continuation function that allows attachment to a secondary document.\n */\n attach(request: IRequest): Promise<void>;\n\n /**\n * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n * is an error.\n */\n serialize(): string;\n\n /**\n * Get an absolute URL for a provided container-relative request URL.\n * If the container is not attached, this will return undefined.\n *\n * @param relativeUrl - A container-relative request URL.\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n /**\n * Issue a request against the container for a resource.\n * @param request - The request to be issued against the container\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Provides the current state of the container's connection to the ordering service.\n *\n * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n */\n readonly connectionState: ConnectionState;\n\n /**\n * Attempts to connect the container to the delta stream and process ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n * \"connected\" event will be fired if/when connection succeeds.\n */\n connect(): void;\n\n /**\n * Disconnects the container from the delta stream and stops processing ops.\n *\n * @remarks\n *\n * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n * \"disconnected\" event will be fired when disconnection completes.\n */\n disconnect(): void;\n\n /**\n * The audience information for all clients currently associated with the document in the current session.\n */\n readonly audience: IAudience;\n\n /**\n * The server provided ID of the client.\n *\n * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n * otherwise will be `undefined`.\n */\n readonly clientId?: string | undefined;\n\n /**\n * Tells if container is in read-only mode.\n *\n * @remarks\n *\n * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n * Readonly state can be because of no storage write permission,\n * or due to host forcing readonly mode for container.\n *\n * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n *\n * It is undefined if we have not yet established websocket connection\n * and do not know if user has write access to a file.\n */\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /**\n * Allows the host to have the container force to be in read-only mode\n * @param readonly - Boolean that toggles if read-only policies will be enforced\n * @alpha\n */\n forceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n /**\n * Resolves the resource specified by the URL + headers contained in the request object\n * to the underlying container that will resolve the request.\n *\n * @remarks\n *\n * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n * a request against the server found from the resolve step.\n */\n resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n /**\n * Creates a new container using the specified chaincode 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 */\n createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\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 */\n rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n [key in string | number]: any;\n} & {\n /**\n * Set caching behavior for the loader. If true, we will load a container from cache if one\n * with the same id/version exists or create a new container and cache it if it does not. If\n * false, always load a new container and don't cache it. If the container has already been\n * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n * request will override the Loader's value.\n * Defaults to true.\n */\n cache?: boolean;\n\n /**\n * Provide the current Loader through the scope object when creating Containers. It is added\n * as the `ILoader` property, and will overwrite an existing property of the same name on the\n * scope. Useful for when the host wants to provide the current Loader's functionality to\n * individual Data Stores, which is typically expected when creating with a Loader.\n * Defaults to true.\n */\n provideScopeLoader?: boolean;\n\n /**\n * Max time (in ms) container will wait for a leave message of a disconnected client.\n */\n maxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n /**\n * Override the Loader's default caching behavior for this container.\n */\n cache = \"fluid-cache\",\n\n clientDetails = \"fluid-client-details\",\n\n /**\n * Start the container in a paused, unconnected state. Defaults to false\n */\n loadMode = \"loadMode\",\n reconnect = \"fluid-reconnect\",\n sequenceNumber = \"fluid-sequence-number\",\n\n /**\n * One of the following:\n * null or \"null\": use ops, no snapshots\n * undefined: fetch latest snapshot\n * otherwise, version sha to load snapshot\n */\n version = \"version\",\n}\n\nexport interface IContainerLoadMode {\n opsBeforeReturn?:\n /*\n * No trailing ops are applied before container is returned.\n * Default value.\n */\n | undefined\n /*\n * Only cached trailing ops are applied before returning container.\n * Caching is optional and could be implemented by the driver.\n * If driver does not implement any kind of local caching strategy, this is same as above.\n * Driver may cache a lot of ops, so care needs to be exercised (see below).\n */\n | \"cached\"\n /*\n * All trailing ops in storage are fetched and applied before container is returned\n * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n * recommended to have some progress UX / cancellation built into loading flow when using this option.\n */\n | \"all\";\n\n deltaConnection?:\n /*\n * Connection to delta stream is made only when Container.connect() call is made. Op processing\n * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n */\n | \"none\"\n /*\n * Connection to delta stream is made only when Container.connect() call is made.\n * Op fetching from storage is performed and ops are applied as they come in.\n * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n */\n | \"delayed\"\n /*\n * Connection to delta stream is made right away.\n * Ops processing is enabled and ops are flowing through the system.\n * Default value.\n */\n | undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n [LoaderHeader.cache]: boolean;\n [LoaderHeader.clientDetails]: IClientDetails;\n [LoaderHeader.loadMode]: IContainerLoadMode;\n [LoaderHeader.sequenceNumber]: number;\n [LoaderHeader.reconnect]: boolean;\n [LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n readonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n url: string;\n pendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n blobsContents: { [path: string]: ArrayBufferLike; };\n trees: { [path: string]: ISnapshotTreeWithBlobContents; };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2gBH;;GAEG;AACH,IAAY,YAsBX;AAtBD,WAAY,YAAY;IACvB;;OAEG;IACH,qCAAqB,CAAA;IAErB,sDAAsC,CAAA;IAEtC;;OAEG;IACH,qCAAqB,CAAA;IACrB,6CAA6B,CAAA;IAC7B,wDAAwC,CAAA;IAExC;;;;;OAKG;IACH,mCAAmB,CAAA;AACpB,CAAC,EAtBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAsBvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse, IFluidRouter } from \"@fluidframework/core-interfaces\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISequencedProposal,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { IAudience } from \"./audience\";\nimport { IDeltaManager, ReadOnlyInfo } from \"./deltas\";\nimport { ICriticalContainerError, ContainerWarning } from \"./error\";\nimport { IFluidModule } from \"./fluidModule\";\nimport { AttachState } from \"./runtime\";\nimport { IFluidCodeDetails, IFluidPackage, IProvideFluidCodeDetailsComparer } from \"./fluidPackage\";\n\n/**\n * Encapsulates a module entry point with corresponding code details.\n */\nexport interface IFluidModuleWithDetails {\n\t/**\n\t * Fluid code module that implements the runtime factory needed to instantiate the container runtime.\n\t */\n\tmodule: IFluidModule;\n\n\t/**\n\t * Code details associated with the module. Represents a document schema this module supports.\n\t * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}\n\t * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the\n\t * quorum.\n\t */\n\tdetails: IFluidCodeDetails;\n}\n\n/**\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 extends Partial<IProvideFluidCodeDetailsComparer> {\n\t/**\n\t * Load the code module (package) that can interact with the document.\n\t *\n\t * @param source - Code proposal that articulates the current schema the document is written in.\n\t * @returns - Code module entry point along with the code details associated with it.\n\t */\n\tload(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;\n}\n\n/**\n * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails\n * that have been resolved and are ready to load\n */\nexport interface IResolvedFluidCodeDetails extends IFluidCodeDetails {\n\t/**\n\t * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.\n\t */\n\treadonly resolvedPackage: Readonly<IFluidPackage>;\n\t/**\n\t * If not undefined, this id will be used to cache the entry point for the code package\n\t */\n\treadonly resolvedPackageCacheId: string | undefined;\n}\n\n/**\n * Fluid code resolvers take a Fluid code details, and resolve the\n * full Fluid package including absolute urls for the browser file entries.\n * The Fluid code resolver is coupled to a specific cdn and knows how to resolve\n * the code detail for loading from that cdn. This include resolving to the most recent\n * version of package that supports the provided code details.\n */\nexport interface IFluidCodeResolver {\n\t/**\n\t * Resolves a Fluid code details into a form that can be loaded.\n\t * @param details - The Fluid code details to resolve.\n\t * @returns - A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and\n\t * an optional resolvedPackageCacheId if the loaded package should be cached.\n\t */\n\tresolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;\n}\n\n/**\n * Code AllowListing Interface\n *\n * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n */\nexport interface ICodeAllowList {\n\t/**\n\t * @deprecated 2.0.0-internal.3.2.0 Fluid does not prescribe a particular code validation approach. Will be removed in an upcoming release.\n\t */\n\ttestSource(source: IResolvedFluidCodeDetails): Promise<boolean>;\n}\n\n/**\n * Events emitted by the {@link IContainer} \"upwards\" to the Loader and Host.\n */\nexport interface IContainerEvents extends IEvent {\n\t/**\n\t * Emitted when the readonly state of the container changes.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `readonly`: Whether or not the container is now in a readonly state.\n\t *\n\t * @see {@link IContainer.readOnlyInfo}\n\t */\n\t(event: \"readonly\", listener: (readonly: boolean) => void): void;\n\n\t/**\n\t * Emitted when the {@link IContainer} completes connecting to the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.connect}\n\t */\n\t(event: \"connected\", listener: (clientId: string) => void);\n\n\t/**\n\t * Fires when new container code details have been proposed, prior to acceptance.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `codeDetails`: The code details being proposed.\n\t *\n\t * - `proposal`: NOT RECOMMENDED FOR USE.\n\t *\n\t * @see {@link IContainer.proposeCodeDetails}\n\t */\n\t(\n\t\tevent: \"codeDetailsProposed\",\n\t\tlistener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void,\n\t);\n\n\t/**\n\t * @deprecated No replacement API recommended.\n\t */\n\t(event: \"contextChanged\", listener: (codeDetails: IFluidCodeDetails) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.\n\t *\n\t * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.connectionState}\n\t *\n\t * - {@link IContainer.disconnect}\n\t */\n\t(event: \"disconnected\", listener: () => void);\n\n\t/**\n\t * Emitted when a {@link AttachState.Detached | detached} container is\n\t * {@link AttachState.Attached | attached} to the Fluid service.\n\t *\n\t * @see\n\t *\n\t * - {@link IContainer.attachState}\n\t *\n\t * - {@link IContainer.attach}\n\t */\n\t(event: \"attached\", listener: () => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is closed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was closed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.close}\n\t */\n\t(event: \"closed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the {@link IContainer} is disposed, which permanently disables it.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.\n\t *\n\t * @see {@link IContainer.dispose}\n\t */\n\t(event: \"disposed\", listener: (error?: ICriticalContainerError) => void);\n\n\t/**\n\t * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * The longer-term intention is to surface warnings more directly on the APIs that produce them.\n\t * For now, use of this should be avoided when possible.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `error`: The warning describing the encountered state.\n\t */\n\t(event: \"warning\", listener: (error: ContainerWarning) => void);\n\n\t/**\n\t * Emitted immediately after processing an incoming operation (op).\n\t *\n\t * @remarks\n\t *\n\t * Note: this event is not intended for general use.\n\t * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n\t * ops directly on the {@link IContainer}.\n\t *\n\t * Listener parameters:\n\t *\n\t * - `message`: The op that was processed.\n\t */\n\t(event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n\n\t/**\n\t * Emitted upon the first local change while the Container is in the \"saved\" state.\n\t * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"dirty\", listener: (dirty: boolean) => void);\n\n\t/**\n\t * Emitted when all local changes/edits have been acknowledged by the service.\n\t * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `dirty`: DEPRECATED. This parameter will be removed in a future release.\n\t *\n\t * @see {@link IContainer.isDirty}\n\t */\n\t(event: \"saved\", listener: (dirty: boolean) => void);\n}\n\n/**\n * Namespace for the different connection states a container can be in.\n * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConnectionState {\n\t/**\n\t * The container is not connected to the delta server.\n\t * Note - When in this state the container may be about to reconnect,\n\t * or may remain disconnected until explicitly told to connect.\n\t */\n\texport type Disconnected = 0;\n\n\t/**\n\t * The container is disconnected but actively trying to establish a new connection.\n\t * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.\n\t */\n\texport type EstablishingConnection = 3;\n\n\t/**\n\t * The container has an inbound connection only, and is catching up to the latest known state from the service.\n\t */\n\texport type CatchingUp = 1;\n\n\t/**\n\t * The container is fully connected and syncing.\n\t */\n\texport type Connected = 2;\n}\n\n/**\n * Type defining the different states of connectivity a Container can be in.\n */\nexport type ConnectionState =\n\t| ConnectionState.Disconnected\n\t| ConnectionState.EstablishingConnection\n\t| ConnectionState.CatchingUp\n\t| ConnectionState.Connected;\n\n/**\n * The Host's view of a Container and its connection to storage\n */\nexport interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {\n\t/**\n\t * The Delta Manager supporting the op stream for this Container\n\t */\n\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n\t/**\n\t * The collection of write clients which were connected as of the current sequence number.\n\t * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Represents the resolved url to the Container.\n\t * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.\n\t */\n\tresolvedUrl: IResolvedUrl | undefined;\n\n\t/**\n\t * Indicates the attachment state of the container to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\t/**\n\t * Get the code details that are currently specified for the container.\n\t * @returns The current code details if any are specified, undefined if none are specified.\n\t */\n\tgetSpecifiedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Get the code details that were used to load the container.\n\t * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet\n\t * loaded.\n\t */\n\tgetLoadedCodeDetails(): IFluidCodeDetails | undefined;\n\n\t/**\n\t * Returns true if the container has been closed, otherwise false.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Whether or not there are any local changes that have not been saved.\n\t */\n\treadonly isDirty: boolean;\n\n\t/**\n\t * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.\n\t * The container is not expected to be used anymore once it is disposed.\n\t *\n\t * @param error - If the container is being disposed due to error, this provides details about the error that\n\t * resulted in disposing it.\n\t */\n\tdispose?(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container.\n\t *\n\t * @param error - If the container is being closed due to error, this provides details about the error that\n\t * resulted in closing it.\n\t */\n\tclose(error?: ICriticalContainerError): void;\n\n\t/**\n\t * Closes the container and returns serialized local state intended to be\n\t * given to a newly loaded container.\n\t * @experimental\n\t * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}\n\t */\n\tcloseAndGetPendingLocalState(): string;\n\n\t/**\n\t * Propose new code details that define the code to be loaded for this container's runtime.\n\t *\n\t * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.\n\t */\n\tproposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;\n\n\t/**\n\t * Attaches the Container to the Container specified by the given Request.\n\t *\n\t * @privateRemarks\n\t *\n\t * TODO - in the case of failure options should give a retry policy.\n\t * Or some continuation function that allows attachment to a secondary document.\n\t */\n\tattach(request: IRequest): Promise<void>;\n\n\t/**\n\t * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container\n\t * is an error.\n\t */\n\tserialize(): string;\n\n\t/**\n\t * Get an absolute URL for a provided container-relative request URL.\n\t * If the container is not attached, this will return undefined.\n\t *\n\t * @param relativeUrl - A container-relative request URL.\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\t/**\n\t * Issue a request against the container for a resource.\n\t * @param request - The request to be issued against the container\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Provides the current state of the container's connection to the ordering service.\n\t *\n\t * @remarks Consumers can listen for state changes via the \"connected\" and \"disconnected\" events.\n\t */\n\treadonly connectionState: ConnectionState;\n\n\t/**\n\t * Attempts to connect the container to the delta stream and process ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the\n\t * \"connected\" event will be fired if/when connection succeeds.\n\t */\n\tconnect(): void;\n\n\t/**\n\t * Disconnects the container from the delta stream and stops processing ops.\n\t *\n\t * @remarks\n\t *\n\t * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the\n\t * \"disconnected\" event will be fired when disconnection completes.\n\t */\n\tdisconnect(): void;\n\n\t/**\n\t * The audience information for all clients currently associated with the document in the current session.\n\t */\n\treadonly audience: IAudience;\n\n\t/**\n\t * The server provided ID of the client.\n\t *\n\t * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},\n\t * otherwise will be `undefined`.\n\t */\n\treadonly clientId?: string | undefined;\n\n\t/**\n\t * Tells if container is in read-only mode.\n\t *\n\t * @remarks\n\t *\n\t * Data stores should listen for \"readonly\" notifications and disallow user making changes to data stores.\n\t * Readonly state can be because of no storage write permission,\n\t * or due to host forcing readonly mode for container.\n\t *\n\t * We do not differentiate here between no write access to storage vs. host disallowing changes to container -\n\t * in all cases container runtime and data stores should respect readonly state and not allow local changes.\n\t *\n\t * It is undefined if we have not yet established websocket connection\n\t * and do not know if user has write access to a file.\n\t */\n\treadonly readOnlyInfo: ReadOnlyInfo;\n\n\t/**\n\t * Allows the host to have the container force to be in read-only mode\n\t * @param readonly - Boolean that toggles if read-only policies will be enforced\n\t * @alpha\n\t */\n\tforceReadonly?(readonly: boolean);\n}\n\n/**\n * The Runtime's view of the Loader, used for loading Containers\n */\nexport interface ILoader extends IFluidRouter, Partial<IProvideLoader> {\n\t/**\n\t * Resolves the resource specified by the URL + headers contained in the request object\n\t * to the underlying container that will resolve the request.\n\t *\n\t * @remarks\n\t *\n\t * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes\n\t * a request against the server found from the resolve step.\n\t */\n\tresolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;\n}\n\n/**\n * The Host's view of the Loader, used for loading Containers\n */\nexport interface IHostLoader extends ILoader {\n\t/**\n\t * Creates a new container using the specified chaincode but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\tcreateDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;\n\n\t/**\n\t * Creates a new container using the specified snapshot but in an unattached state. While unattached all\n\t * updates will only be local until the user explicitly attaches the container to a service provider.\n\t */\n\trehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;\n}\n\nexport type ILoaderOptions = {\n\t[key in string | number]: any;\n} & {\n\t/**\n\t * Set caching behavior for the loader. If true, we will load a container from cache if one\n\t * with the same id/version exists or create a new container and cache it if it does not. If\n\t * false, always load a new container and don't cache it. If the container has already been\n\t * closed, it will not be cached. A cache option in the LoaderHeader for an individual\n\t * request will override the Loader's value.\n\t * Defaults to true.\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Provide the current Loader through the scope object when creating Containers. It is added\n\t * as the `ILoader` property, and will overwrite an existing property of the same name on the\n\t * scope. Useful for when the host wants to provide the current Loader's functionality to\n\t * individual Data Stores, which is typically expected when creating with a Loader.\n\t * Defaults to true.\n\t */\n\tprovideScopeLoader?: boolean;\n\n\t/**\n\t * Max time (in ms) container will wait for a leave message of a disconnected client.\n\t */\n\tmaxClientLeaveWaitTime?: number;\n};\n\n/**\n * Accepted header keys for requests coming to the Loader\n */\nexport enum LoaderHeader {\n\t/**\n\t * Override the Loader's default caching behavior for this container.\n\t */\n\tcache = \"fluid-cache\",\n\n\tclientDetails = \"fluid-client-details\",\n\n\t/**\n\t * Start the container in a paused, unconnected state. Defaults to false\n\t */\n\tloadMode = \"loadMode\",\n\treconnect = \"fluid-reconnect\",\n\tsequenceNumber = \"fluid-sequence-number\",\n\n\t/**\n\t * One of the following:\n\t * null or \"null\": use ops, no snapshots\n\t * undefined: fetch latest snapshot\n\t * otherwise, version sha to load snapshot\n\t */\n\tversion = \"version\",\n}\n\nexport interface IContainerLoadMode {\n\topsBeforeReturn?: /*\n\t * No trailing ops are applied before container is returned.\n\t * Default value.\n\t */\n\t| undefined\n\t\t/*\n\t\t * Only cached trailing ops are applied before returning container.\n\t\t * Caching is optional and could be implemented by the driver.\n\t\t * If driver does not implement any kind of local caching strategy, this is same as above.\n\t\t * Driver may cache a lot of ops, so care needs to be exercised (see below).\n\t\t */\n\t\t| \"cached\"\n\t\t/*\n\t\t * All trailing ops in storage are fetched and applied before container is returned\n\t\t * This mode might have significant impact on boot speed (depends on storage perf characteristics)\n\t\t * Also there might be a lot of trailing ops and applying them might take time, so hosts are\n\t\t * recommended to have some progress UX / cancellation built into loading flow when using this option.\n\t\t */\n\t\t| \"all\";\n\n\tdeltaConnection?: /*\n\t * Connection to delta stream is made only when Container.connect() call is made. Op processing\n\t * is paused (when container is returned from Loader.resolve()) until Container.connect() call is made.\n\t */\n\t| \"none\"\n\t\t/*\n\t\t * Connection to delta stream is made only when Container.connect() call is made.\n\t\t * Op fetching from storage is performed and ops are applied as they come in.\n\t\t * This is useful option if connection to delta stream is expensive and thus it's beneficial to move it\n\t\t * out from critical boot sequence, but it's beneficial to allow catch up to happen as fast as possible.\n\t\t */\n\t\t| \"delayed\"\n\t\t/*\n\t\t * Connection to delta stream is made right away.\n\t\t * Ops processing is enabled and ops are flowing through the system.\n\t\t * Default value.\n\t\t */\n\t\t| undefined;\n}\n\n/**\n * Set of Request Headers that the Loader understands and may inspect or modify\n */\nexport interface ILoaderHeader {\n\t[LoaderHeader.cache]: boolean;\n\t[LoaderHeader.clientDetails]: IClientDetails;\n\t[LoaderHeader.loadMode]: IContainerLoadMode;\n\t[LoaderHeader.sequenceNumber]: number;\n\t[LoaderHeader.reconnect]: boolean;\n\t[LoaderHeader.version]: string | undefined;\n}\n\nexport interface IProvideLoader {\n\treadonly ILoader: ILoader;\n}\n\n/**\n * @deprecated 0.48, This API will be removed in 0.50\n * No replacement since it is not expected anyone will depend on this outside container-loader\n * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.\n */\nexport interface IPendingLocalState {\n\turl: string;\n\tpendingRuntimeState: unknown;\n}\n\n/**\n * This is used when we rehydrate a container from the snapshot. Here we put the blob contents\n * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.\n *\n * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.\n */\nexport interface ISnapshotTreeWithBlobContents extends ISnapshotTree {\n\tblobsContents: { [path: string]: ArrayBufferLike };\n\ttrees: { [path: string]: ISnapshotTreeWithBlobContents };\n}\n"]}
|