@fluidframework/aqueduct 2.0.0-rc.4.0.6 → 2.0.0-rc.5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/api-extractor/api-extractor-lint-bundle.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-public.esm.json +5 -0
- package/api-extractor.json +1 -1
- package/api-report/{aqueduct.api.md → aqueduct.alpha.api.md} +25 -24
- package/api-report/aqueduct.beta.api.md +40 -0
- package/api-report/aqueduct.public.api.md +40 -0
- package/biome.jsonc +4 -0
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +4 -4
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +6 -6
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/dist/data-object-factories/dataObjectFactory.d.ts +4 -4
- package/dist/data-object-factories/dataObjectFactory.d.ts.map +1 -1
- package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.d.ts +5 -5
- package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.js +2 -1
- package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/dist/data-objects/dataObject.d.ts +7 -1
- package/dist/data-objects/dataObject.d.ts.map +1 -1
- package/dist/data-objects/dataObject.js +9 -1
- package/dist/data-objects/dataObject.js.map +1 -1
- package/dist/data-objects/index.d.ts +1 -1
- package/dist/data-objects/index.d.ts.map +1 -1
- package/dist/data-objects/index.js +2 -1
- package/dist/data-objects/index.js.map +1 -1
- package/dist/data-objects/pureDataObject.d.ts +6 -6
- package/dist/data-objects/pureDataObject.d.ts.map +1 -1
- package/dist/data-objects/pureDataObject.js.map +1 -1
- package/dist/data-objects/types.d.ts +4 -4
- package/dist/data-objects/types.d.ts.map +1 -1
- package/dist/data-objects/types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts +4 -4
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +6 -6
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/lib/data-object-factories/dataObjectFactory.d.ts +4 -4
- package/lib/data-object-factories/dataObjectFactory.d.ts.map +1 -1
- package/lib/data-object-factories/dataObjectFactory.js.map +1 -1
- package/lib/data-object-factories/pureDataObjectFactory.d.ts +5 -5
- package/lib/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
- package/lib/data-object-factories/pureDataObjectFactory.js +2 -1
- package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/lib/data-objects/dataObject.d.ts +7 -1
- package/lib/data-objects/dataObject.d.ts.map +1 -1
- package/lib/data-objects/dataObject.js +8 -1
- package/lib/data-objects/dataObject.js.map +1 -1
- package/lib/data-objects/index.d.ts +1 -1
- package/lib/data-objects/index.d.ts.map +1 -1
- package/lib/data-objects/index.js +1 -1
- package/lib/data-objects/index.js.map +1 -1
- package/lib/data-objects/pureDataObject.d.ts +6 -6
- package/lib/data-objects/pureDataObject.d.ts.map +1 -1
- package/lib/data-objects/pureDataObject.js.map +1 -1
- package/lib/data-objects/types.d.ts +4 -4
- package/lib/data-objects/types.d.ts.map +1 -1
- package/lib/data-objects/types.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/tsdoc-metadata.json +1 -1
- package/package.json +35 -30
- package/src/container-runtime-factories/baseContainerRuntimeFactory.ts +7 -7
- package/src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts +10 -10
- package/src/data-object-factories/dataObjectFactory.ts +4 -8
- package/src/data-object-factories/pureDataObjectFactory.ts +30 -30
- package/src/data-objects/dataObject.ts +17 -2
- package/src/data-objects/index.ts +1 -1
- package/src/data-objects/pureDataObject.ts +15 -11
- package/src/data-objects/types.ts +4 -4
- package/src/index.ts +1 -0
- package/tsconfig.json +1 -0
- package/tsdoc.json +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @fluidframework/aqueduct
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.5.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Update to TypeScript 5.4 ([#21214](https://github.com/microsoft/FluidFramework/pull/21214)) [0e6256c722](https://github.com/microsoft/FluidFramework/commit/0e6256c722d8bf024f4325bf02547daeeb18bfa6)
|
|
8
|
+
|
|
9
|
+
Update package implementations to use TypeScript 5.4.5.
|
|
10
|
+
|
|
3
11
|
## 2.0.0-rc.4.0.0
|
|
4
12
|
|
|
5
13
|
Dependency updates only.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/legacy.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/legacy.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/public.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
|
|
5
|
+
}
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-base.esm.
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.esm.current.json"
|
|
4
4
|
}
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
## API Report File for "@fluidframework/aqueduct"
|
|
1
|
+
## Alpha API Report File for "@fluidframework/aqueduct"
|
|
2
2
|
|
|
3
3
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
-
import { AsyncFluidObjectProvider } from '@fluidframework/synthesize/internal';
|
|
7
|
+
import type { AsyncFluidObjectProvider } from '@fluidframework/synthesize/internal';
|
|
8
8
|
import { ContainerRuntime } from '@fluidframework/container-runtime/internal';
|
|
9
9
|
import { FluidDataStoreRuntime } from '@fluidframework/datastore/internal';
|
|
10
|
-
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
11
|
-
import { FluidObjectSymbolProvider } from '@fluidframework/synthesize/internal';
|
|
12
|
-
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
13
|
-
import { IContainerContext } from '@fluidframework/container-definitions/internal';
|
|
14
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions/internal';
|
|
15
|
-
import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions/internal';
|
|
10
|
+
import type { FluidObject } from '@fluidframework/core-interfaces';
|
|
11
|
+
import type { FluidObjectSymbolProvider } from '@fluidframework/synthesize/internal';
|
|
12
|
+
import type { IChannelFactory } from '@fluidframework/datastore-definitions/internal';
|
|
13
|
+
import type { IContainerContext } from '@fluidframework/container-definitions/internal';
|
|
14
|
+
import type { IContainerRuntime } from '@fluidframework/container-runtime-definitions/internal';
|
|
15
|
+
import type { IContainerRuntimeBase } from '@fluidframework/runtime-definitions/internal';
|
|
16
16
|
import { IContainerRuntimeOptions } from '@fluidframework/container-runtime/internal';
|
|
17
|
-
import { IDataStore } from '@fluidframework/runtime-definitions/internal';
|
|
18
|
-
import { IEvent } from '@fluidframework/core-interfaces';
|
|
19
|
-
import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions/internal';
|
|
20
|
-
import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions/internal';
|
|
21
|
-
import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions/internal';
|
|
22
|
-
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions/internal';
|
|
23
|
-
import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
24
|
-
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
17
|
+
import type { IDataStore } from '@fluidframework/runtime-definitions/internal';
|
|
18
|
+
import type { IEvent } from '@fluidframework/core-interfaces';
|
|
19
|
+
import type { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions/internal';
|
|
20
|
+
import type { IFluidDataStoreContext } from '@fluidframework/runtime-definitions/internal';
|
|
21
|
+
import type { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions/internal';
|
|
22
|
+
import type { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions/internal';
|
|
23
|
+
import type { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
24
|
+
import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions/internal';
|
|
25
25
|
import { IFluidDependencySynthesizer } from '@fluidframework/synthesize/internal';
|
|
26
|
-
import { IFluidHandleInternal } from '@fluidframework/core-interfaces/internal';
|
|
27
|
-
import { IFluidLoadable } from '@fluidframework/core-interfaces
|
|
28
|
-
import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
29
|
-
import { IProvideFluidHandle } from '@fluidframework/core-interfaces/internal';
|
|
30
|
-
import { IRequest } from '@fluidframework/core-interfaces
|
|
31
|
-
import { IResponse } from '@fluidframework/core-interfaces
|
|
26
|
+
import type { IFluidHandleInternal } from '@fluidframework/core-interfaces/internal';
|
|
27
|
+
import type { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
28
|
+
import type { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
29
|
+
import type { IProvideFluidHandle } from '@fluidframework/core-interfaces/internal';
|
|
30
|
+
import type { IRequest } from '@fluidframework/core-interfaces';
|
|
31
|
+
import type { IResponse } from '@fluidframework/core-interfaces';
|
|
32
32
|
import { ISharedDirectory } from '@fluidframework/map/internal';
|
|
33
|
-
import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions/internal';
|
|
34
|
-
import { NamedFluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions/internal';
|
|
33
|
+
import type { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions/internal';
|
|
34
|
+
import type { NamedFluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions/internal';
|
|
35
35
|
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils/internal';
|
|
36
36
|
import { RuntimeRequestHandler } from '@fluidframework/request-handler/internal';
|
|
37
|
+
import type { SharedObjectKind } from '@fluidframework/shared-object-base';
|
|
37
38
|
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
38
39
|
|
|
39
40
|
// @alpha
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
## Beta API Report File for "@fluidframework/aqueduct"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import type { AsyncFluidObjectProvider } from '@fluidframework/synthesize/internal';
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime/internal';
|
|
9
|
+
import { FluidDataStoreRuntime } from '@fluidframework/datastore/internal';
|
|
10
|
+
import type { FluidObject } from '@fluidframework/core-interfaces';
|
|
11
|
+
import type { FluidObjectSymbolProvider } from '@fluidframework/synthesize/internal';
|
|
12
|
+
import type { IChannelFactory } from '@fluidframework/datastore-definitions/internal';
|
|
13
|
+
import type { IContainerContext } from '@fluidframework/container-definitions/internal';
|
|
14
|
+
import type { IContainerRuntime } from '@fluidframework/container-runtime-definitions/internal';
|
|
15
|
+
import type { IContainerRuntimeBase } from '@fluidframework/runtime-definitions/internal';
|
|
16
|
+
import { IContainerRuntimeOptions } from '@fluidframework/container-runtime/internal';
|
|
17
|
+
import type { IDataStore } from '@fluidframework/runtime-definitions/internal';
|
|
18
|
+
import type { IEvent } from '@fluidframework/core-interfaces';
|
|
19
|
+
import type { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions/internal';
|
|
20
|
+
import type { IFluidDataStoreContext } from '@fluidframework/runtime-definitions/internal';
|
|
21
|
+
import type { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions/internal';
|
|
22
|
+
import type { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions/internal';
|
|
23
|
+
import type { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
24
|
+
import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions/internal';
|
|
25
|
+
import { IFluidDependencySynthesizer } from '@fluidframework/synthesize/internal';
|
|
26
|
+
import type { IFluidHandleInternal } from '@fluidframework/core-interfaces/internal';
|
|
27
|
+
import type { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
28
|
+
import type { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
29
|
+
import type { IProvideFluidHandle } from '@fluidframework/core-interfaces/internal';
|
|
30
|
+
import type { IRequest } from '@fluidframework/core-interfaces';
|
|
31
|
+
import type { IResponse } from '@fluidframework/core-interfaces';
|
|
32
|
+
import { ISharedDirectory } from '@fluidframework/map/internal';
|
|
33
|
+
import type { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions/internal';
|
|
34
|
+
import type { NamedFluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions/internal';
|
|
35
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils/internal';
|
|
36
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler/internal';
|
|
37
|
+
import type { SharedObjectKind } from '@fluidframework/shared-object-base';
|
|
38
|
+
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
39
|
+
|
|
40
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
## Public API Report File for "@fluidframework/aqueduct"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import type { AsyncFluidObjectProvider } from '@fluidframework/synthesize/internal';
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime/internal';
|
|
9
|
+
import { FluidDataStoreRuntime } from '@fluidframework/datastore/internal';
|
|
10
|
+
import type { FluidObject } from '@fluidframework/core-interfaces';
|
|
11
|
+
import type { FluidObjectSymbolProvider } from '@fluidframework/synthesize/internal';
|
|
12
|
+
import type { IChannelFactory } from '@fluidframework/datastore-definitions/internal';
|
|
13
|
+
import type { IContainerContext } from '@fluidframework/container-definitions/internal';
|
|
14
|
+
import type { IContainerRuntime } from '@fluidframework/container-runtime-definitions/internal';
|
|
15
|
+
import type { IContainerRuntimeBase } from '@fluidframework/runtime-definitions/internal';
|
|
16
|
+
import { IContainerRuntimeOptions } from '@fluidframework/container-runtime/internal';
|
|
17
|
+
import type { IDataStore } from '@fluidframework/runtime-definitions/internal';
|
|
18
|
+
import type { IEvent } from '@fluidframework/core-interfaces';
|
|
19
|
+
import type { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions/internal';
|
|
20
|
+
import type { IFluidDataStoreContext } from '@fluidframework/runtime-definitions/internal';
|
|
21
|
+
import type { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions/internal';
|
|
22
|
+
import type { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions/internal';
|
|
23
|
+
import type { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
24
|
+
import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions/internal';
|
|
25
|
+
import { IFluidDependencySynthesizer } from '@fluidframework/synthesize/internal';
|
|
26
|
+
import type { IFluidHandleInternal } from '@fluidframework/core-interfaces/internal';
|
|
27
|
+
import type { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
28
|
+
import type { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions/internal';
|
|
29
|
+
import type { IProvideFluidHandle } from '@fluidframework/core-interfaces/internal';
|
|
30
|
+
import type { IRequest } from '@fluidframework/core-interfaces';
|
|
31
|
+
import type { IResponse } from '@fluidframework/core-interfaces';
|
|
32
|
+
import { ISharedDirectory } from '@fluidframework/map/internal';
|
|
33
|
+
import type { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions/internal';
|
|
34
|
+
import type { NamedFluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions/internal';
|
|
35
|
+
import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils/internal';
|
|
36
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler/internal';
|
|
37
|
+
import type { SharedObjectKind } from '@fluidframework/shared-object-base';
|
|
38
|
+
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
39
|
+
|
|
40
|
+
```
|
package/biome.jsonc
ADDED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import type { IContainerContext } from "@fluidframework/container-definitions/internal";
|
|
6
6
|
import { ContainerRuntime, type IContainerRuntimeOptions } from "@fluidframework/container-runtime/internal";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import type { IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
8
|
+
import type { FluidObject } from "@fluidframework/core-interfaces";
|
|
9
9
|
import { type RuntimeRequestHandler } from "@fluidframework/request-handler/internal";
|
|
10
|
-
import {
|
|
10
|
+
import type { IFluidDataStoreRegistry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions/internal";
|
|
11
11
|
import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils/internal";
|
|
12
12
|
import { type IFluidDependencySynthesizer } from "@fluidframework/synthesize/internal";
|
|
13
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseContainerRuntimeFactory.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"baseContainerRuntimeFactory.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EACN,gBAAgB,EAEhB,KAAK,wBAAwB,EAC7B,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAEN,KAAK,qBAAqB,EAG1B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACX,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAEN,KAAK,2BAA2B,EAEhC,MAAM,qCAAqC,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,eAAe,EAAE,kCAAkC,CAAC;IACpD;;OAEG;IACH,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;IAClD;;;OAGG;IAEH,eAAe,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC1C;;OAEG;IACH,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C;;;OAGG;IACH,iBAAiB,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACxE;AAED;;;;;GAKG;AACH,qBAAa,2BACZ,SAAQ,oBACR,YAAW,8BAA8B;IAEzC;;OAEG;IACH,IAAW,uBAAuB,IAAI,uBAAuB,CAE5D;IACD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IAEnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqC;IACrE,OAAO,CAAC,QAAQ,C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iB,CAAC;QACjD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,iCAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAClE,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,OAAyB;QAC1D,MAAM,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAAC,OAAyB;QAC7D,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,KAAK,GAAgD,OAAO,CAAC,KAAK,CAAC;QACzE,IAAI,IAAI,CAAC,mBAAmB,EAAE;
|
|
1
|
+
{"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAIoD;AAGpD,uEAKkD;AAMlD,qEAA8E;AAC9E,kEAI6C;AAgC7C;;;;;GAKG;AACH,MAAa,2BACZ,SAAQ,+BAAoB;IAG5B;;OAEG;IACH,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAUD,YAAmB,KAAuC;QACzD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAC7C,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QACrD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;QAC3C,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC;QACjD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,iCAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAClE,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAAC,OAAyB;QAC1D,MAAM,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAAC,OAAyB;QAC7D,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,KAAK,GAAgD,OAAO,CAAC,KAAK,CAAC;QACzE,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC9B,MAAM,EAAE,GAAG,IAAI,8BAAmB,CACjC,IAAI,CAAC,mBAAmB,EACxB,KAAK,CAAC,2BAA2B,CACjC,CAAC;YACF,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC;QACxC,CAAC;QAED,OAAO,2BAAgB,CAAC,WAAW,CAAC;YACnC,OAAO;YACP,QAAQ;YACR,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,cAAc,EAAE,KAAK;YACrB,gDAAgD;YAChD,cAAc,EAAE,IAAA,qCAA0B,EAAC,GAAG,IAAI,CAAC,eAAe,CAAC;YACnE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SACzC,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B,IAAkB,CAAC;IAE5F;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAkB,CAAC;CACrF;AA7ED,kEA6EC","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/internal\";\nimport {\n\tContainerRuntime,\n\tFluidDataStoreRegistry,\n\ttype IContainerRuntimeOptions,\n} from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\ttype RuntimeRequestHandler,\n\t// eslint-disable-next-line import/no-deprecated\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler/internal\";\nimport type {\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tDependencyContainer,\n\ttype IFluidDependencySynthesizer,\n\ttype IProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize/internal\";\n\n/**\n * {@link BaseContainerRuntimeFactory} construction properties.\n * @alpha\n */\nexport interface BaseContainerRuntimeFactoryProps {\n\t/**\n\t * The data store registry for containers produced.\n\t */\n\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t/**\n\t * @deprecated Will be removed in a future release.\n\t */\n\tdependencyContainer?: IFluidDependencySynthesizer;\n\t/**\n\t * Request handlers for containers produced.\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\t// eslint-disable-next-line import/no-deprecated\n\trequestHandlers?: RuntimeRequestHandler[];\n\t/**\n\t * The runtime options passed to the ContainerRuntime when instantiating it\n\t */\n\truntimeOptions?: IContainerRuntimeOptions;\n\t/**\n\t * Function that will initialize the entryPoint of the ContainerRuntime instances\n\t * created with this factory\n\t */\n\tprovideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n}\n\n/**\n * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,\n * request handlers, runtimeOptions, and entryPoint initialization function.\n * It can be subclassed to implement a first-time initialization procedure for the containers it creates.\n * @alpha\n */\nexport class BaseContainerRuntimeFactory\n\textends RuntimeFactoryHelper\n\timplements IProvideFluidDataStoreRegistry\n{\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}\n\t */\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry {\n\t\treturn this.registry;\n\t}\n\tprivate readonly registry: IFluidDataStoreRegistry;\n\n\tprivate readonly registryEntries: NamedFluidDataStoreRegistryEntries;\n\tprivate readonly dependencyContainer?: IFluidDependencySynthesizer;\n\tprivate readonly runtimeOptions?: IContainerRuntimeOptions;\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly requestHandlers: RuntimeRequestHandler[];\n\tprivate readonly provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\n\tpublic constructor(props: BaseContainerRuntimeFactoryProps) {\n\t\tsuper();\n\n\t\tthis.registryEntries = props.registryEntries;\n\t\tthis.dependencyContainer = props.dependencyContainer;\n\t\tthis.runtimeOptions = props.runtimeOptions;\n\t\tthis.provideEntryPoint = props.provideEntryPoint;\n\t\tthis.requestHandlers = props.requestHandlers ?? [];\n\t\tthis.registry = new FluidDataStoreRegistry(this.registryEntries);\n\t}\n\n\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerInitializingFirstTime(runtime);\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<ContainerRuntime> {\n\t\tconst scope: Partial<IProvideFluidDependencySynthesizer> = context.scope;\n\t\tif (this.dependencyContainer) {\n\t\t\tconst dc = new DependencyContainer<FluidObject>(\n\t\t\t\tthis.dependencyContainer,\n\t\t\t\tscope.IFluidDependencySynthesizer,\n\t\t\t);\n\t\t\tscope.IFluidDependencySynthesizer = dc;\n\t\t}\n\n\t\treturn ContainerRuntime.loadRuntime({\n\t\t\tcontext,\n\t\t\texisting,\n\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\tregistryEntries: this.registryEntries,\n\t\t\tcontainerScope: scope,\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\t}\n\n\t/**\n\t * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container\n\t * is created. This likely includes creating any initial data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void> {}\n\n\t/**\n\t * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.\n\t * This likely includes loading any data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerHasInitialized(runtime: IContainerRuntime): Promise<void> {}\n}\n"]}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import type { IContainerRuntimeOptions } from "@fluidframework/container-runtime/internal";
|
|
6
|
+
import type { IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
7
|
+
import type { FluidObject } from "@fluidframework/core-interfaces";
|
|
8
|
+
import type { RuntimeRequestHandler } from "@fluidframework/request-handler/internal";
|
|
9
|
+
import type { IFluidDataStoreFactory, NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions/internal";
|
|
10
|
+
import type { IFluidDependencySynthesizer } from "@fluidframework/synthesize/internal";
|
|
11
11
|
import { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory.js";
|
|
12
12
|
/**
|
|
13
13
|
* {@link ContainerRuntimeFactoryWithDefaultDataStore} construction properties.
|
package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAEX,wBAAwB,EACxB,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,iCAAiC,CAAC;AAExF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,KAAK,EACX,sBAAsB,EACtB,kCAAkC,EAClC,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAEvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAY/E;;;GAGG;AACH,MAAM,WAAW,gDAAgD;IAChE,cAAc,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,eAAe,EAAE,kCAAkC,CAAC;IACpD;;OAEG;IACH,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;IAClD;;;OAGG;IAEH,eAAe,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC1C;;OAEG;IACH,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACzE;AAED;;;;;;GAMG;AACH,qBAAa,2CAA4C,SAAQ,2BAA2B;IAC3F,gBAAuB,kBAAkB,aAAsB;IAE/D,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAC;gBAEvC,KAAK,EAAE,gDAAgD;IA6B1E;;OAEG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,qEAAuE;AAGvE,qFAA+E;AAE/E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC,KAAK,UAAU,qBAAqB,CAAC,OAA0B;IAC9D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC;IAC1E,IAAI,UAAU,KAAK,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,qEAAuE;AAGvE,qFAA+E;AAE/E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC,KAAK,UAAU,qBAAqB,CAAC,OAA0B;IAC9D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC;IAC1E,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAA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All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tContainerRuntime,\n\tIContainerRuntimeOptions,\n} from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport type { RuntimeRequestHandler } from \"@fluidframework/request-handler/internal\";\nimport type {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RequestParser } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidDependencySynthesizer } from \"@fluidframework/synthesize/internal\";\n\nimport { BaseContainerRuntimeFactory } from \"./baseContainerRuntimeFactory.js\";\n\nconst defaultDataStoreId = \"default\";\n\nasync function getDefaultFluidObject(runtime: IContainerRuntime): Promise<FluidObject> {\n\tconst entryPoint = await runtime.getAliasedDataStoreEntryPoint(\"default\");\n\tif (entryPoint === undefined) {\n\t\tthrow new Error(\"default dataStore must exist\");\n\t}\n\treturn entryPoint.get();\n}\n\n/**\n * {@link ContainerRuntimeFactoryWithDefaultDataStore} construction properties.\n * @alpha\n */\nexport interface ContainerRuntimeFactoryWithDefaultDataStoreProps {\n\tdefaultFactory: IFluidDataStoreFactory;\n\t/**\n\t * The data store registry for containers produced.\n\t */\n\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t/**\n\t * @deprecated Will be removed in a future release.\n\t */\n\tdependencyContainer?: IFluidDependencySynthesizer;\n\t/**\n\t * Request handlers for containers produced.\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\t// eslint-disable-next-line import/no-deprecated\n\trequestHandlers?: RuntimeRequestHandler[];\n\t/**\n\t * The runtime options passed to the ContainerRuntime when instantiating it\n\t */\n\truntimeOptions?: IContainerRuntimeOptions;\n\t/**\n\t * Function that will initialize the entryPoint of the ContainerRuntime instances\n\t * created with this factory\n\t */\n\tprovideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;\n}\n\n/**\n * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from\n * the container with an empty URL.\n *\n * This factory should be exposed as fluidExport off the entry point to your module.\n * @alpha\n */\nexport class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {\n\tpublic static readonly defaultDataStoreId = defaultDataStoreId;\n\n\tprotected readonly defaultFactory: IFluidDataStoreFactory;\n\n\tpublic constructor(props: ContainerRuntimeFactoryWithDefaultDataStoreProps) {\n\t\tconst requestHandlers = props.requestHandlers ?? [];\n\t\tconst provideEntryPoint = props.provideEntryPoint ?? getDefaultFluidObject;\n\n\t\tconst getDefaultObject = async (\n\t\t\trequest: IRequest,\n\t\t\truntime: IContainerRuntime,\n\t\t\t// eslint-disable-next-line unicorn/consistent-function-scoping\n\t\t): Promise<IResponse | undefined> => {\n\t\t\tconst parser = RequestParser.create(request);\n\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t// This cast is safe as ContainerRuntime.loadRuntime is called in the base class\n\t\t\t\treturn (runtime as ContainerRuntime).resolveHandle({\n\t\t\t\t\turl: `/${defaultDataStoreId}${parser.query}`,\n\t\t\t\t\theaders: request.headers,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn undefined; // continue search\n\t\t};\n\n\t\tsuper({\n\t\t\t...props,\n\t\t\trequestHandlers: [getDefaultObject, ...requestHandlers],\n\t\t\tprovideEntryPoint,\n\t\t});\n\n\t\tthis.defaultFactory = props.defaultFactory;\n\t}\n\n\t/**\n\t * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void> {\n\t\tconst dataStore = await runtime.createDataStore(this.defaultFactory.type);\n\t\tawait dataStore.trySetAlias(defaultDataStoreId);\n\t}\n}\n"]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal";
|
|
7
|
+
import type { NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions/internal";
|
|
8
|
+
import type { FluidObjectSymbolProvider } from "@fluidframework/synthesize/internal";
|
|
9
|
+
import type { DataObject, DataObjectTypes, IDataObjectProps } from "../data-objects/index.js";
|
|
10
10
|
import { PureDataObjectFactory } from "./pureDataObjectFactory.js";
|
|
11
11
|
/**
|
|
12
12
|
* DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAQtF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AACvG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;GAQG;AACH,qBAAa,iBAAiB,CAC7B,IAAI,SAAS,UAAU,CAAC,CAAC,CAAC,EAC1B,CAAC,SAAS,eAAe,GAAG,eAAe,CAC1C,SAAQ,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC;gBAEtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,KAAK,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,EAC9C,aAAa,iDAAiC,EAC9C,iBAAiB,EAAE,yBAAyB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,EACpE,eAAe,CAAC,EAAE,kCAAkC,EACpD,cAAc,GAAE,OAAO,qBAA6C;CAkBrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iEAA2E;AAE3E,2DAMsC;
|
|
1
|
+
{"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iEAA2E;AAE3E,2DAMsC;AAMtC,yEAAmE;AAEnE;;;;;;;;GAQG;AACH,MAAa,iBAGX,SAAQ,gDAA8B;IACvC,YACC,IAAY,EACZ,IAA8C,EAC9C,gBAA4C,EAAE,EAC9C,iBAAoE,EACpE,eAAoD,EACpD,iBAA+C,gCAAqB;QAEpE,MAAM,aAAa,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC;QAEzC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,2BAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9E,sCAAsC;YACtC,gDAAgD;YAChD,aAAa,CAAC,IAAI,CAAC,0BAAe,CAAC,UAAU,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,0GAA0G;QAC1G,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,qBAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACxE,gCAAgC;YAChC,aAAa,CAAC,IAAI,CAAC,oBAAS,CAAC,UAAU,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IACtF,CAAC;CACD;AA5BD,8CA4BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidDataStoreRuntime } from \"@fluidframework/datastore/internal\";\nimport type { IChannelFactory } from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tSharedMap,\n\tDirectoryFactory,\n\tMapFactory,\n\t// eslint-disable-next-line import/no-deprecated\n\tSharedDirectory,\n} from \"@fluidframework/map/internal\";\nimport type { NamedFluidDataStoreRegistryEntries } from \"@fluidframework/runtime-definitions/internal\";\nimport type { FluidObjectSymbolProvider } from \"@fluidframework/synthesize/internal\";\n\nimport type { DataObject, DataObjectTypes, IDataObjectProps } from \"../data-objects/index.js\";\n\nimport { PureDataObjectFactory } from \"./pureDataObjectFactory.js\";\n\n/**\n * DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.\n * It facilitates DataObject's features (such as its shared directory) by\n * ensuring relevant shared objects etc are available to the factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n * @alpha\n */\nexport class DataObjectFactory<\n\tTObj extends DataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObjectFactory<TObj, I> {\n\tpublic constructor(\n\t\ttype: string,\n\t\tctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects: readonly IChannelFactory[] = [],\n\t\toptionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\truntimeFactory: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n\t) {\n\t\tconst mergedObjects = [...sharedObjects];\n\n\t\tif (!sharedObjects.some((factory) => factory.type === DirectoryFactory.Type)) {\n\t\t\t// User did not register for directory\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tmergedObjects.push(SharedDirectory.getFactory());\n\t\t}\n\n\t\t// TODO: Remove SharedMap factory when compatibility with SharedMap DataObject is no longer needed in 0.10\n\t\tif (!sharedObjects.some((factory) => factory.type === MapFactory.Type)) {\n\t\t\t// User did not register for map\n\t\t\tmergedObjects.push(SharedMap.getFactory());\n\t\t}\n\n\t\tsuper(type, ctor, mergedObjects, optionalProviders, registryEntries, runtimeFactory);\n\t}\n}\n"]}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import type { IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
6
6
|
import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal";
|
|
8
|
+
import type { IContainerRuntimeBase, IDataStore, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreFactory, IFluidDataStoreRegistry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries, NamedFluidDataStoreRegistryEntry } from "@fluidframework/runtime-definitions/internal";
|
|
9
|
+
import type { FluidObjectSymbolProvider } from "@fluidframework/synthesize/internal";
|
|
10
|
+
import type { DataObjectTypes, IDataObjectProps, PureDataObject } from "../data-objects/index.js";
|
|
11
11
|
/**
|
|
12
12
|
* PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.
|
|
13
13
|
* Consumers should typically use DataObjectFactory instead unless creating
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pureDataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAGhG,OAAO,EACN,qBAAqB,EAGrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACX,eAAe,EAEf,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAEX,yBAAyB,EAEzB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EACX,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,MAAM,0BAA0B,CAAC;AAwFlC;;;;;;;;GAQG;AACH,qBAAa,qBAAqB,CACjC,IAAI,SAAS,cAAc,CAAC,CAAC,CAAC,EAC9B,CAAC,SAAS,eAAe,GAAG,eAAe,CAC1C,YAAW,sBAAsB,EAAE,OAAO,CAAC,8BAA8B,CAAC;IAM1E;;OAEG;aACa,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAErB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAElC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAZ9B,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAwB;IAC7D,OA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ChC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAChC,cAAc,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAmB9B;;;;;;;;;;;;OAYG;IACU,kBAAkB,CAC9B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,iBAAiB,EAC1B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;cAqBA,yBAAyB,CACxC,gBAAgB,EAAE,qBAAqB,EACvC,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAC/B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,EAChC,cAAc,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC;cAKA,kBAAkB,CACjC,OAAO,EAAE,8BAA8B,EACvC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;CAehB"}
|
|
@@ -25,7 +25,8 @@ async function createDataObject(ctor, context, sharedObjectRegistry, optionalPro
|
|
|
25
25
|
// Create a new runtime for our data store, as if via new FluidDataStoreRuntime,
|
|
26
26
|
// but using the runtimeClass that's been augmented with mixins
|
|
27
27
|
// The runtime is what Fluid uses to create DDS' and route to your data store
|
|
28
|
-
const runtime = new runtimeClass(
|
|
28
|
+
const runtime = new runtimeClass(
|
|
29
|
+
// calls new FluidDataStoreRuntime(...)
|
|
29
30
|
context, sharedObjectRegistry, existing, async (rt) => {
|
|
30
31
|
(0, internal_2.assert)(instance !== undefined, 0x46a /* entryPoint is undefined */);
|
|
31
32
|
// Calling finishInitialization here like PureDataObject.getDataObject did, to keep the same behavior,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yE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AC,MAAM,KAAK,SAAS,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;YAC/E,OAAO,CAAC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAS,CAAC;SACpC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAES,KAAK,CAAC,yBAAyB,CACxC,gBAAuC,EACvC,WAA+B,EAC/B,YAAgC,EAChC,cAAuB;QAEvB,MAAM,OAAO,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;IAES,KAAK,CAAC,kBAAkB,CACjC,OAAuC,EACvC,YAAgC;QAEhC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,gBAAgB,CACnD,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CACZ,CAAC;QAEF,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AAlPD,sDAkPC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime/internal\";\nimport { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport { type FluidObject, type IRequest } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFluidDataStoreRuntime,\n\ttype ISharedObjectRegistry,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore/internal\";\nimport {\n\ttype IChannelFactory,\n\ttype IFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n\ttype IContainerRuntimeBase,\n\ttype IDataStore,\n\ttype IFluidDataStoreChannel,\n\ttype IFluidDataStoreContext,\n\ttype IFluidDataStoreContextDetached,\n\ttype IFluidDataStoreFactory,\n\ttype IFluidDataStoreRegistry,\n\ttype IProvideFluidDataStoreRegistry,\n\ttype NamedFluidDataStoreRegistryEntries,\n\ttype NamedFluidDataStoreRegistryEntry,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\ttype AsyncFluidObjectProvider,\n\ttype FluidObjectSymbolProvider,\n\ttype IFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize/internal\";\n\nimport {\n\ttype DataObjectTypes,\n\ttype IDataObjectProps,\n\ttype PureDataObject,\n} from \"../data-objects/index.js\";\n\n/**\n * Proxy over PureDataObject\n * Does delayed creation & initialization of PureDataObject\n */\nasync function createDataObject<\n\tTObj extends PureDataObject,\n\tI extends DataObjectTypes = DataObjectTypes,\n>(\n\tctor: new (props: IDataObjectProps<I>) => TObj,\n\tcontext: IFluidDataStoreContext,\n\tsharedObjectRegistry: ISharedObjectRegistry,\n\toptionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\truntimeClassArg: typeof FluidDataStoreRuntime,\n\texisting: boolean,\n\tinitProps?: I[\"InitialState\"],\n): Promise<{\n\tinstance: TObj;\n\truntime: FluidDataStoreRuntime;\n}> {\n\t// base\n\tlet runtimeClass = runtimeClassArg;\n\n\t// request mixin in\n\truntimeClass = mixinRequestHandler(\n\t\tasync (request: IRequest, runtimeArg: FluidDataStoreRuntime) => {\n\t\t\t// The provideEntryPoint callback below always returns TObj, so this cast is safe\n\t\t\tconst dataObject = (await runtimeArg.entryPoint.get()) as TObj;\n\t\t\tassert(\n\t\t\t\tdataObject.request !== undefined,\n\t\t\t\t0x795 /* Data store runtime entryPoint does not have request */,\n\t\t\t);\n\t\t\treturn dataObject.request(request);\n\t\t},\n\t\truntimeClass,\n\t);\n\n\t// Create a new runtime for our data store, as if via new FluidDataStoreRuntime,\n\t// but using the runtimeClass that's been augmented with mixins\n\t// The runtime is what Fluid uses to create DDS' and route to your data store\n\tconst runtime: FluidDataStoreRuntime = new runtimeClass( // calls new FluidDataStoreRuntime(...)\n\t\tcontext,\n\t\tsharedObjectRegistry,\n\t\texisting,\n\t\tasync (rt: IFluidDataStoreRuntime) => {\n\t\t\tassert(instance !== undefined, 0x46a /* entryPoint is undefined */);\n\t\t\t// Calling finishInitialization here like PureDataObject.getDataObject did, to keep the same behavior,\n\t\t\t// since accessing the runtime's entryPoint is how we want the data object to be retrieved going forward.\n\t\t\t// Without this I ran into issues with the load-existing flow not working correctly.\n\t\t\tawait instance.finishInitialization(true);\n\t\t\treturn instance;\n\t\t} /* provideEntryPoint */,\n\t);\n\n\t// Create object right away.\n\t// This allows object to register various callbacks with runtime before runtime\n\t// becomes globally available. But it's not full initialization - constructor can't\n\t// access DDSes or other services of runtime as objects are not fully initialized.\n\t// In order to use object, we need to go through full initialization by calling finishInitialization().\n\tconst scope: FluidObject<IFluidDependencySynthesizer> = context.scope;\n\tconst providers =\n\t\tscope.IFluidDependencySynthesizer?.synthesize<I[\"OptionalProviders\"]>(\n\t\t\toptionalProviders,\n\t\t\t{},\n\t\t) ??\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t({} as AsyncFluidObjectProvider<never>);\n\n\tconst instance = new ctor({ runtime, context, providers, initProps });\n\n\t// if it's a newly created object, we need to wait for it to finish initialization\n\t// as that results in creation of DDSes, before it gets attached, providing atomic\n\t// guarantee of creation.\n\t// WARNING: we can't do the same (yet) for already existing PureDataObject!\n\t// This will result in deadlock, as it tries to resolve internal handles, but any\n\t// handle resolution goes through root (container runtime), which can't route it back\n\t// to this data store, as it's still not initialized and not known to container runtime yet.\n\t// In the future, we should address it by using relative paths for handles and be able to resolve\n\t// local DDSes while data store is not fully initialized.\n\tif (!existing) {\n\t\tawait instance.finishInitialization(existing);\n\t}\n\n\treturn { instance, runtime };\n}\n\n/**\n * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.\n * Consumers should typically use DataObjectFactory instead unless creating\n * another base data store factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n * @alpha\n */\nexport class PureDataObjectFactory<\n\t\tTObj extends PureDataObject<I>,\n\t\tI extends DataObjectTypes = DataObjectTypes,\n\t>\n\timplements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>\n{\n\tprivate readonly sharedObjectRegistry: ISharedObjectRegistry;\n\tprivate readonly registry: IFluidDataStoreRegistry | undefined;\n\n\tpublic constructor(\n\t\t/**\n\t\t * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.\"type\"}\n\t\t */\n\t\tpublic readonly type: string,\n\t\tprivate readonly ctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects: readonly IChannelFactory[],\n\t\tprivate readonly optionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tprivate readonly runtimeClass: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n\t) {\n\t\tif (this.type === \"\") {\n\t\t\tthrow new Error(\"undefined type member\");\n\t\t}\n\t\tif (registryEntries !== undefined) {\n\t\t\tthis.registry = new FluidDataStoreRegistry(registryEntries);\n\t\t}\n\t\tthis.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreFactory.IFluidDataStoreFactory}\n\t */\n\tpublic get IFluidDataStoreFactory(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}\n\t */\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined {\n\t\treturn this.registry;\n\t}\n\n\t/**\n\t * Convenience helper to get the data store's/factory's data store registry entry.\n\t * The return type hides the factory's generics, easing grouping of registry\n\t * entries that differ only in this way into the same array.\n\t * @returns The NamedFluidDataStoreRegistryEntry\n\t */\n\tpublic get registryEntry(): NamedFluidDataStoreRegistryEntry {\n\t\treturn [this.type, Promise.resolve(this)];\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.instantiateDataStore}\n\t */\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<IFluidDataStoreChannel> {\n\t\tconst { runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\texisting,\n\t\t);\n\n\t\treturn runtime;\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.\n\t * In other words, registry of context passed in has to contain this factory, with the name that matches\n\t * this factory's type.\n\t * It is intended to be used by data store objects that create sub-objects.\n\t * @param context - The context being used to create the runtime\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created data store.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createChildInstance(\n\t\tparentContext: IFluidDataStoreContext,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(\n\t\t\tparentContext.containerRuntime,\n\t\t\t[...parentContext.packagePath, this.type],\n\t\t\tinitialState,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.\n\t * In other words, registry of context passed in has to have this factory.\n\t * Intended to be used by data store objects that need to create peers (similar) instances of existing objects.\n\t * @param context - The component context being used to create the object\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created component.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createPeerInstance(\n\t\tpeerContext: IFluidDataStoreContext,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string, // DO NOT USE, this is an experimental feature\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(\n\t\t\tpeerContext.containerRuntime,\n\t\t\tpeerContext.packagePath,\n\t\t\tinitialState,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses container's registry to find this factory.\n\t * It's expected that only container owners would use this functionality, as only such developers\n\t * have knowledge of entries in container registry.\n\t * The name in this registry for such record should match type of this factory.\n\t * @param runtime - container runtime. It's registry is used to create an object.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createInstance(\n\t\truntime: IContainerRuntimeBase,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(runtime, [this.type], initialState, loadingGroupId);\n\t}\n\n\t/**\n\t * Creates a new instance of the object with a datastore which exposes the aliasing api.\n\t * @param runtime - container runtime. It is the runtime that will be used to create the object. It will produce\n\t * the underlying infrastructure to get the data object to operate.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @param packagePath - The path to the data store factory to use to create the data object.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an array containing the object created by this factory and an IDataStore object that enables users to\n\t * alias the data object.\n\t * The data object is attached only when it is attached to the handle graph that connects to an aliased object or\n\t * when the data object is aliased.\n\t */\n\tpublic async createInstanceWithDataStore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tpackagePath?: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): Promise<[TObj, IDataStore]> {\n\t\tconst context = containerRuntime.createDetachedDataStore(\n\t\t\tpackagePath ?? [this.type],\n\t\t\tloadingGroupId,\n\t\t);\n\t\tconst { instance, runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\t\tconst dataStore = await context.attachRuntime(this, runtime);\n\n\t\treturn [instance, dataStore];\n\t}\n\n\t/**\n\t * Creates a new root instance of the object. Uses container's registry to find this factory.\n\t * It's expected that only container owners would use this functionality, as only such developers\n\t * have knowledge of entries in container registry.\n\t * The name in this registry for such record should match type of this factory.\n\t * @param runtime - container runtime. It's registry is used to create an object.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t *\n\t * @deprecated - the issue is that it does not allow the customer to decide the conflict resolution policy when an\n\t * aliasing conflict occurs. Use {@link PureDataObjectFactory.createInstanceWithDataStore} instead.\n\t */\n\tpublic async createRootInstance(\n\t\trootDataStoreId: string,\n\t\truntime: IContainerRuntime,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst context = runtime.createDetachedDataStore([this.type]);\n\t\tconst { instance, runtime: dataStoreRuntime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\t\tconst dataStore = await context.attachRuntime(this, dataStoreRuntime);\n\t\tconst result = await dataStore.trySetAlias(rootDataStoreId);\n\t\tif (result !== \"Success\") {\n\t\t\tconst handle = await runtime.getAliasedDataStoreEntryPoint(rootDataStoreId);\n\t\t\tassert(handle !== undefined, 0x8e1 /* Should have retrieved aliased handle */);\n\t\t\treturn (await handle.get()) as TObj;\n\t\t}\n\t\treturn instance;\n\t}\n\n\tprotected async createNonRootInstanceCore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tpackagePath: Readonly<string[]>,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\tconst context = containerRuntime.createDetachedDataStore(packagePath, loadingGroupId);\n\t\treturn this.createInstanceCore(context, initialState);\n\t}\n\n\tprotected async createInstanceCore(\n\t\tcontext: IFluidDataStoreContextDetached,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst { instance, runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\n\t\tawait context.attachRuntime(this, runtime);\n\n\t\treturn instance;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yEAAoF;AAGpF,kEAA6D;AAC7D,iEAI4C;AA6B5C;;;GAGG;AACH,KAAK,UAAU,gBAAgB,CA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C,0CAA0C,CAAC,CAAC;YAC/E,OAAO,CAAC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAS,CAAC;QACrC,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAES,KAAK,CAAC,yBAAyB,CACxC,gBAAuC,EACvC,WAA+B,EAC/B,YAAgC,EAChC,cAAuB;QAEvB,MAAM,OAAO,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;IAES,KAAK,CAAC,kBAAkB,CACjC,OAAuC,EACvC,YAAgC;QAEhC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,gBAAgB,CACnD,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CACZ,CAAC;QAEF,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AAjPD,sDAiPC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFluidDataStoreRuntime,\n\ttype ISharedObjectRegistry,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore/internal\";\nimport type {\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIContainerRuntimeBase,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type {\n\tAsyncFluidObjectProvider,\n\tFluidObjectSymbolProvider,\n\tIFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize/internal\";\n\nimport type {\n\tDataObjectTypes,\n\tIDataObjectProps,\n\tPureDataObject,\n} from \"../data-objects/index.js\";\n\n/**\n * Proxy over PureDataObject\n * Does delayed creation & initialization of PureDataObject\n */\nasync function createDataObject<\n\tTObj extends PureDataObject,\n\tI extends DataObjectTypes = DataObjectTypes,\n>(\n\tctor: new (props: IDataObjectProps<I>) => TObj,\n\tcontext: IFluidDataStoreContext,\n\tsharedObjectRegistry: ISharedObjectRegistry,\n\toptionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\truntimeClassArg: typeof FluidDataStoreRuntime,\n\texisting: boolean,\n\tinitProps?: I[\"InitialState\"],\n): Promise<{\n\tinstance: TObj;\n\truntime: FluidDataStoreRuntime;\n}> {\n\t// base\n\tlet runtimeClass = runtimeClassArg;\n\n\t// request mixin in\n\truntimeClass = mixinRequestHandler(\n\t\tasync (request: IRequest, runtimeArg: FluidDataStoreRuntime) => {\n\t\t\t// The provideEntryPoint callback below always returns TObj, so this cast is safe\n\t\t\tconst dataObject = (await runtimeArg.entryPoint.get()) as TObj;\n\t\t\tassert(\n\t\t\t\tdataObject.request !== undefined,\n\t\t\t\t0x795 /* Data store runtime entryPoint does not have request */,\n\t\t\t);\n\t\t\treturn dataObject.request(request);\n\t\t},\n\t\truntimeClass,\n\t);\n\n\t// Create a new runtime for our data store, as if via new FluidDataStoreRuntime,\n\t// but using the runtimeClass that's been augmented with mixins\n\t// The runtime is what Fluid uses to create DDS' and route to your data store\n\tconst runtime: FluidDataStoreRuntime = new runtimeClass(\n\t\t// calls new FluidDataStoreRuntime(...)\n\t\tcontext,\n\t\tsharedObjectRegistry,\n\t\texisting,\n\t\tasync (rt: IFluidDataStoreRuntime) => {\n\t\t\tassert(instance !== undefined, 0x46a /* entryPoint is undefined */);\n\t\t\t// Calling finishInitialization here like PureDataObject.getDataObject did, to keep the same behavior,\n\t\t\t// since accessing the runtime's entryPoint is how we want the data object to be retrieved going forward.\n\t\t\t// Without this I ran into issues with the load-existing flow not working correctly.\n\t\t\tawait instance.finishInitialization(true);\n\t\t\treturn instance;\n\t\t} /* provideEntryPoint */,\n\t);\n\n\t// Create object right away.\n\t// This allows object to register various callbacks with runtime before runtime\n\t// becomes globally available. But it's not full initialization - constructor can't\n\t// access DDSes or other services of runtime as objects are not fully initialized.\n\t// In order to use object, we need to go through full initialization by calling finishInitialization().\n\tconst scope: FluidObject<IFluidDependencySynthesizer> = context.scope;\n\tconst providers =\n\t\tscope.IFluidDependencySynthesizer?.synthesize<I[\"OptionalProviders\"]>(\n\t\t\toptionalProviders,\n\t\t\t{},\n\t\t) ??\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t({} as AsyncFluidObjectProvider<never>);\n\n\tconst instance = new ctor({ runtime, context, providers, initProps });\n\n\t// if it's a newly created object, we need to wait for it to finish initialization\n\t// as that results in creation of DDSes, before it gets attached, providing atomic\n\t// guarantee of creation.\n\t// WARNING: we can't do the same (yet) for already existing PureDataObject!\n\t// This will result in deadlock, as it tries to resolve internal handles, but any\n\t// handle resolution goes through root (container runtime), which can't route it back\n\t// to this data store, as it's still not initialized and not known to container runtime yet.\n\t// In the future, we should address it by using relative paths for handles and be able to resolve\n\t// local DDSes while data store is not fully initialized.\n\tif (!existing) {\n\t\tawait instance.finishInitialization(existing);\n\t}\n\n\treturn { instance, runtime };\n}\n\n/**\n * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.\n * Consumers should typically use DataObjectFactory instead unless creating\n * another base data store factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n * @alpha\n */\nexport class PureDataObjectFactory<\n\tTObj extends PureDataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>\n{\n\tprivate readonly sharedObjectRegistry: ISharedObjectRegistry;\n\tprivate readonly registry: IFluidDataStoreRegistry | undefined;\n\n\tpublic constructor(\n\t\t/**\n\t\t * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.\"type\"}\n\t\t */\n\t\tpublic readonly type: string,\n\t\tprivate readonly ctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects: readonly IChannelFactory[],\n\t\tprivate readonly optionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tprivate readonly runtimeClass: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n\t) {\n\t\tif (this.type === \"\") {\n\t\t\tthrow new Error(\"undefined type member\");\n\t\t}\n\t\tif (registryEntries !== undefined) {\n\t\t\tthis.registry = new FluidDataStoreRegistry(registryEntries);\n\t\t}\n\t\tthis.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreFactory.IFluidDataStoreFactory}\n\t */\n\tpublic get IFluidDataStoreFactory(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}\n\t */\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined {\n\t\treturn this.registry;\n\t}\n\n\t/**\n\t * Convenience helper to get the data store's/factory's data store registry entry.\n\t * The return type hides the factory's generics, easing grouping of registry\n\t * entries that differ only in this way into the same array.\n\t * @returns The NamedFluidDataStoreRegistryEntry\n\t */\n\tpublic get registryEntry(): NamedFluidDataStoreRegistryEntry {\n\t\treturn [this.type, Promise.resolve(this)];\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.instantiateDataStore}\n\t */\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<IFluidDataStoreChannel> {\n\t\tconst { runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\texisting,\n\t\t);\n\n\t\treturn runtime;\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.\n\t * In other words, registry of context passed in has to contain this factory, with the name that matches\n\t * this factory's type.\n\t * It is intended to be used by data store objects that create sub-objects.\n\t * @param context - The context being used to create the runtime\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created data store.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createChildInstance(\n\t\tparentContext: IFluidDataStoreContext,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(\n\t\t\tparentContext.containerRuntime,\n\t\t\t[...parentContext.packagePath, this.type],\n\t\t\tinitialState,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.\n\t * In other words, registry of context passed in has to have this factory.\n\t * Intended to be used by data store objects that need to create peers (similar) instances of existing objects.\n\t * @param context - The component context being used to create the object\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created component.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createPeerInstance(\n\t\tpeerContext: IFluidDataStoreContext,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string, // DO NOT USE, this is an experimental feature\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(\n\t\t\tpeerContext.containerRuntime,\n\t\t\tpeerContext.packagePath,\n\t\t\tinitialState,\n\t\t\tloadingGroupId,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses container's registry to find this factory.\n\t * It's expected that only container owners would use this functionality, as only such developers\n\t * have knowledge of entries in container registry.\n\t * The name in this registry for such record should match type of this factory.\n\t * @param runtime - container runtime. It's registry is used to create an object.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createInstance(\n\t\truntime: IContainerRuntimeBase,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(runtime, [this.type], initialState, loadingGroupId);\n\t}\n\n\t/**\n\t * Creates a new instance of the object with a datastore which exposes the aliasing api.\n\t * @param runtime - container runtime. It is the runtime that will be used to create the object. It will produce\n\t * the underlying infrastructure to get the data object to operate.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @param packagePath - The path to the data store factory to use to create the data object.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an array containing the object created by this factory and an IDataStore object that enables users to\n\t * alias the data object.\n\t * The data object is attached only when it is attached to the handle graph that connects to an aliased object or\n\t * when the data object is aliased.\n\t */\n\tpublic async createInstanceWithDataStore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tpackagePath?: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): Promise<[TObj, IDataStore]> {\n\t\tconst context = containerRuntime.createDetachedDataStore(\n\t\t\tpackagePath ?? [this.type],\n\t\t\tloadingGroupId,\n\t\t);\n\t\tconst { instance, runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\t\tconst dataStore = await context.attachRuntime(this, runtime);\n\n\t\treturn [instance, dataStore];\n\t}\n\n\t/**\n\t * Creates a new root instance of the object. Uses container's registry to find this factory.\n\t * It's expected that only container owners would use this functionality, as only such developers\n\t * have knowledge of entries in container registry.\n\t * The name in this registry for such record should match type of this factory.\n\t * @param runtime - container runtime. It's registry is used to create an object.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t *\n\t * @deprecated - the issue is that it does not allow the customer to decide the conflict resolution policy when an\n\t * aliasing conflict occurs. Use {@link PureDataObjectFactory.createInstanceWithDataStore} instead.\n\t */\n\tpublic async createRootInstance(\n\t\trootDataStoreId: string,\n\t\truntime: IContainerRuntime,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst context = runtime.createDetachedDataStore([this.type]);\n\t\tconst { instance, runtime: dataStoreRuntime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\t\tconst dataStore = await context.attachRuntime(this, dataStoreRuntime);\n\t\tconst result = await dataStore.trySetAlias(rootDataStoreId);\n\t\tif (result !== \"Success\") {\n\t\t\tconst handle = await runtime.getAliasedDataStoreEntryPoint(rootDataStoreId);\n\t\t\tassert(handle !== undefined, 0x8e1 /* Should have retrieved aliased handle */);\n\t\t\treturn (await handle.get()) as TObj;\n\t\t}\n\t\treturn instance;\n\t}\n\n\tprotected async createNonRootInstanceCore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tpackagePath: Readonly<string[]>,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\tconst context = containerRuntime.createDetachedDataStore(packagePath, loadingGroupId);\n\t\treturn this.createInstanceCore(context, initialState);\n\t}\n\n\tprotected async createInstanceCore(\n\t\tcontext: IFluidDataStoreContextDetached,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst { instance, runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\n\t\tawait context.attachRuntime(this, runtime);\n\n\t\treturn instance;\n\t}\n}\n"]}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { type ISharedDirectory } from "@fluidframework/map/internal";
|
|
6
|
+
import type { SharedObjectKind } from "@fluidframework/shared-object-base";
|
|
6
7
|
import { PureDataObject } from "./pureDataObject.js";
|
|
7
|
-
import {
|
|
8
|
+
import type { DataObjectTypes } from "./types.js";
|
|
8
9
|
/**
|
|
9
10
|
* DataObject is a base data store that is primed with a root directory. It
|
|
10
11
|
* ensures that it is created and ready before you can access it.
|
|
@@ -35,4 +36,9 @@ export declare abstract class DataObject<I extends DataObjectTypes = DataObjectT
|
|
|
35
36
|
*/
|
|
36
37
|
protected getUninitializedErrorString(item: string): string;
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Utility for creating SharedObjectKind instances for data objects.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export declare function createDataObjectKind<T extends new (...any: any[]) => DataObject>(factory: T): T & SharedObjectKind<InstanceType<T>>;
|
|
38
44
|
//# sourceMappingURL=dataObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"dataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,gBAAgB,EAGrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;GAUG;AACH,8BAAsB,UAAU,CAC/B,CAAC,SAAS,eAAe,GAAG,eAAe,CAC1C,SAAQ,cAAc,CAAC,CAAC,CAAC;IAC1B,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAE1C;;;OAGG;IACH,SAAS,KAAK,IAAI,IAAI,gBAAgB,CAMrC;IAED;;;OAGG;IACU,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BjE;;;OAGG;IACH,SAAS,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG3D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,KAAK,GAAG,GAAG,OAAA,KAAK,UAAU,EACxE,OAAO,EAAE,CAAC,GACR,CAAC,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAEvC"}
|