@fluidframework/aqueduct 2.0.0-rc.1.0.4 → 2.0.0-rc.2.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/dist/aqueduct-alpha.d.ts +116 -48
- package/dist/aqueduct-beta.d.ts +10 -0
- package/dist/aqueduct-public.d.ts +10 -0
- package/dist/aqueduct-untrimmed.d.ts +116 -48
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +39 -23
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.js +3 -8
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +37 -25
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +4 -13
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/dist/container-runtime-factories/index.d.ts +2 -2
- package/dist/container-runtime-factories/index.d.ts.map +1 -1
- package/dist/container-runtime-factories/index.js +4 -4
- package/dist/container-runtime-factories/index.js.map +1 -1
- package/dist/data-object-factories/dataObjectFactory.d.ts +6 -6
- package/dist/data-object-factories/dataObjectFactory.d.ts.map +1 -1
- package/dist/data-object-factories/dataObjectFactory.js +4 -4
- package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
- package/dist/data-object-factories/index.d.ts +2 -2
- package/dist/data-object-factories/index.d.ts.map +1 -1
- package/dist/data-object-factories/index.js +4 -4
- package/dist/data-object-factories/index.js.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.d.ts +44 -14
- package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.js +56 -14
- package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/dist/data-objects/dataObject.d.ts +3 -3
- package/dist/data-objects/dataObject.d.ts.map +1 -1
- package/dist/data-objects/dataObject.js +8 -8
- package/dist/data-objects/dataObject.js.map +1 -1
- package/dist/data-objects/index.d.ts +3 -3
- package/dist/data-objects/index.d.ts.map +1 -1
- package/dist/data-objects/index.js +4 -4
- package/dist/data-objects/index.js.map +1 -1
- package/dist/data-objects/pureDataObject.d.ts +12 -6
- package/dist/data-objects/pureDataObject.d.ts.map +1 -1
- package/dist/data-objects/pureDataObject.js +10 -0
- package/dist/data-objects/pureDataObject.js.map +1 -1
- package/dist/data-objects/types.d.ts +7 -7
- package/dist/data-objects/types.d.ts.map +1 -1
- package/dist/data-objects/types.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{aqueduct-alpha.d.mts → aqueduct-alpha.d.ts} +131 -48
- package/lib/{aqueduct-beta.d.mts → aqueduct-beta.d.ts} +25 -0
- package/lib/{aqueduct-public.d.mts → aqueduct-public.d.ts} +25 -0
- package/lib/{aqueduct-untrimmed.d.mts → aqueduct-untrimmed.d.ts} +131 -48
- package/lib/container-runtime-factories/{baseContainerRuntimeFactory.d.mts → baseContainerRuntimeFactory.d.ts} +40 -24
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -0
- package/lib/container-runtime-factories/{baseContainerRuntimeFactory.mjs → baseContainerRuntimeFactory.js} +6 -10
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -0
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +57 -0
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -0
- package/lib/container-runtime-factories/{containerRuntimeFactoryWithDefaultDataStore.mjs → containerRuntimeFactoryWithDefaultDataStore.js} +4 -13
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -0
- package/lib/container-runtime-factories/index.d.ts +7 -0
- package/lib/container-runtime-factories/index.d.ts.map +1 -0
- package/lib/container-runtime-factories/index.js +7 -0
- package/lib/container-runtime-factories/index.js.map +1 -0
- package/lib/data-object-factories/dataObjectFactory.d.ts +23 -0
- package/lib/data-object-factories/dataObjectFactory.d.ts.map +1 -0
- package/lib/data-object-factories/{dataObjectFactory.mjs → dataObjectFactory.js} +4 -4
- package/lib/data-object-factories/dataObjectFactory.js.map +1 -0
- package/lib/data-object-factories/index.d.ts +7 -0
- package/lib/data-object-factories/index.d.ts.map +1 -0
- package/lib/data-object-factories/index.js +7 -0
- package/lib/data-object-factories/index.js.map +1 -0
- package/lib/data-object-factories/{pureDataObjectFactory.d.mts → pureDataObjectFactory.d.ts} +45 -15
- package/lib/data-object-factories/pureDataObjectFactory.d.ts.map +1 -0
- package/lib/data-object-factories/{pureDataObjectFactory.mjs → pureDataObjectFactory.js} +57 -15
- package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -0
- package/lib/data-objects/{dataObject.d.mts → dataObject.d.ts} +4 -4
- package/lib/data-objects/dataObject.d.ts.map +1 -0
- package/lib/data-objects/{dataObject.mjs → dataObject.js} +8 -8
- package/lib/data-objects/dataObject.js.map +1 -0
- package/lib/data-objects/index.d.ts +8 -0
- package/lib/data-objects/index.d.ts.map +1 -0
- package/lib/data-objects/index.js +7 -0
- package/lib/data-objects/index.js.map +1 -0
- package/lib/data-objects/{pureDataObject.d.mts → pureDataObject.d.ts} +13 -7
- package/lib/data-objects/pureDataObject.d.ts.map +1 -0
- package/lib/data-objects/{pureDataObject.mjs → pureDataObject.js} +11 -1
- package/lib/data-objects/pureDataObject.js.map +1 -0
- package/lib/data-objects/{types.d.mts → types.d.ts} +8 -8
- package/lib/data-objects/types.d.ts.map +1 -0
- package/lib/data-objects/{types.mjs → types.js} +1 -1
- package/lib/data-objects/types.js.map +1 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +22 -0
- package/lib/index.js.map +1 -0
- package/lib/test/aqueduct.spec.js +8 -0
- package/lib/test/aqueduct.spec.js.map +1 -0
- package/lib/test/tsconfig.tsbuildinfo +1 -0
- package/lib/test/types/validateAqueductPrevious.generated.js +24 -0
- package/lib/test/types/validateAqueductPrevious.generated.js.map +1 -0
- package/package.json +54 -54
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.mts.map +0 -1
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.mjs.map +0 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.mts +0 -45
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.mts.map +0 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.mjs.map +0 -1
- package/lib/container-runtime-factories/index.d.mts +0 -7
- package/lib/container-runtime-factories/index.d.mts.map +0 -1
- package/lib/container-runtime-factories/index.mjs +0 -7
- package/lib/container-runtime-factories/index.mjs.map +0 -1
- package/lib/data-object-factories/dataObjectFactory.d.mts +0 -23
- package/lib/data-object-factories/dataObjectFactory.d.mts.map +0 -1
- package/lib/data-object-factories/dataObjectFactory.mjs.map +0 -1
- package/lib/data-object-factories/index.d.mts +0 -7
- package/lib/data-object-factories/index.d.mts.map +0 -1
- package/lib/data-object-factories/index.mjs +0 -7
- package/lib/data-object-factories/index.mjs.map +0 -1
- package/lib/data-object-factories/pureDataObjectFactory.d.mts.map +0 -1
- package/lib/data-object-factories/pureDataObjectFactory.mjs.map +0 -1
- package/lib/data-objects/dataObject.d.mts.map +0 -1
- package/lib/data-objects/dataObject.mjs.map +0 -1
- package/lib/data-objects/index.d.mts +0 -8
- package/lib/data-objects/index.d.mts.map +0 -1
- package/lib/data-objects/index.mjs +0 -7
- package/lib/data-objects/index.mjs.map +0 -1
- package/lib/data-objects/pureDataObject.d.mts.map +0 -1
- package/lib/data-objects/pureDataObject.mjs.map +0 -1
- package/lib/data-objects/types.d.mts.map +0 -1
- package/lib/data-objects/types.mjs.map +0 -1
- package/lib/index.d.mts +0 -8
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -8
- package/lib/index.mjs.map +0 -1
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
|
-
import { IEvent, IFluidHandle, IFluidLoadable, IProvideFluidHandle, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
8
|
-
import { IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
|
|
9
|
-
import { AsyncFluidObjectProvider } from "@fluidframework/synthesize";
|
|
10
|
-
import { DataObjectTypes, IDataObjectProps } from "./types.
|
|
6
|
+
import { type IEvent, type IFluidHandle, type IFluidLoadable, type IProvideFluidHandle, type IRequest, type IResponse } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { type IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
8
|
+
import { type IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
|
|
9
|
+
import { type AsyncFluidObjectProvider } from "@fluidframework/synthesize";
|
|
10
|
+
import { type DataObjectTypes, type IDataObjectProps } from "./types.js";
|
|
11
11
|
/**
|
|
12
12
|
* This is a bare-bones base class that does basic setup and enables for factory on an initialize call.
|
|
13
13
|
* You probably don't want to inherit from this data store directly unless
|
|
@@ -36,13 +36,19 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
|
|
|
36
36
|
protected initProps?: I["InitialState"];
|
|
37
37
|
protected initializeP: Promise<void> | undefined;
|
|
38
38
|
get id(): string;
|
|
39
|
+
/**
|
|
40
|
+
* {@inheritDoc @fluidframework/core-interfaces#IProvideFluidLoadable.IFluidLoadable}
|
|
41
|
+
*/
|
|
39
42
|
get IFluidLoadable(): this;
|
|
43
|
+
/**
|
|
44
|
+
* {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}
|
|
45
|
+
*/
|
|
40
46
|
get IFluidHandle(): IFluidHandle<this>;
|
|
41
47
|
/**
|
|
42
48
|
* Handle to a data store
|
|
43
49
|
*/
|
|
44
50
|
get handle(): IFluidHandle<this>;
|
|
45
|
-
static getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject
|
|
51
|
+
static getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject>;
|
|
46
52
|
constructor(props: IDataObjectProps<I>);
|
|
47
53
|
/**
|
|
48
54
|
* Return this object if someone requests it directly
|
|
@@ -91,4 +97,4 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
|
|
|
91
97
|
*/
|
|
92
98
|
protected hasInitialized(): Promise<void>;
|
|
93
99
|
}
|
|
94
|
-
//# sourceMappingURL=pureDataObject.d.
|
|
100
|
+
//# sourceMappingURL=pureDataObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pureDataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EACN,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE3E,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;;;;GAOG;AACH,8BAAsB,cAAc,CAAC,C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AAE,CAAC,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE/E;;;OAGG;cACa,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEzD;;OAEG;cACa,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAC/C"}
|
|
@@ -17,9 +17,15 @@ export class PureDataObject extends TypedEventEmitter {
|
|
|
17
17
|
get id() {
|
|
18
18
|
return this.runtime.id;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* {@inheritDoc @fluidframework/core-interfaces#IProvideFluidLoadable.IFluidLoadable}
|
|
22
|
+
*/
|
|
20
23
|
get IFluidLoadable() {
|
|
21
24
|
return this;
|
|
22
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}
|
|
28
|
+
*/
|
|
23
29
|
get IFluidHandle() {
|
|
24
30
|
return this.handle;
|
|
25
31
|
}
|
|
@@ -43,8 +49,12 @@ export class PureDataObject extends TypedEventEmitter {
|
|
|
43
49
|
this.context = props.context;
|
|
44
50
|
this.providers = props.providers;
|
|
45
51
|
this.initProps = props.initProps;
|
|
52
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
53
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
46
54
|
assert(this.runtime._dataObject === undefined, 0x0bd /* "Object runtime already has DataObject!" */);
|
|
47
55
|
this.runtime._dataObject = this;
|
|
56
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
57
|
+
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
|
48
58
|
}
|
|
49
59
|
/**
|
|
50
60
|
* Return this object if someone requests it directly
|
|
@@ -113,4 +123,4 @@ export class PureDataObject extends TypedEventEmitter {
|
|
|
113
123
|
*/
|
|
114
124
|
async hasInitialized() { }
|
|
115
125
|
}
|
|
116
|
-
//# sourceMappingURL=pureDataObject.
|
|
126
|
+
//# sourceMappingURL=pureD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,CAAC,cAAc,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,KAAmB,CAAC;IAEjD;;;;;OAKG;IACO,KAAK,CAAC,qBAAqB,CAAC,KAAyB,IAAkB,CAAC;IAElF;;;OAGG;IACO,KAAK,CAAC,wBAAwB,KAAmB,CAAC;IAE5D;;OAEG;IACO,KAAK,CAAC,cAAc,KAAmB,CAAC;CAClD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\ttype IEvent,\n\ttype IFluidHandle,\n\ttype IFluidLoadable,\n\ttype IProvideFluidHandle,\n\ttype IRequest,\n\ttype IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { type IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { type IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { type AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\nimport { create404Response } from \"@fluidframework/runtime-utils\";\nimport { type DataObjectTypes, type IDataObjectProps } from \"./types.js\";\n\n/**\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\n * You probably don't want to inherit from this data store directly unless\n * you are creating another base data store class\n *\n * @typeParam I - The optional input types used to strongly type the data object\n * @alpha\n */\nexport abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes>\n\textends TypedEventEmitter<I[\"Events\"] & IEvent>\n\timplements IFluidLoadable, IProvideFluidHandle\n{\n\t/**\n\t * This is your FluidDataStoreRuntime object\n\t */\n\tprotected readonly runtime: IFluidDataStoreRuntime;\n\n\t/**\n\t * This context is used to talk up to the ContainerRuntime\n\t */\n\tprotected readonly context: IFluidDataStoreContext;\n\n\t/**\n\t * Providers are FluidObject keyed objects that provide back\n\t * a promise to the corresponding FluidObject or undefined.\n\t * Providers injected/provided by the Container and/or HostingApplication\n\t *\n\t * To define providers set FluidObject interfaces in the OptionalProviders generic type for your data store\n\t */\n\tprotected readonly providers: AsyncFluidObjectProvider<I[\"OptionalProviders\"]>;\n\n\tprotected initProps?: I[\"InitialState\"];\n\n\tprotected initializeP: Promise<void> | undefined;\n\n\tpublic get id(): string {\n\t\treturn this.runtime.id;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidLoadable.IFluidLoadable}\n\t */\n\tpublic get IFluidLoadable(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandle<this> {\n\t\treturn this.handle;\n\t}\n\n\t/**\n\t * Handle to a data store\n\t */\n\tpublic get handle(): IFluidHandle<this> {\n\t\t// PureDataObjectFactory already provides an entryPoint initialization function to the data store runtime,\n\t\t// so this object should always have access to a non-null entryPoint. Need to cast because PureDataObject\n\t\t// tried to be too smart with its typing for handles :).\n\t\tassert(this.runtime.entryPoint !== undefined, 0x46b /* EntryPoint was undefined */);\n\t\treturn this.runtime.entryPoint as IFluidHandle<this>;\n\t}\n\n\tpublic static async getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject> {\n\t\tconst obj = await runtime.entryPoint.get();\n\t\treturn obj as PureDataObject;\n\t}\n\n\tpublic constructor(props: IDataObjectProps<I>) {\n\t\tsuper();\n\t\tthis.runtime = props.runtime;\n\t\tthis.context = props.context;\n\t\tthis.providers = props.providers;\n\t\tthis.initProps = props.initProps;\n\n\t\t/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\t\t/* eslint-disable @typescript-eslint/no-explicit-any */\n\t\tassert(\n\t\t\t(this.runtime as any)._dataObject === undefined,\n\t\t\t0x0bd /* \"Object runtime already has DataObject!\" */,\n\t\t);\n\t\t(this.runtime as any)._dataObject = this;\n\t\t/* eslint-enable @typescript-eslint/no-explicit-any */\n\t\t/* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\t}\n\n\t/**\n\t * Return this object if someone requests it directly\n\t * We will return this object in two scenarios:\n\t *\n\t * 1. the request url is a \"/\"\n\t *\n\t * 2. the request url is empty\n\t */\n\tpublic async request(req: IRequest): Promise<IResponse> {\n\t\treturn req.url === \"\" || req.url === \"/\" || req.url.startsWith(\"/?\")\n\t\t\t? { mimeType: \"fluid/object\", status: 200, value: this }\n\t\t\t: create404Response(req);\n\t}\n\n\t/**\n\t * Call this API to ensure PureDataObject is fully initialized.\n\t * Initialization happens on demand, only on as-needed bases.\n\t * In most cases you should allow factory/object to decide when to finish initialization.\n\t * But if you are supplying your own implementation of DataStoreRuntime factory and overriding some methods\n\t * and need a fully initialized object, then you can call this API to ensure object is fully initialized.\n\t */\n\tpublic async finishInitialization(existing: boolean): Promise<void> {\n\t\tif (this.initializeP !== undefined) {\n\t\t\treturn this.initializeP;\n\t\t}\n\t\tthis.initializeP = this.initializeInternal(existing);\n\t\treturn this.initializeP;\n\t}\n\n\t/**\n\t * Internal initialize implementation. Overwriting this will change the flow of the PureDataObject and should\n\t * generally not be done.\n\t *\n\t * Calls initializingFirstTime, initializingFromExisting, and hasInitialized. Caller is\n\t * responsible for ensuring this is only invoked once.\n\t */\n\tpublic async initializeInternal(existing: boolean): Promise<void> {\n\t\tawait this.preInitialize();\n\t\tif (existing) {\n\t\t\tassert(\n\t\t\t\tthis.initProps === undefined,\n\t\t\t\t0x0be /* \"Trying to initialize from existing while initProps is set!\" */,\n\t\t\t);\n\t\t\tawait this.initializingFromExisting();\n\t\t} else {\n\t\t\tawait this.initializingFirstTime(\n\t\t\t\t(this.context.createProps as I[\"InitialState\"]) ?? this.initProps,\n\t\t\t);\n\t\t}\n\t\tawait this.hasInitialized();\n\t}\n\n\t/**\n\t * Called every time the data store is initialized, before initializingFirstTime or\n\t * initializingFromExisting is called.\n\t */\n\tprotected async preInitialize(): Promise<void> {}\n\n\t/**\n\t * Called the first time the data store is initialized (new creations with a new\n\t * data store runtime)\n\t *\n\t * @param props - Optional props to be passed in on create\n\t */\n\tprotected async initializingFirstTime(props?: I[\"InitialState\"]): Promise<void> {}\n\n\t/**\n\t * Called every time but the first time the data store is initialized (creations\n\t * with an existing data store runtime)\n\t */\n\tprotected async initializingFromExisting(): Promise<void> {}\n\n\t/**\n\t * Called every time the data store is initialized after create or existing.\n\t */\n\tprotected async hasInitialized(): Promise<void> {}\n}\n"]}
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IEvent, FluidObject } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { AsyncFluidObjectProvider } from "@fluidframework/synthesize";
|
|
7
|
-
import { IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
|
|
8
|
-
import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
5
|
+
import { type IEvent, type FluidObject } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { type AsyncFluidObjectProvider } from "@fluidframework/synthesize";
|
|
7
|
+
import { type IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
|
|
8
|
+
import { type IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
9
9
|
/**
|
|
10
10
|
* This type is used as the base generic input to DataObject and PureDataObject.
|
|
11
11
|
* @alpha
|
|
12
12
|
*/
|
|
13
13
|
export interface DataObjectTypes {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Represents a type that will define optional providers that will be injected.
|
|
16
16
|
*/
|
|
17
17
|
OptionalProviders?: FluidObject;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The initial state type that the produced data object may take during creation.
|
|
20
20
|
*/
|
|
21
21
|
InitialState?: any;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Represents events that will be available in the EventForwarder.
|
|
24
24
|
*/
|
|
25
25
|
Events?: IEvent;
|
|
26
26
|
}
|
|
@@ -33,4 +33,4 @@ export interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {
|
|
|
33
33
|
readonly providers: AsyncFluidObjectProvider<I["OptionalProviders"]>;
|
|
34
34
|
readonly initProps?: I["InitialState"];
|
|
35
35
|
}
|
|
36
|
-
//# sourceMappingURL=types.d.
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAEpF;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC;;OAEG;IAGH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IAC5E,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACrE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IEvent, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { type AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\nimport { type IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { type IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\n\n/**\n * This type is used as the base generic input to DataObject and PureDataObject.\n * @alpha\n */\nexport interface DataObjectTypes {\n\t/**\n\t * Represents a type that will define optional providers that will be injected.\n\t */\n\tOptionalProviders?: FluidObject;\n\t/**\n\t * The initial state type that the produced data object may take during creation.\n\t */\n\t// TODO: Use a real type here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tInitialState?: any;\n\t/**\n\t * Represents events that will be available in the EventForwarder.\n\t */\n\tEvents?: IEvent;\n}\n\n/**\n * @alpha\n */\nexport interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {\n\treadonly runtime: IFluidDataStoreRuntime;\n\treadonly context: IFluidDataStoreContext;\n\treadonly providers: AsyncFluidObjectProvider<I[\"OptionalProviders\"]>;\n\treadonly initProps?: I[\"InitialState\"];\n}\n"]}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The `aqueduct` package is a library for building Fluid objects and Fluid
|
|
7
|
+
* containers within the Fluid Framework. Its goal is to provide a thin base
|
|
8
|
+
* layer over the existing Fluid Framework interfaces that allows developers to
|
|
9
|
+
* get started quickly.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* About the library name: An "aqueduct" is a way to transport water from a source
|
|
13
|
+
* to another location. The library name was chosen because its purpose is to
|
|
14
|
+
* facilitate using lower level constructs and therefore handle 'fluid' items
|
|
15
|
+
* same as an aqueduct.
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
export { DataObjectFactory, PureDataObjectFactory } from "./data-object-factories/index.js";
|
|
20
|
+
export { DataObject, type DataObjectTypes, type IDataObjectProps, PureDataObject, } from "./data-objects/index.js";
|
|
21
|
+
export { BaseContainerRuntimeFactory, type BaseContainerRuntimeFactoryProps, ContainerRuntimeFactoryWithDefaultDataStore, type ContainerRuntimeFactoryWithDefaultDataStoreProps, } from "./container-runtime-factories/index.js";
|
|
22
|
+
//# 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;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EACN,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,cAAc,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,2BAA2B,EAC3B,KAAK,gCAAgC,EACrC,2CAA2C,EAC3C,KAAK,gDAAgD,GACrD,MAAM,wCAAwC,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The `aqueduct` package is a library for building Fluid objects and Fluid
|
|
7
|
+
* containers within the Fluid Framework. Its goal is to provide a thin base
|
|
8
|
+
* layer over the existing Fluid Framework interfaces that allows developers to
|
|
9
|
+
* get started quickly.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* About the library name: An "aqueduct" is a way to transport water from a source
|
|
13
|
+
* to another location. The library name was chosen because its purpose is to
|
|
14
|
+
* facilitate using lower level constructs and therefore handle 'fluid' items
|
|
15
|
+
* same as an aqueduct.
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
export { DataObjectFactory, PureDataObjectFactory } from "./data-object-factories/index.js";
|
|
20
|
+
export { DataObject, PureDataObject, } from "./data-objects/index.js";
|
|
21
|
+
export { BaseContainerRuntimeFactory, ContainerRuntimeFactoryWithDefaultDataStore, } from "./container-runtime-factories/index.js";
|
|
22
|
+
//# 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;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EACN,UAAU,EAGV,cAAc,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,2BAA2B,EAE3B,2CAA2C,GAE3C,MAAM,wCAAwC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The `aqueduct` package is a library for building Fluid objects and Fluid\n * containers within the Fluid Framework. Its goal is to provide a thin base\n * layer over the existing Fluid Framework interfaces that allows developers to\n * get started quickly.\n *\n * @remarks\n * About the library name: An \"aqueduct\" is a way to transport water from a source\n * to another location. The library name was chosen because its purpose is to\n * facilitate using lower level constructs and therefore handle 'fluid' items\n * same as an aqueduct.\n *\n * @packageDocumentation\n */\n\nexport { DataObjectFactory, PureDataObjectFactory } from \"./data-object-factories/index.js\";\nexport {\n\tDataObject,\n\ttype DataObjectTypes,\n\ttype IDataObjectProps,\n\tPureDataObject,\n} from \"./data-objects/index.js\";\nexport {\n\tBaseContainerRuntimeFactory,\n\ttype BaseContainerRuntimeFactoryProps,\n\tContainerRuntimeFactoryWithDefaultDataStore,\n\ttype ContainerRuntimeFactoryWithDefaultDataStoreProps,\n} from \"./container-runtime-factories/index.js\";\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
// Build pipeline breaks without this file ("No test files found")
|
|
6
|
+
describe("aqueduct-placeholder", () => { });
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=aqueduct.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aqueduct.spec.js","sourceRoot":"","sources":["../../src/test/aqueduct.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kEAAkE;AAClE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Build pipeline breaks without this file (\"No test files found\")\ndescribe(\"aqueduct-placeholder\", () => {});\n"]}
|