@fluid-experimental/data-object-base 2.0.0-dev-rc.2.0.0.245554
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/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/data-object-base-alpha.d.ts +20 -0
- package/dist/data-object-base-beta.d.ts +32 -0
- package/dist/data-object-base-public.d.ts +32 -0
- package/dist/data-object-base-untrimmed.d.ts +43 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +3 -0
- package/dist/runtimeFactory.d.ts +37 -0
- package/dist/runtimeFactory.d.ts.map +1 -0
- package/dist/runtimeFactory.js +44 -0
- package/dist/runtimeFactory.js.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/data-object-base-alpha.d.ts +20 -0
- package/lib/data-object-base-beta.d.ts +32 -0
- package/lib/data-object-base-public.d.ts +32 -0
- package/lib/data-object-base-untrimmed.d.ts +43 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -0
- package/lib/index.js.map +1 -0
- package/lib/runtimeFactory.d.ts +37 -0
- package/lib/runtimeFactory.d.ts.map +1 -0
- package/lib/runtimeFactory.js +40 -0
- package/lib/runtimeFactory.js.map +1 -0
- package/lib/test/tsconfig.tsbuildinfo +1 -0
- package/package.json +125 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @fluid-experimental/data-object-base
|
|
2
|
+
|
|
3
|
+
This is an experimental project that explores synchronous Fluid data object loading.
|
|
4
|
+
|
|
5
|
+
<!-- AUTO-GENERATED-CONTENT:START (LIBRARY_PACKAGE_README:scripts=FALSE) -->
|
|
6
|
+
|
|
7
|
+
<!-- prettier-ignore-start -->
|
|
8
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
9
|
+
|
|
10
|
+
**IMPORTANT: This package is experimental.**
|
|
11
|
+
**Its APIs may change without notice.**
|
|
12
|
+
|
|
13
|
+
**Do not use in production scenarios.**
|
|
14
|
+
|
|
15
|
+
## Using Fluid Framework libraries
|
|
16
|
+
|
|
17
|
+
When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
|
|
18
|
+
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
19
|
+
library consumers should always prefer `^`.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
To get started, install the package by running the following command:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm i @fluid-experimental/data-object-base
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## API Documentation
|
|
30
|
+
|
|
31
|
+
API documentation for **@fluid-experimental/data-object-base** is available at <https://fluidframework.com/docs/apis/data-object-base>.
|
|
32
|
+
|
|
33
|
+
## Contribution Guidelines
|
|
34
|
+
|
|
35
|
+
There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
|
|
36
|
+
|
|
37
|
+
- Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
|
|
38
|
+
- [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
|
|
39
|
+
- Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
|
|
40
|
+
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
|
|
41
|
+
|
|
42
|
+
Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki).
|
|
43
|
+
|
|
44
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
45
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
46
|
+
|
|
47
|
+
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
48
|
+
Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
|
|
49
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
50
|
+
|
|
51
|
+
## Help
|
|
52
|
+
|
|
53
|
+
Not finding what you're looking for in this README? Check out our [GitHub
|
|
54
|
+
Wiki](https://github.com/microsoft/FluidFramework/wiki) or [fluidframework.com](https://fluidframework.com/docs/).
|
|
55
|
+
|
|
56
|
+
Still not finding what you're looking for? Please [file an
|
|
57
|
+
issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
|
|
58
|
+
|
|
59
|
+
Thank you!
|
|
60
|
+
|
|
61
|
+
## Trademark
|
|
62
|
+
|
|
63
|
+
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
64
|
+
|
|
65
|
+
Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
66
|
+
|
|
67
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
68
|
+
|
|
69
|
+
<!-- prettier-ignore-end -->
|
|
70
|
+
|
|
71
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
3
|
+
* rendering capabilities to consumers.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
11
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
12
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
13
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
|
|
14
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: RuntimeFactory */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: RuntimeFactoryProps */
|
|
19
|
+
|
|
20
|
+
export { }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
3
|
+
* rendering capabilities to consumers.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
11
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
12
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
13
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
|
|
14
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: ContainerRuntime */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: IContainerContext */
|
|
19
|
+
|
|
20
|
+
/* Excluded from this release type: IContainerRuntime */
|
|
21
|
+
|
|
22
|
+
/* Excluded from this release type: IFluidDataStoreFactory */
|
|
23
|
+
|
|
24
|
+
/* Excluded from this release type: RuntimeFactory */
|
|
25
|
+
|
|
26
|
+
/* Excluded from this release type: RuntimeFactoryHelper */
|
|
27
|
+
|
|
28
|
+
/* Excluded from this release type: RuntimeFactoryProps */
|
|
29
|
+
|
|
30
|
+
/* Excluded from this release type: RuntimeRequestHandler */
|
|
31
|
+
|
|
32
|
+
export { }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
3
|
+
* rendering capabilities to consumers.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
11
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
12
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
13
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
|
|
14
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: ContainerRuntime */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: IContainerContext */
|
|
19
|
+
|
|
20
|
+
/* Excluded from this release type: IContainerRuntime */
|
|
21
|
+
|
|
22
|
+
/* Excluded from this release type: IFluidDataStoreFactory */
|
|
23
|
+
|
|
24
|
+
/* Excluded from this release type: RuntimeFactory */
|
|
25
|
+
|
|
26
|
+
/* Excluded from this release type: RuntimeFactoryHelper */
|
|
27
|
+
|
|
28
|
+
/* Excluded from this release type: RuntimeFactoryProps */
|
|
29
|
+
|
|
30
|
+
/* Excluded from this release type: RuntimeRequestHandler */
|
|
31
|
+
|
|
32
|
+
export { }
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
3
|
+
* rendering capabilities to consumers.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
11
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
12
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
13
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
|
|
14
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare class RuntimeFactory extends RuntimeFactoryHelper {
|
|
20
|
+
private readonly registry;
|
|
21
|
+
private readonly defaultStoreFactory;
|
|
22
|
+
private readonly requestHandlers;
|
|
23
|
+
private readonly provideEntryPoint;
|
|
24
|
+
constructor(props: RuntimeFactoryProps);
|
|
25
|
+
instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
|
|
26
|
+
preInitialize(context: IContainerContext, existing: boolean): Promise<ContainerRuntime>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* {@link RuntimeFactory} construction properties.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare interface RuntimeFactoryProps {
|
|
34
|
+
defaultStoreFactory: IFluidDataStoreFactory;
|
|
35
|
+
storeFactories: IFluidDataStoreFactory[];
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
38
|
+
*/
|
|
39
|
+
requestHandlers?: RuntimeRequestHandler[];
|
|
40
|
+
provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { }
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
7
|
+
* rendering capabilities to consumers.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
export { RuntimeFactory, type RuntimeFactoryProps } from "./runtimeFactory.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.RuntimeFactory = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
10
|
+
* rendering capabilities to consumers.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
var runtimeFactory_js_1 = require("./runtimeFactory.js");
|
|
15
|
+
Object.defineProperty(exports, "RuntimeFactory", { enumerable: true, get: function () { return runtimeFactory_js_1.RuntimeFactory; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;GAKG;AAEH,yDAA+E;AAAtE,mHAAA,cAAc,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The view interfaces provide a generic way for objects to expose their\n * rendering capabilities to consumers.\n *\n * @packageDocumentation\n */\n\nexport { RuntimeFactory, type RuntimeFactoryProps } from \"./runtimeFactory.js\";\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { type IContainerContext } from "@fluidframework/container-definitions";
|
|
6
|
+
import { ContainerRuntime } from "@fluidframework/container-runtime";
|
|
7
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
8
|
+
import { type FluidObject } from "@fluidframework/core-interfaces";
|
|
9
|
+
import { type RuntimeRequestHandler } from "@fluidframework/request-handler";
|
|
10
|
+
import { type IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
|
|
11
|
+
import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";
|
|
12
|
+
/**
|
|
13
|
+
* {@link RuntimeFactory} construction properties.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export interface RuntimeFactoryProps {
|
|
17
|
+
defaultStoreFactory: IFluidDataStoreFactory;
|
|
18
|
+
storeFactories: IFluidDataStoreFactory[];
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
21
|
+
*/
|
|
22
|
+
requestHandlers?: RuntimeRequestHandler[];
|
|
23
|
+
provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare class RuntimeFactory extends RuntimeFactoryHelper {
|
|
29
|
+
private readonly registry;
|
|
30
|
+
private readonly defaultStoreFactory;
|
|
31
|
+
private readonly requestHandlers;
|
|
32
|
+
private readonly provideEntryPoint;
|
|
33
|
+
constructor(props: RuntimeFactoryProps);
|
|
34
|
+
instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
|
|
35
|
+
preInitialize(context: IContainerContext, existing: boolean): Promise<ContainerRuntime>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=runtimeFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeFactory.d.ts","sourceRoot":"","sources":["../src/runtimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EACN,KAAK,qBAAqB,EAE1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAIrE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC,mBAAmB,EAAE,sBAAsB,CAAC;IAC5C,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC;;OAEG;IACH,eAAe,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC1C,iBAAiB,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACxE;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,oBAAoB;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAE9D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAyB;IAC7D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0B;IAC1D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAuD;gBAEtE,KAAK,EAAE,mBAAmB;IAehC,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D,aAAa,CACzB,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC;CAY5B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.RuntimeFactory = void 0;
|
|
8
|
+
const container_runtime_1 = require("@fluidframework/container-runtime");
|
|
9
|
+
// eslint-disable-next-line import/no-deprecated
|
|
10
|
+
const request_handler_1 = require("@fluidframework/request-handler");
|
|
11
|
+
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
12
|
+
const defaultStoreId = "";
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
class RuntimeFactory extends runtime_utils_1.RuntimeFactoryHelper {
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super();
|
|
19
|
+
this.defaultStoreFactory = props.defaultStoreFactory;
|
|
20
|
+
this.provideEntryPoint = props.provideEntryPoint;
|
|
21
|
+
this.requestHandlers = props.requestHandlers ?? [];
|
|
22
|
+
const storeFactories = props.storeFactories ?? [this.defaultStoreFactory];
|
|
23
|
+
this.registry = (storeFactories.includes(this.defaultStoreFactory)
|
|
24
|
+
? storeFactories
|
|
25
|
+
: [...storeFactories, this.defaultStoreFactory]).map((factory) => [factory.type, factory]);
|
|
26
|
+
}
|
|
27
|
+
async instantiateFirstTime(runtime) {
|
|
28
|
+
const dataStore = await runtime.createDataStore(this.defaultStoreFactory.type);
|
|
29
|
+
await dataStore.trySetAlias(defaultStoreId);
|
|
30
|
+
}
|
|
31
|
+
async preInitialize(context, existing) {
|
|
32
|
+
const runtime = await container_runtime_1.ContainerRuntime.loadRuntime({
|
|
33
|
+
context,
|
|
34
|
+
registryEntries: this.registry,
|
|
35
|
+
existing,
|
|
36
|
+
// eslint-disable-next-line import/no-deprecated
|
|
37
|
+
requestHandler: (0, request_handler_1.buildRuntimeRequestHandler)(...this.requestHandlers),
|
|
38
|
+
provideEntryPoint: this.provideEntryPoint,
|
|
39
|
+
});
|
|
40
|
+
return runtime;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.RuntimeFactory = RuntimeFactory;
|
|
44
|
+
//# sourceMappingURL=runtimeFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeFactory.js","sourceRoot":"","sources":["../src/runtimeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAAqE;AAGrE,gDAAgD;AAChD,qEAGyC;AAKzC,iEAAqE;AAErE,MAAM,cAAc,GAAG,EAAW,CAAC;AAgBnC;;GAEG;AACH,MAAa,cAAe,SAAQ,oCAAoB;IAOvD,YAAmB,KAA0B;QAC5C,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QACrD,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC;QACjD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QACnD,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAE1E,IAAI,CAAC,QAAQ,GAAG,CACf,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC;YAChD,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAChD,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAuC,CAAC;IACnF,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,OAAyB;QAC1D,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC/E,MAAM,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,OAAO,GAAqB,MAAM,oCAAgB,CAAC,WAAW,CAAC;YACpE,OAAO;YACP,eAAe,EAAE,IAAI,CAAC,QAAQ;YAC9B,QAAQ;YACR,gDAAgD;YAChD,cAAc,EAAE,IAAA,4CAA0B,EAAC,GAAG,IAAI,CAAC,eAAe,CAAC;YACnE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SACzC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IAChB,CAAC;CACD;AA1CD,wCA0CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IContainerContext } from \"@fluidframework/container-definitions\";\nimport { ContainerRuntime } from \"@fluidframework/container-runtime\";\nimport { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { type FluidObject } from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport {\n\ttype RuntimeRequestHandler,\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler\";\nimport {\n\ttype NamedFluidDataStoreRegistryEntries,\n\ttype IFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils\";\n\nconst defaultStoreId = \"\" as const;\n\n/**\n * {@link RuntimeFactory} construction properties.\n * @internal\n */\nexport interface RuntimeFactoryProps {\n\tdefaultStoreFactory: IFluidDataStoreFactory;\n\tstoreFactories: IFluidDataStoreFactory[];\n\t/**\n\t * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\trequestHandlers?: RuntimeRequestHandler[];\n\tprovideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n}\n\n/**\n * @internal\n */\nexport class RuntimeFactory extends RuntimeFactoryHelper {\n\tprivate readonly registry: NamedFluidDataStoreRegistryEntries;\n\n\tprivate readonly defaultStoreFactory: IFluidDataStoreFactory;\n\tprivate readonly requestHandlers: RuntimeRequestHandler[];\n\tprivate readonly provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\n\tpublic constructor(props: RuntimeFactoryProps) {\n\t\tsuper();\n\n\t\tthis.defaultStoreFactory = props.defaultStoreFactory;\n\t\tthis.provideEntryPoint = props.provideEntryPoint;\n\t\tthis.requestHandlers = props.requestHandlers ?? [];\n\t\tconst storeFactories = props.storeFactories ?? [this.defaultStoreFactory];\n\n\t\tthis.registry = (\n\t\t\tstoreFactories.includes(this.defaultStoreFactory)\n\t\t\t\t? storeFactories\n\t\t\t\t: [...storeFactories, this.defaultStoreFactory]\n\t\t).map((factory) => [factory.type, factory]) as NamedFluidDataStoreRegistryEntries;\n\t}\n\n\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\tconst dataStore = await runtime.createDataStore(this.defaultStoreFactory.type);\n\t\tawait dataStore.trySetAlias(defaultStoreId);\n\t}\n\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<ContainerRuntime> {\n\t\tconst runtime: ContainerRuntime = await ContainerRuntime.loadRuntime({\n\t\t\tcontext,\n\t\t\tregistryEntries: this.registry,\n\t\t\texisting,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\trequestHandler: buildRuntimeRequestHandler(...this.requestHandlers),\n\t\t\tprovideEntryPoint: this.provideEntryPoint,\n\t\t});\n\n\t\treturn runtime;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.42.3"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
3
|
+
* rendering capabilities to consumers.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
11
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
12
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
13
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
|
|
14
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: RuntimeFactory */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: RuntimeFactoryProps */
|
|
19
|
+
|
|
20
|
+
export { }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
3
|
+
* rendering capabilities to consumers.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
11
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
12
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
13
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
|
|
14
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: ContainerRuntime */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: IContainerContext */
|
|
19
|
+
|
|
20
|
+
/* Excluded from this release type: IContainerRuntime */
|
|
21
|
+
|
|
22
|
+
/* Excluded from this release type: IFluidDataStoreFactory */
|
|
23
|
+
|
|
24
|
+
/* Excluded from this release type: RuntimeFactory */
|
|
25
|
+
|
|
26
|
+
/* Excluded from this release type: RuntimeFactoryHelper */
|
|
27
|
+
|
|
28
|
+
/* Excluded from this release type: RuntimeFactoryProps */
|
|
29
|
+
|
|
30
|
+
/* Excluded from this release type: RuntimeRequestHandler */
|
|
31
|
+
|
|
32
|
+
export { }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
3
|
+
* rendering capabilities to consumers.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
11
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
12
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
13
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
|
|
14
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
15
|
+
|
|
16
|
+
/* Excluded from this release type: ContainerRuntime */
|
|
17
|
+
|
|
18
|
+
/* Excluded from this release type: IContainerContext */
|
|
19
|
+
|
|
20
|
+
/* Excluded from this release type: IContainerRuntime */
|
|
21
|
+
|
|
22
|
+
/* Excluded from this release type: IFluidDataStoreFactory */
|
|
23
|
+
|
|
24
|
+
/* Excluded from this release type: RuntimeFactory */
|
|
25
|
+
|
|
26
|
+
/* Excluded from this release type: RuntimeFactoryHelper */
|
|
27
|
+
|
|
28
|
+
/* Excluded from this release type: RuntimeFactoryProps */
|
|
29
|
+
|
|
30
|
+
/* Excluded from this release type: RuntimeRequestHandler */
|
|
31
|
+
|
|
32
|
+
export { }
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
3
|
+
* rendering capabilities to consumers.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
11
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
12
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
13
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
|
|
14
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare class RuntimeFactory extends RuntimeFactoryHelper {
|
|
20
|
+
private readonly registry;
|
|
21
|
+
private readonly defaultStoreFactory;
|
|
22
|
+
private readonly requestHandlers;
|
|
23
|
+
private readonly provideEntryPoint;
|
|
24
|
+
constructor(props: RuntimeFactoryProps);
|
|
25
|
+
instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
|
|
26
|
+
preInitialize(context: IContainerContext, existing: boolean): Promise<ContainerRuntime>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* {@link RuntimeFactory} construction properties.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare interface RuntimeFactoryProps {
|
|
34
|
+
defaultStoreFactory: IFluidDataStoreFactory;
|
|
35
|
+
storeFactories: IFluidDataStoreFactory[];
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
38
|
+
*/
|
|
39
|
+
requestHandlers?: RuntimeRequestHandler[];
|
|
40
|
+
provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { }
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
7
|
+
* rendering capabilities to consumers.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
export { RuntimeFactory, type RuntimeFactoryProps } from "./runtimeFactory.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The view interfaces provide a generic way for objects to expose their
|
|
7
|
+
* rendering capabilities to consumers.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
export { RuntimeFactory } from "./runtimeFactory.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAA4B,MAAM,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The view interfaces provide a generic way for objects to expose their\n * rendering capabilities to consumers.\n *\n * @packageDocumentation\n */\n\nexport { RuntimeFactory, type RuntimeFactoryProps } from \"./runtimeFactory.js\";\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { type IContainerContext } from "@fluidframework/container-definitions";
|
|
6
|
+
import { ContainerRuntime } from "@fluidframework/container-runtime";
|
|
7
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
8
|
+
import { type FluidObject } from "@fluidframework/core-interfaces";
|
|
9
|
+
import { type RuntimeRequestHandler } from "@fluidframework/request-handler";
|
|
10
|
+
import { type IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
|
|
11
|
+
import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";
|
|
12
|
+
/**
|
|
13
|
+
* {@link RuntimeFactory} construction properties.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export interface RuntimeFactoryProps {
|
|
17
|
+
defaultStoreFactory: IFluidDataStoreFactory;
|
|
18
|
+
storeFactories: IFluidDataStoreFactory[];
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
21
|
+
*/
|
|
22
|
+
requestHandlers?: RuntimeRequestHandler[];
|
|
23
|
+
provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare class RuntimeFactory extends RuntimeFactoryHelper {
|
|
29
|
+
private readonly registry;
|
|
30
|
+
private readonly defaultStoreFactory;
|
|
31
|
+
private readonly requestHandlers;
|
|
32
|
+
private readonly provideEntryPoint;
|
|
33
|
+
constructor(props: RuntimeFactoryProps);
|
|
34
|
+
instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
|
|
35
|
+
preInitialize(context: IContainerContext, existing: boolean): Promise<ContainerRuntime>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=runtimeFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeFactory.d.ts","sourceRoot":"","sources":["../src/runtimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EACN,KAAK,qBAAqB,EAE1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAIrE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IACnC,mBAAmB,EAAE,sBAAsB,CAAC;IAC5C,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC;;OAEG;IACH,eAAe,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC1C,iBAAiB,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACxE;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,oBAAoB;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAE9D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAyB;IAC7D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0B;IAC1D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAuD;gBAEtE,KAAK,EAAE,mBAAmB;IAehC,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D,aAAa,CACzB,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC;CAY5B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { ContainerRuntime } from "@fluidframework/container-runtime";
|
|
6
|
+
// eslint-disable-next-line import/no-deprecated
|
|
7
|
+
import { buildRuntimeRequestHandler, } from "@fluidframework/request-handler";
|
|
8
|
+
import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";
|
|
9
|
+
const defaultStoreId = "";
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export class RuntimeFactory extends RuntimeFactoryHelper {
|
|
14
|
+
constructor(props) {
|
|
15
|
+
super();
|
|
16
|
+
this.defaultStoreFactory = props.defaultStoreFactory;
|
|
17
|
+
this.provideEntryPoint = props.provideEntryPoint;
|
|
18
|
+
this.requestHandlers = props.requestHandlers ?? [];
|
|
19
|
+
const storeFactories = props.storeFactories ?? [this.defaultStoreFactory];
|
|
20
|
+
this.registry = (storeFactories.includes(this.defaultStoreFactory)
|
|
21
|
+
? storeFactories
|
|
22
|
+
: [...storeFactories, this.defaultStoreFactory]).map((factory) => [factory.type, factory]);
|
|
23
|
+
}
|
|
24
|
+
async instantiateFirstTime(runtime) {
|
|
25
|
+
const dataStore = await runtime.createDataStore(this.defaultStoreFactory.type);
|
|
26
|
+
await dataStore.trySetAlias(defaultStoreId);
|
|
27
|
+
}
|
|
28
|
+
async preInitialize(context, existing) {
|
|
29
|
+
const runtime = await ContainerRuntime.loadRuntime({
|
|
30
|
+
context,
|
|
31
|
+
registryEntries: this.registry,
|
|
32
|
+
existing,
|
|
33
|
+
// eslint-disable-next-line import/no-deprecated
|
|
34
|
+
requestHandler: buildRuntimeRequestHandler(...this.requestHandlers),
|
|
35
|
+
provideEntryPoint: this.provideEntryPoint,
|
|
36
|
+
});
|
|
37
|
+
return runtime;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=runtimeFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeFactory.js","sourceRoot":"","sources":["../src/runtimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,gDAAgD;AAChD,OAAO,EAEN,0BAA0B,GAC1B,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,MAAM,cAAc,GAAG,EAAW,CAAC;AAgBnC;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,oBAAoB;IAOvD,YAAmB,KAA0B;QAC5C,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QACrD,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC;QACjD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QACnD,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAE1E,IAAI,CAAC,QAAQ,GAAG,CACf,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC;YAChD,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAChD,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAuC,CAAC;IACnF,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,OAAyB;QAC1D,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC/E,MAAM,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,OAAO,GAAqB,MAAM,gBAAgB,CAAC,WAAW,CAAC;YACpE,OAAO;YACP,eAAe,EAAE,IAAI,CAAC,QAAQ;YAC9B,QAAQ;YACR,gDAAgD;YAChD,cAAc,EAAE,0BAA0B,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC;YACnE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SACzC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IAChB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IContainerContext } from \"@fluidframework/container-definitions\";\nimport { ContainerRuntime } from \"@fluidframework/container-runtime\";\nimport { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { type FluidObject } from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport {\n\ttype RuntimeRequestHandler,\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler\";\nimport {\n\ttype NamedFluidDataStoreRegistryEntries,\n\ttype IFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils\";\n\nconst defaultStoreId = \"\" as const;\n\n/**\n * {@link RuntimeFactory} construction properties.\n * @internal\n */\nexport interface RuntimeFactoryProps {\n\tdefaultStoreFactory: IFluidDataStoreFactory;\n\tstoreFactories: IFluidDataStoreFactory[];\n\t/**\n\t * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\trequestHandlers?: RuntimeRequestHandler[];\n\tprovideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n}\n\n/**\n * @internal\n */\nexport class RuntimeFactory extends RuntimeFactoryHelper {\n\tprivate readonly registry: NamedFluidDataStoreRegistryEntries;\n\n\tprivate readonly defaultStoreFactory: IFluidDataStoreFactory;\n\tprivate readonly requestHandlers: RuntimeRequestHandler[];\n\tprivate readonly provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\n\tpublic constructor(props: RuntimeFactoryProps) {\n\t\tsuper();\n\n\t\tthis.defaultStoreFactory = props.defaultStoreFactory;\n\t\tthis.provideEntryPoint = props.provideEntryPoint;\n\t\tthis.requestHandlers = props.requestHandlers ?? [];\n\t\tconst storeFactories = props.storeFactories ?? [this.defaultStoreFactory];\n\n\t\tthis.registry = (\n\t\t\tstoreFactories.includes(this.defaultStoreFactory)\n\t\t\t\t? storeFactories\n\t\t\t\t: [...storeFactories, this.defaultStoreFactory]\n\t\t).map((factory) => [factory.type, factory]) as NamedFluidDataStoreRegistryEntries;\n\t}\n\n\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\tconst dataStore = await runtime.createDataStore(this.defaultStoreFactory.type);\n\t\tawait dataStore.trySetAlias(defaultStoreId);\n\t}\n\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<ContainerRuntime> {\n\t\tconst runtime: ContainerRuntime = await ContainerRuntime.loadRuntime({\n\t\t\tcontext,\n\t\t\tregistryEntries: this.registry,\n\t\t\texisting,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\trequestHandler: buildRuntimeRequestHandler(...this.requestHandlers),\n\t\t\tprovideEntryPoint: this.provideEntryPoint,\n\t\t});\n\n\t\treturn runtime;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":[],"fileInfos":[],"options":{"composite":false,"declaration":false,"declarationMap":false,"esModuleInterop":true,"inlineSources":true,"jsx":2,"module":100,"noImplicitAny":false,"noUnusedLocals":true,"outDir":"","rootDir":"../../src/test","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7}},"version":"5.1.6"}
|
package/package.json
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluid-experimental/data-object-base",
|
|
3
|
+
"version": "2.0.0-dev-rc.2.0.0.245554",
|
|
4
|
+
"description": "Data object base for synchronously and lazily loaded object scenarios",
|
|
5
|
+
"homepage": "https://fluidframework.com",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/microsoft/FluidFramework.git",
|
|
9
|
+
"directory": "packages/framework/data-object-base"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Microsoft and contributors",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./lib/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"require": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"./public": {
|
|
27
|
+
"import": {
|
|
28
|
+
"types": "./lib/data-object-base-public.d.ts",
|
|
29
|
+
"default": "./lib/index.js"
|
|
30
|
+
},
|
|
31
|
+
"require": {
|
|
32
|
+
"types": "./dist/data-object-base-public.d.ts",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"./internal": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./lib/index.d.ts",
|
|
39
|
+
"default": "./lib/index.js"
|
|
40
|
+
},
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"default": "./dist/index.js"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"main": "dist/index.js",
|
|
48
|
+
"types": "dist/index.d.ts",
|
|
49
|
+
"files": [
|
|
50
|
+
"dist/**/*",
|
|
51
|
+
"!dist/test/**",
|
|
52
|
+
"lib/**/*",
|
|
53
|
+
"es5/**/*"
|
|
54
|
+
],
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@fluid-internal/client-utils": "2.0.0-dev-rc.2.0.0.245554",
|
|
57
|
+
"@fluidframework/container-definitions": "2.0.0-dev-rc.2.0.0.245554",
|
|
58
|
+
"@fluidframework/container-runtime": "2.0.0-dev-rc.2.0.0.245554",
|
|
59
|
+
"@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.2.0.0.245554",
|
|
60
|
+
"@fluidframework/core-interfaces": "2.0.0-dev-rc.2.0.0.245554",
|
|
61
|
+
"@fluidframework/core-utils": "2.0.0-dev-rc.2.0.0.245554",
|
|
62
|
+
"@fluidframework/datastore": "2.0.0-dev-rc.2.0.0.245554",
|
|
63
|
+
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.2.0.0.245554",
|
|
64
|
+
"@fluidframework/request-handler": "2.0.0-dev-rc.2.0.0.245554",
|
|
65
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.2.0.0.245554",
|
|
66
|
+
"@fluidframework/runtime-utils": "2.0.0-dev-rc.2.0.0.245554",
|
|
67
|
+
"@fluidframework/shared-object-base": "2.0.0-dev-rc.2.0.0.245554"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@arethetypeswrong/cli": "^0.13.3",
|
|
71
|
+
"@fluid-tools/build-cli": "^0.34.0",
|
|
72
|
+
"@fluidframework/build-common": "^2.0.3",
|
|
73
|
+
"@fluidframework/build-tools": "^0.34.0",
|
|
74
|
+
"@fluidframework/eslint-config-fluid": "^5.1.0",
|
|
75
|
+
"@microsoft/api-extractor": "^7.42.3",
|
|
76
|
+
"@types/node": "^18.19.0",
|
|
77
|
+
"copyfiles": "^2.4.1",
|
|
78
|
+
"eslint": "~8.55.0",
|
|
79
|
+
"prettier": "~3.0.3",
|
|
80
|
+
"rimraf": "^4.4.0",
|
|
81
|
+
"typescript": "~5.1.6"
|
|
82
|
+
},
|
|
83
|
+
"fluidBuild": {
|
|
84
|
+
"tasks": {
|
|
85
|
+
"build:docs": {
|
|
86
|
+
"dependsOn": [
|
|
87
|
+
"...",
|
|
88
|
+
"api-extractor:commonjs",
|
|
89
|
+
"api-extractor:esnext"
|
|
90
|
+
],
|
|
91
|
+
"script": false
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"typeValidation": {
|
|
96
|
+
"disabled": true,
|
|
97
|
+
"broken": {}
|
|
98
|
+
},
|
|
99
|
+
"scripts": {
|
|
100
|
+
"api": "fluid-build . --task api",
|
|
101
|
+
"api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
|
|
102
|
+
"api-extractor:esnext": "api-extractor run --local",
|
|
103
|
+
"build": "fluid-build . --task build",
|
|
104
|
+
"build:compile": "fluid-build . --task compile",
|
|
105
|
+
"build:docs": "fluid-build . --task api",
|
|
106
|
+
"build:esnext": "tsc --project ./tsconfig.json",
|
|
107
|
+
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
108
|
+
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
109
|
+
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
110
|
+
"check:are-the-types-wrong": "attw --pack . --entrypoints .",
|
|
111
|
+
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
112
|
+
"ci:build:docs": "api-extractor run",
|
|
113
|
+
"clean": "rimraf --glob dist lib es5 \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp",
|
|
114
|
+
"eslint": "eslint --format stylish src",
|
|
115
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
116
|
+
"format": "npm run prettier:fix",
|
|
117
|
+
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
|
|
118
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
119
|
+
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
120
|
+
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
121
|
+
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
122
|
+
"typetests:gen": "fluid-type-test-generator",
|
|
123
|
+
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
|
|
124
|
+
}
|
|
125
|
+
}
|