@fluidframework/shared-object-base 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/remoteObjectHandle.d.ts +3 -3
- package/dist/remoteObjectHandle.js +3 -3
- package/dist/remoteObjectHandle.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/remoteObjectHandle.d.ts +3 -3
- package/lib/remoteObjectHandle.js +3 -3
- package/lib/remoteObjectHandle.js.map +1 -1
- package/package.json +14 -14
- package/src/packageVersion.ts +1 -1
- package/src/remoteObjectHandle.ts +3 -3
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/shared-object-base";
|
|
8
|
-
export declare const pkgVersion = "1.
|
|
8
|
+
export declare const pkgVersion = "1.2.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/shared-object-base";
|
|
11
|
-
exports.pkgVersion = "1.
|
|
11
|
+
exports.pkgVersion = "1.2.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-object-base\";\nexport const pkgVersion = \"1.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-object-base\";\nexport const pkgVersion = \"1.2.0\";\n"]}
|
|
@@ -6,9 +6,9 @@ import { IFluidHandle, IFluidHandleContext, IRequest, IResponse } from "@fluidfr
|
|
|
6
6
|
/**
|
|
7
7
|
* This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized
|
|
8
8
|
* FluidObjectHandle.
|
|
9
|
-
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to
|
|
10
|
-
* objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
11
|
-
* retrieved by calling `get` on it.
|
|
9
|
+
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,
|
|
10
|
+
* custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
11
|
+
* IFluidHandle can be retrieved by calling `get` on it.
|
|
12
12
|
*/
|
|
13
13
|
export declare class RemoteFluidObjectHandle implements IFluidHandle {
|
|
14
14
|
readonly absolutePath: string;
|
|
@@ -11,9 +11,9 @@ const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
|
11
11
|
/**
|
|
12
12
|
* This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized
|
|
13
13
|
* FluidObjectHandle.
|
|
14
|
-
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to
|
|
15
|
-
* objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
16
|
-
* retrieved by calling `get` on it.
|
|
14
|
+
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,
|
|
15
|
+
* custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
16
|
+
* IFluidHandle can be retrieved by calling `get` on it.
|
|
17
17
|
*/
|
|
18
18
|
class RemoteFluidObjectHandle {
|
|
19
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteObjectHandle.js","sourceRoot":"","sources":["../src/remoteObjectHandle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AACtD,yEAAmE;AASnE,iEAA4G;AAE5G;;;;;;GAMG;AACH,MAAa,uBAAuB;IAQhC;;;;OAIG;IACH,YACoB,YAAoB,EACpB,YAAiC;QADjC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QAVrC,eAAU,GAAG,IAAI,CAAC;QAY9B,IAAA,qBAAM,EAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAClG,CAAC;IAjBD,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAC1C,IAAW,mBAAmB,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IACjD,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAiBnC,KAAK,CAAC,GAAG;QACZ,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YAC5B,6EAA6E;YAC7E,MAAM,OAAO,GAAa,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,CAAC,kCAAc,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;YACpG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC;iBAClD,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBAC5B,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;oBACtC,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAK,CAAC;oBAChD,OAAO,WAAW,CAAC;iBACtB;gBACD,MAAM,IAAA,mCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,WAAW;QACd,OAAO;IACX,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC5B,MAAM,CAAC,WAAW,EAAE,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,OAAiB;QAClC,IAAI;YACA,MAAM,MAAM,GAA8B,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;YAEnC,OAAO,MAAM,KAAK,SAAS;gBACvB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;gBACzB,CAAC,CAAC,IAAA,iCAAiB,EAAC,OAAO,CAAC,CAAC;SACpC;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,IAAA,mCAAmB,EAAC,KAAK,CAAC,CAAC;SACrC;IACL,CAAC;CACJ;AAxDD,0DAwDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { RuntimeHeaders } from \"@fluidframework/container-runtime\";\nimport {\n IFluidHandle,\n IFluidHandleContext,\n IRequest,\n IResponse,\n FluidObject,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport { create404Response, exceptionToResponse, responseToException } from \"@fluidframework/runtime-utils\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to
|
|
1
|
+
{"version":3,"file":"remoteObjectHandle.js","sourceRoot":"","sources":["../src/remoteObjectHandle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AACtD,yEAAmE;AASnE,iEAA4G;AAE5G;;;;;;GAMG;AACH,MAAa,uBAAuB;IAQhC;;;;OAIG;IACH,YACoB,YAAoB,EACpB,YAAiC;QADjC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QAVrC,eAAU,GAAG,IAAI,CAAC;QAY9B,IAAA,qBAAM,EAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAClG,CAAC;IAjBD,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAC1C,IAAW,mBAAmB,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IACjD,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAiBnC,KAAK,CAAC,GAAG;QACZ,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YAC5B,6EAA6E;YAC7E,MAAM,OAAO,GAAa,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,CAAC,kCAAc,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;YACpG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC;iBAClD,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBAC5B,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;oBACtC,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAK,CAAC;oBAChD,OAAO,WAAW,CAAC;iBACtB;gBACD,MAAM,IAAA,mCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,WAAW;QACd,OAAO;IACX,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC5B,MAAM,CAAC,WAAW,EAAE,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,OAAiB;QAClC,IAAI;YACA,MAAM,MAAM,GAA8B,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;YAEnC,OAAO,MAAM,KAAK,SAAS;gBACvB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;gBACzB,CAAC,CAAC,IAAA,iCAAiB,EAAC,OAAO,CAAC,CAAC;SACpC;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,IAAA,mCAAmB,EAAC,KAAK,CAAC,CAAC;SACrC;IACL,CAAC;CACJ;AAxDD,0DAwDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { RuntimeHeaders } from \"@fluidframework/container-runtime\";\nimport {\n IFluidHandle,\n IFluidHandleContext,\n IRequest,\n IResponse,\n FluidObject,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport { create404Response, exceptionToResponse, responseToException } from \"@fluidframework/runtime-utils\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n */\nexport class RemoteFluidObjectHandle implements IFluidHandle {\n public get IFluidRouter() { return this; }\n public get IFluidHandleContext() { return this; }\n public get IFluidHandle() { return this; }\n\n public readonly isAttached = true;\n private objectP: Promise<FluidObject> | undefined;\n\n /**\n * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n * @param absolutePath - The absolute path to the handle from the container runtime.\n * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n */\n constructor(\n public readonly absolutePath: string,\n public readonly routeContext: IFluidHandleContext,\n ) {\n assert(absolutePath.startsWith(\"/\"), 0x19d /* \"Handles should always have absolute paths\" */);\n }\n\n public async get(): Promise<any> {\n if (this.objectP === undefined) {\n // Add `viaHandle` header to distinguish from requests from non-handle paths.\n const request: IRequest = { url: this.absolutePath, headers: { [RuntimeHeaders.viaHandle]: true } };\n this.objectP = this.routeContext.resolveHandle(request)\n .then<FluidObject>((response) => {\n if (response.mimeType === \"fluid/object\") {\n const fluidObject: FluidObject = response.value;\n return fluidObject;\n }\n throw responseToException(response, request);\n });\n }\n return this.objectP;\n }\n\n public attachGraph(): void {\n return;\n }\n\n public bind(handle: IFluidHandle): void {\n handle.attachGraph();\n }\n\n public async request(request: IRequest): Promise<IResponse> {\n try {\n const object: FluidObject<IFluidRouter> = await this.get();\n const router = object.IFluidRouter;\n\n return router !== undefined\n ? router.request(request)\n : create404Response(request);\n } catch (error) {\n return exceptionToResponse(error);\n }\n }\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/shared-object-base";
|
|
8
|
-
export declare const pkgVersion = "1.
|
|
8
|
+
export declare const pkgVersion = "1.2.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,oCAAoC,CAAC;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-object-base\";\nexport const pkgVersion = \"1.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,oCAAoC,CAAC;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-object-base\";\nexport const pkgVersion = \"1.2.0\";\n"]}
|
|
@@ -6,9 +6,9 @@ import { IFluidHandle, IFluidHandleContext, IRequest, IResponse } from "@fluidfr
|
|
|
6
6
|
/**
|
|
7
7
|
* This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized
|
|
8
8
|
* FluidObjectHandle.
|
|
9
|
-
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to
|
|
10
|
-
* objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
11
|
-
* retrieved by calling `get` on it.
|
|
9
|
+
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,
|
|
10
|
+
* custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
11
|
+
* IFluidHandle can be retrieved by calling `get` on it.
|
|
12
12
|
*/
|
|
13
13
|
export declare class RemoteFluidObjectHandle implements IFluidHandle {
|
|
14
14
|
readonly absolutePath: string;
|
|
@@ -8,9 +8,9 @@ import { create404Response, exceptionToResponse, responseToException } from "@fl
|
|
|
8
8
|
/**
|
|
9
9
|
* This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized
|
|
10
10
|
* FluidObjectHandle.
|
|
11
|
-
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to
|
|
12
|
-
* objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
13
|
-
* retrieved by calling `get` on it.
|
|
11
|
+
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,
|
|
12
|
+
* custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
13
|
+
* IFluidHandle can be retrieved by calling `get` on it.
|
|
14
14
|
*/
|
|
15
15
|
export class RemoteFluidObjectHandle {
|
|
16
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteObjectHandle.js","sourceRoot":"","sources":["../src/remoteObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AASnE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAE5G;;;;;;GAMG;AACH,MAAM,OAAO,uBAAuB;IAQhC;;;;OAIG;IACH,YACoB,YAAoB,EACpB,YAAiC;QADjC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QAVrC,eAAU,GAAG,IAAI,CAAC;QAY9B,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAClG,CAAC;IAjBD,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAC1C,IAAW,mBAAmB,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IACjD,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAiBnC,KAAK,CAAC,GAAG;QACZ,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YAC5B,6EAA6E;YAC7E,MAAM,OAAO,GAAa,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;YACpG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC;iBAClD,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBAC5B,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;oBACtC,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAK,CAAC;oBAChD,OAAO,WAAW,CAAC;iBACtB;gBACD,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,WAAW;QACd,OAAO;IACX,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC5B,MAAM,CAAC,WAAW,EAAE,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,OAAiB;QAClC,IAAI;YACA,MAAM,MAAM,GAA8B,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;YAEnC,OAAO,MAAM,KAAK,SAAS;gBACvB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;gBACzB,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;SACpC;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;SACrC;IACL,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { RuntimeHeaders } from \"@fluidframework/container-runtime\";\nimport {\n IFluidHandle,\n IFluidHandleContext,\n IRequest,\n IResponse,\n FluidObject,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport { create404Response, exceptionToResponse, responseToException } from \"@fluidframework/runtime-utils\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to
|
|
1
|
+
{"version":3,"file":"remoteObjectHandle.js","sourceRoot":"","sources":["../src/remoteObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AASnE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAE5G;;;;;;GAMG;AACH,MAAM,OAAO,uBAAuB;IAQhC;;;;OAIG;IACH,YACoB,YAAoB,EACpB,YAAiC;QADjC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QAVrC,eAAU,GAAG,IAAI,CAAC;QAY9B,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAClG,CAAC;IAjBD,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAC1C,IAAW,mBAAmB,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IACjD,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAiBnC,KAAK,CAAC,GAAG;QACZ,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YAC5B,6EAA6E;YAC7E,MAAM,OAAO,GAAa,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;YACpG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC;iBAClD,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBAC5B,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;oBACtC,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAK,CAAC;oBAChD,OAAO,WAAW,CAAC;iBACtB;gBACD,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,WAAW;QACd,OAAO;IACX,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC5B,MAAM,CAAC,WAAW,EAAE,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,OAAiB;QAClC,IAAI;YACA,MAAM,MAAM,GAA8B,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;YAEnC,OAAO,MAAM,KAAK,SAAS;gBACvB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;gBACzB,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;SACpC;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;SACrC;IACL,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { RuntimeHeaders } from \"@fluidframework/container-runtime\";\nimport {\n IFluidHandle,\n IFluidHandleContext,\n IRequest,\n IResponse,\n FluidObject,\n IFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport { create404Response, exceptionToResponse, responseToException } from \"@fluidframework/runtime-utils\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n */\nexport class RemoteFluidObjectHandle implements IFluidHandle {\n public get IFluidRouter() { return this; }\n public get IFluidHandleContext() { return this; }\n public get IFluidHandle() { return this; }\n\n public readonly isAttached = true;\n private objectP: Promise<FluidObject> | undefined;\n\n /**\n * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n * @param absolutePath - The absolute path to the handle from the container runtime.\n * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n */\n constructor(\n public readonly absolutePath: string,\n public readonly routeContext: IFluidHandleContext,\n ) {\n assert(absolutePath.startsWith(\"/\"), 0x19d /* \"Handles should always have absolute paths\" */);\n }\n\n public async get(): Promise<any> {\n if (this.objectP === undefined) {\n // Add `viaHandle` header to distinguish from requests from non-handle paths.\n const request: IRequest = { url: this.absolutePath, headers: { [RuntimeHeaders.viaHandle]: true } };\n this.objectP = this.routeContext.resolveHandle(request)\n .then<FluidObject>((response) => {\n if (response.mimeType === \"fluid/object\") {\n const fluidObject: FluidObject = response.value;\n return fluidObject;\n }\n throw responseToException(response, request);\n });\n }\n return this.objectP;\n }\n\n public attachGraph(): void {\n return;\n }\n\n public bind(handle: IFluidHandle): void {\n handle.attachGraph();\n }\n\n public async request(request: IRequest): Promise<IResponse> {\n try {\n const object: FluidObject<IFluidRouter> = await this.get();\n const router = object.IFluidRouter;\n\n return router !== undefined\n ? router.request(request)\n : create404Response(request);\n } catch (error) {\n return exceptionToResponse(error);\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/shared-object-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Fluid base class for shared distributed data structures",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -63,25 +63,25 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
65
65
|
"@fluidframework/common-utils": "^0.32.1",
|
|
66
|
-
"@fluidframework/container-definitions": "^1.
|
|
67
|
-
"@fluidframework/container-runtime": "^1.
|
|
68
|
-
"@fluidframework/container-utils": "^1.
|
|
69
|
-
"@fluidframework/core-interfaces": "^1.
|
|
70
|
-
"@fluidframework/datastore": "^1.
|
|
71
|
-
"@fluidframework/datastore-definitions": "^1.
|
|
66
|
+
"@fluidframework/container-definitions": "^1.2.0",
|
|
67
|
+
"@fluidframework/container-runtime": "^1.2.0",
|
|
68
|
+
"@fluidframework/container-utils": "^1.2.0",
|
|
69
|
+
"@fluidframework/core-interfaces": "^1.2.0",
|
|
70
|
+
"@fluidframework/datastore": "^1.2.0",
|
|
71
|
+
"@fluidframework/datastore-definitions": "^1.2.0",
|
|
72
72
|
"@fluidframework/protocol-definitions": "^0.1028.2000",
|
|
73
|
-
"@fluidframework/runtime-definitions": "^1.
|
|
74
|
-
"@fluidframework/runtime-utils": "^1.
|
|
75
|
-
"@fluidframework/telemetry-utils": "^1.
|
|
73
|
+
"@fluidframework/runtime-definitions": "^1.2.0",
|
|
74
|
+
"@fluidframework/runtime-utils": "^1.2.0",
|
|
75
|
+
"@fluidframework/telemetry-utils": "^1.2.0",
|
|
76
76
|
"uuid": "^8.3.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@fluidframework/build-common": "^0.24.0",
|
|
80
80
|
"@fluidframework/build-tools": "^0.2.74327",
|
|
81
81
|
"@fluidframework/eslint-config-fluid": "^0.28.2000",
|
|
82
|
-
"@fluidframework/mocha-test-setup": "^1.
|
|
83
|
-
"@fluidframework/shared-object-base-previous": "npm:@fluidframework/shared-object-base
|
|
84
|
-
"@fluidframework/test-runtime-utils": "^1.
|
|
82
|
+
"@fluidframework/mocha-test-setup": "^1.2.0",
|
|
83
|
+
"@fluidframework/shared-object-base-previous": "npm:@fluidframework/shared-object-base@1.1.0",
|
|
84
|
+
"@fluidframework/test-runtime-utils": "^1.2.0",
|
|
85
85
|
"@microsoft/api-extractor": "^7.22.2",
|
|
86
86
|
"@rushstack/eslint-config": "^2.5.1",
|
|
87
87
|
"@types/benchmark": "^2.1.0",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"typescript-formatter": "7.1.0"
|
|
101
101
|
},
|
|
102
102
|
"typeValidation": {
|
|
103
|
-
"version": "1.
|
|
103
|
+
"version": "1.2.0",
|
|
104
104
|
"broken": {}
|
|
105
105
|
}
|
|
106
106
|
}
|
package/src/packageVersion.ts
CHANGED
|
@@ -18,9 +18,9 @@ import { create404Response, exceptionToResponse, responseToException } from "@fl
|
|
|
18
18
|
/**
|
|
19
19
|
* This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized
|
|
20
20
|
* FluidObjectHandle.
|
|
21
|
-
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to
|
|
22
|
-
* objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
23
|
-
* retrieved by calling `get` on it.
|
|
21
|
+
* This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,
|
|
22
|
+
* custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the
|
|
23
|
+
* IFluidHandle can be retrieved by calling `get` on it.
|
|
24
24
|
*/
|
|
25
25
|
export class RemoteFluidObjectHandle implements IFluidHandle {
|
|
26
26
|
public get IFluidRouter() { return this; }
|