@fluidframework/shared-object-base 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +5 -7
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +148 -0
- package/README.md +22 -1
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/shared-object-base.api.md +165 -0
- package/dist/{handle.js → handle.cjs} +13 -8
- package/dist/handle.cjs.map +1 -0
- package/dist/handle.d.ts +12 -7
- package/dist/handle.d.ts.map +1 -1
- package/dist/index.cjs +23 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
- package/dist/packageVersion.cjs.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/{remoteObjectHandle.js → remoteObjectHandle.cjs} +15 -20
- package/dist/remoteObjectHandle.cjs.map +1 -0
- package/dist/remoteObjectHandle.d.ts +1 -3
- package/dist/remoteObjectHandle.d.ts.map +1 -1
- package/dist/{serializer.js → serializer.cjs} +14 -12
- package/dist/serializer.cjs.map +1 -0
- package/dist/serializer.d.ts +8 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/shared-object-base-alpha.d.ts +415 -0
- package/dist/shared-object-base-beta.d.ts +393 -0
- package/dist/shared-object-base-public.d.ts +393 -0
- package/dist/shared-object-base-untrimmed.d.ts +506 -0
- package/dist/{sharedObject.js → sharedObject.cjs} +71 -56
- package/dist/sharedObject.cjs.map +1 -0
- package/dist/sharedObject.d.ts +10 -13
- package/dist/sharedObject.d.ts.map +1 -1
- package/dist/{summarySerializer.js → summarySerializer.cjs} +3 -2
- package/dist/summarySerializer.cjs.map +1 -0
- package/dist/summarySerializer.d.ts +1 -0
- package/dist/summarySerializer.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/{types.js → types.cjs} +1 -1
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +24 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/{utils.js → utils.cjs} +6 -4
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/{valueType.js → valueType.cjs} +3 -2
- package/dist/valueType.cjs.map +1 -0
- package/dist/valueType.d.ts +1 -0
- package/dist/valueType.d.ts.map +1 -1
- package/lib/{handle.d.ts → handle.d.mts} +13 -8
- package/lib/handle.d.mts.map +1 -0
- package/lib/{handle.js → handle.mjs} +13 -8
- package/lib/handle.mjs.map +1 -0
- package/lib/index.d.mts +11 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +10 -0
- package/lib/index.mjs.map +1 -0
- package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
- package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +1 -1
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/lib/{remoteObjectHandle.d.ts → remoteObjectHandle.d.mts} +1 -3
- package/lib/remoteObjectHandle.d.mts.map +1 -0
- package/lib/{remoteObjectHandle.js → remoteObjectHandle.mjs} +15 -20
- package/lib/remoteObjectHandle.mjs.map +1 -0
- package/lib/{serializer.d.ts → serializer.d.mts} +8 -0
- package/lib/serializer.d.mts.map +1 -0
- package/lib/{serializer.js → serializer.mjs} +14 -14
- package/lib/serializer.mjs.map +1 -0
- package/lib/shared-object-base-alpha.d.mts +415 -0
- package/lib/shared-object-base-beta.d.mts +393 -0
- package/lib/shared-object-base-public.d.mts +393 -0
- package/lib/shared-object-base-untrimmed.d.mts +506 -0
- package/lib/{sharedObject.d.ts → sharedObject.d.mts} +12 -15
- package/lib/sharedObject.d.mts.map +1 -0
- package/lib/{sharedObject.js → sharedObject.mjs} +66 -51
- package/lib/sharedObject.mjs.map +1 -0
- package/lib/{summarySerializer.d.ts → summarySerializer.d.mts} +2 -1
- package/lib/summarySerializer.d.mts.map +1 -0
- package/lib/{summarySerializer.js → summarySerializer.mjs} +3 -2
- package/lib/summarySerializer.mjs.map +1 -0
- package/lib/{types.d.ts → types.d.mts} +24 -2
- package/lib/types.d.mts.map +1 -0
- package/lib/{types.js → types.mjs} +1 -1
- package/lib/types.mjs.map +1 -0
- package/lib/{utils.d.ts → utils.d.mts} +5 -1
- package/lib/utils.d.mts.map +1 -0
- package/lib/{utils.js → utils.mjs} +6 -4
- package/lib/utils.mjs.map +1 -0
- package/lib/{valueType.d.ts → valueType.d.mts} +1 -0
- package/lib/{valueType.d.ts.map → valueType.d.mts.map} +1 -1
- package/lib/{valueType.js → valueType.mjs} +2 -1
- package/lib/valueType.mjs.map +1 -0
- package/package.json +102 -69
- package/prettier.config.cjs +8 -0
- package/src/handle.ts +38 -36
- package/src/index.ts +16 -6
- package/src/packageVersion.ts +1 -1
- package/src/remoteObjectHandle.ts +53 -58
- package/src/serializer.ts +190 -187
- package/src/sharedObject.ts +718 -642
- package/src/summarySerializer.ts +9 -8
- package/src/types.ts +56 -15
- package/src/utils.ts +24 -26
- package/src/valueType.ts +10 -9
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +10 -12
- package/bench/src/index.ts +0 -68
- package/bench/src/util.ts +0 -56
- package/dist/handle.js.map +0 -1
- package/dist/index.js +0 -23
- package/dist/index.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/dist/remoteObjectHandle.js.map +0 -1
- package/dist/serializer.js.map +0 -1
- package/dist/sharedObject.js.map +0 -1
- package/dist/summarySerializer.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils.js.map +0 -1
- package/dist/valueType.js.map +0 -1
- package/lib/handle.d.ts.map +0 -1
- package/lib/handle.js.map +0 -1
- package/lib/index.d.ts +0 -11
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -11
- package/lib/index.js.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/remoteObjectHandle.d.ts.map +0 -1
- package/lib/remoteObjectHandle.js.map +0 -1
- package/lib/serializer.d.ts.map +0 -1
- package/lib/serializer.js.map +0 -1
- package/lib/sharedObject.d.ts.map +0 -1
- package/lib/sharedObject.js.map +0 -1
- package/lib/summarySerializer.d.ts.map +0 -1
- package/lib/summarySerializer.js.map +0 -1
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- package/lib/valueType.js.map +0 -1
- package/tsconfig.esnext.json +0 -7
package/.eslintrc.js
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
}
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
};
|
package/.mocharc.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
|
|
9
|
+
|
|
10
|
+
const packageDir = __dirname;
|
|
11
|
+
const config = getFluidTestMochaConfig(packageDir);
|
|
12
|
+
module.exports = config;
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# @fluidframework/shared-object-base
|
|
2
|
+
|
|
3
|
+
## 2.0.0-internal.8.0.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.0.0-internal.7.4.0
|
|
8
|
+
|
|
9
|
+
Dependency updates only.
|
|
10
|
+
|
|
11
|
+
## 2.0.0-internal.7.3.0
|
|
12
|
+
|
|
13
|
+
Dependency updates only.
|
|
14
|
+
|
|
15
|
+
## 2.0.0-internal.7.2.0
|
|
16
|
+
|
|
17
|
+
Dependency updates only.
|
|
18
|
+
|
|
19
|
+
## 2.0.0-internal.7.1.0
|
|
20
|
+
|
|
21
|
+
Dependency updates only.
|
|
22
|
+
|
|
23
|
+
## 2.0.0-internal.7.0.0
|
|
24
|
+
|
|
25
|
+
### Major Changes
|
|
26
|
+
|
|
27
|
+
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
28
|
+
|
|
29
|
+
This included the following changes from the protocol-definitions release:
|
|
30
|
+
|
|
31
|
+
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
32
|
+
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
33
|
+
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
34
|
+
been added, which will be the typing for signals sent from the client to the server. Both extend a new
|
|
35
|
+
ISignalMessageBase interface that contains common members.
|
|
36
|
+
- The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
|
|
37
|
+
|
|
38
|
+
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
39
|
+
|
|
40
|
+
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
41
|
+
|
|
42
|
+
- @fluidframework/gitresources: 2.0.1
|
|
43
|
+
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
44
|
+
- @fluidframework/server-lambdas: 2.0.1
|
|
45
|
+
- @fluidframework/server-lambdas-driver: 2.0.1
|
|
46
|
+
- @fluidframework/server-local-server: 2.0.1
|
|
47
|
+
- @fluidframework/server-memory-orderer: 2.0.1
|
|
48
|
+
- @fluidframework/protocol-base: 2.0.1
|
|
49
|
+
- @fluidframework/server-routerlicious: 2.0.1
|
|
50
|
+
- @fluidframework/server-routerlicious-base: 2.0.1
|
|
51
|
+
- @fluidframework/server-services: 2.0.1
|
|
52
|
+
- @fluidframework/server-services-client: 2.0.1
|
|
53
|
+
- @fluidframework/server-services-core: 2.0.1
|
|
54
|
+
- @fluidframework/server-services-ordering-kafkanode: 2.0.1
|
|
55
|
+
- @fluidframework/server-services-ordering-rdkafka: 2.0.1
|
|
56
|
+
- @fluidframework/server-services-ordering-zookeeper: 2.0.1
|
|
57
|
+
- @fluidframework/server-services-shared: 2.0.1
|
|
58
|
+
- @fluidframework/server-services-telemetry: 2.0.1
|
|
59
|
+
- @fluidframework/server-services-utils: 2.0.1
|
|
60
|
+
- @fluidframework/server-test-utils: 2.0.1
|
|
61
|
+
- tinylicious: 2.0.1
|
|
62
|
+
|
|
63
|
+
- Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
64
|
+
|
|
65
|
+
The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
|
|
66
|
+
|
|
67
|
+
## 2.0.0-internal.6.4.0
|
|
68
|
+
|
|
69
|
+
### Minor Changes
|
|
70
|
+
|
|
71
|
+
- Some stack traces are improved ([#17380](https://github.com/microsoft/FluidFramework/issues/17380)) [34f2808ee9](https://github.com/microsoft/FluidFramework/commits/34f2808ee9764aef21b990f8b48860d9e3ce27a5)
|
|
72
|
+
|
|
73
|
+
Some stack traces have been improved and might now include frames for async functions that weren't previously included.
|
|
74
|
+
|
|
75
|
+
## 2.0.0-internal.6.3.0
|
|
76
|
+
|
|
77
|
+
Dependency updates only.
|
|
78
|
+
|
|
79
|
+
## 2.0.0-internal.6.2.0
|
|
80
|
+
|
|
81
|
+
### Minor Changes
|
|
82
|
+
|
|
83
|
+
- Remove use of @fluidframework/common-definitions ([#16638](https://github.com/microsoft/FluidFramework/issues/16638)) [a8c81509c9](https://github.com/microsoft/FluidFramework/commits/a8c81509c9bf09cfb2092ebcf7265205f9eb6dbf)
|
|
84
|
+
|
|
85
|
+
The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
|
|
86
|
+
imported from the **@fluidframework/core-interfaces** package:
|
|
87
|
+
|
|
88
|
+
- interface IDisposable
|
|
89
|
+
- interface IErrorEvent
|
|
90
|
+
- interface IErrorEvent
|
|
91
|
+
- interface IEvent
|
|
92
|
+
- interface IEventProvider
|
|
93
|
+
- interface ILoggingError
|
|
94
|
+
- interface ITaggedTelemetryPropertyType
|
|
95
|
+
- interface ITelemetryBaseEvent
|
|
96
|
+
- interface ITelemetryBaseLogger
|
|
97
|
+
- interface ITelemetryErrorEvent
|
|
98
|
+
- interface ITelemetryGenericEvent
|
|
99
|
+
- interface ITelemetryLogger
|
|
100
|
+
- interface ITelemetryPerformanceEvent
|
|
101
|
+
- interface ITelemetryProperties
|
|
102
|
+
- type ExtendEventProvider
|
|
103
|
+
- type IEventThisPlaceHolder
|
|
104
|
+
- type IEventTransformer
|
|
105
|
+
- type ReplaceIEventThisPlaceHolder
|
|
106
|
+
- type ReplaceIEventThisPlaceHolder
|
|
107
|
+
- type TelemetryEventCategory
|
|
108
|
+
- type TelemetryEventPropertyType
|
|
109
|
+
|
|
110
|
+
## 2.0.0-internal.6.1.0
|
|
111
|
+
|
|
112
|
+
Dependency updates only.
|
|
113
|
+
|
|
114
|
+
## 2.0.0-internal.6.0.0
|
|
115
|
+
|
|
116
|
+
### Major Changes
|
|
117
|
+
|
|
118
|
+
- Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
|
|
119
|
+
|
|
120
|
+
Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
|
|
121
|
+
|
|
122
|
+
## 2.0.0-internal.5.4.0
|
|
123
|
+
|
|
124
|
+
Dependency updates only.
|
|
125
|
+
|
|
126
|
+
## 2.0.0-internal.5.3.0
|
|
127
|
+
|
|
128
|
+
Dependency updates only.
|
|
129
|
+
|
|
130
|
+
## 2.0.0-internal.5.2.0
|
|
131
|
+
|
|
132
|
+
Dependency updates only.
|
|
133
|
+
|
|
134
|
+
## 2.0.0-internal.5.1.0
|
|
135
|
+
|
|
136
|
+
Dependency updates only.
|
|
137
|
+
|
|
138
|
+
## 2.0.0-internal.5.0.0
|
|
139
|
+
|
|
140
|
+
Dependency updates only.
|
|
141
|
+
|
|
142
|
+
## 2.0.0-internal.4.4.0
|
|
143
|
+
|
|
144
|
+
Dependency updates only.
|
|
145
|
+
|
|
146
|
+
## 2.0.0-internal.4.1.0
|
|
147
|
+
|
|
148
|
+
Dependency updates only.
|
package/README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
1
|
# @fluidframework/shared-object-base
|
|
2
2
|
|
|
3
|
-
Interfaces and common base implementation for a shared objects for Fluid Framework Runtime
|
|
3
|
+
Interfaces and common base implementation for a shared objects for Fluid Framework Runtime
|
|
4
|
+
|
|
5
|
+
<!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
|
|
6
|
+
|
|
7
|
+
<!-- prettier-ignore-start -->
|
|
8
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
9
|
+
|
|
10
|
+
## Using Fluid Framework libraries
|
|
11
|
+
|
|
12
|
+
When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
|
|
13
|
+
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
14
|
+
library consumers should always prefer `^`.
|
|
15
|
+
|
|
16
|
+
Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
|
|
17
|
+
you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
|
|
18
|
+
Standard `^` and `~` ranges will not work as expected.
|
|
19
|
+
See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
20
|
+
package for more information including tools to convert between version schemes.
|
|
21
|
+
|
|
22
|
+
<!-- prettier-ignore-end -->
|
|
23
|
+
|
|
24
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.json"
|
|
4
4
|
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
## API Report File for "@fluidframework/shared-object-base"
|
|
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 { EventEmitterEventType } from '@fluid-internal/client-utils';
|
|
8
|
+
import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
|
|
9
|
+
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
10
|
+
import { IChannelAttributes } from '@fluidframework/datastore-definitions';
|
|
11
|
+
import { IChannelServices } from '@fluidframework/datastore-definitions';
|
|
12
|
+
import { IChannelStorageService } from '@fluidframework/datastore-definitions';
|
|
13
|
+
import { IErrorEvent } from '@fluidframework/core-interfaces';
|
|
14
|
+
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
15
|
+
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
16
|
+
import { IExperimentalIncrementalSummaryContext } from '@fluidframework/runtime-definitions';
|
|
17
|
+
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
18
|
+
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
19
|
+
import { IFluidHandleContext } from '@fluidframework/core-interfaces';
|
|
20
|
+
import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
|
|
21
|
+
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
22
|
+
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
23
|
+
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
|
|
24
|
+
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
25
|
+
|
|
26
|
+
// @internal
|
|
27
|
+
export function createSingleBlobSummary(key: string, content: string | Uint8Array): ISummaryTreeWithStats;
|
|
28
|
+
|
|
29
|
+
// @internal
|
|
30
|
+
export class FluidSerializer implements IFluidSerializer {
|
|
31
|
+
constructor(context: IFluidHandleContext, handleParsedCb: (handle: IFluidHandle) => void);
|
|
32
|
+
decode(input: any): any;
|
|
33
|
+
encode(input: any, bind: IFluidHandle): any;
|
|
34
|
+
// (undocumented)
|
|
35
|
+
get IFluidSerializer(): this;
|
|
36
|
+
// (undocumented)
|
|
37
|
+
parse(input: string): any;
|
|
38
|
+
// (undocumented)
|
|
39
|
+
protected serializeHandle(handle: IFluidHandle, bind: IFluidHandle): {
|
|
40
|
+
type: string;
|
|
41
|
+
url: string;
|
|
42
|
+
};
|
|
43
|
+
// (undocumented)
|
|
44
|
+
stringify(input: any, bind: IFluidHandle): string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// @public (undocumented)
|
|
48
|
+
export interface IFluidSerializer {
|
|
49
|
+
decode(input: any): any;
|
|
50
|
+
encode(value: any, bind: IFluidHandle): any;
|
|
51
|
+
parse(value: string): any;
|
|
52
|
+
stringify(value: any, bind: IFluidHandle): string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// @internal
|
|
56
|
+
export interface ISerializedHandle {
|
|
57
|
+
// (undocumented)
|
|
58
|
+
type: "__fluid_handle__";
|
|
59
|
+
// (undocumented)
|
|
60
|
+
url: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// @public
|
|
64
|
+
export interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends IChannel, IEventProvider<TEvent> {
|
|
65
|
+
bindToContext(): void;
|
|
66
|
+
getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// @public
|
|
70
|
+
export interface ISharedObjectEvents extends IErrorEvent {
|
|
71
|
+
// @eventProperty
|
|
72
|
+
(event: "pre-op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
73
|
+
// @eventProperty
|
|
74
|
+
(event: "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// @internal (undocumented)
|
|
78
|
+
export const isSerializedHandle: (value: any) => value is ISerializedHandle;
|
|
79
|
+
|
|
80
|
+
// @alpha
|
|
81
|
+
export function makeHandlesSerializable(value: any, serializer: IFluidSerializer, bind: IFluidHandle): any;
|
|
82
|
+
|
|
83
|
+
// @alpha
|
|
84
|
+
export function parseHandles(value: any, serializer: IFluidSerializer): any;
|
|
85
|
+
|
|
86
|
+
// @internal
|
|
87
|
+
export function serializeHandles(value: any, serializer: IFluidSerializer, bind: IFluidHandle): string | undefined;
|
|
88
|
+
|
|
89
|
+
// @public
|
|
90
|
+
export abstract class SharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends SharedObjectCore<TEvent> {
|
|
91
|
+
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, telemetryContextPrefix: string);
|
|
92
|
+
// (undocumented)
|
|
93
|
+
getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
94
|
+
getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
95
|
+
protected processGCDataCore(serializer: IFluidSerializer): void;
|
|
96
|
+
// (undocumented)
|
|
97
|
+
protected get serializer(): IFluidSerializer;
|
|
98
|
+
// (undocumented)
|
|
99
|
+
summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
|
|
100
|
+
protected abstract summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): ISummaryTreeWithStats;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// @public
|
|
104
|
+
export abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends EventEmitterWithErrorHandling<TEvent> implements ISharedObject<TEvent> {
|
|
105
|
+
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
106
|
+
protected abstract applyStashedOp(content: any): unknown;
|
|
107
|
+
// (undocumented)
|
|
108
|
+
readonly attributes: IChannelAttributes;
|
|
109
|
+
bindToContext(): void;
|
|
110
|
+
// (undocumented)
|
|
111
|
+
connect(services: IChannelServices): void;
|
|
112
|
+
get connected(): boolean;
|
|
113
|
+
protected didAttach(): void;
|
|
114
|
+
protected dirty(): void;
|
|
115
|
+
emit(event: EventEmitterEventType, ...args: any[]): boolean;
|
|
116
|
+
// (undocumented)
|
|
117
|
+
abstract getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
118
|
+
abstract getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
119
|
+
readonly handle: IFluidHandle;
|
|
120
|
+
protected handleDecoded(decodedHandle: IFluidHandle): void;
|
|
121
|
+
// (undocumented)
|
|
122
|
+
id: string;
|
|
123
|
+
// (undocumented)
|
|
124
|
+
get IFluidLoadable(): this;
|
|
125
|
+
initializeLocal(): void;
|
|
126
|
+
protected initializeLocalCore(): void;
|
|
127
|
+
// (undocumented)
|
|
128
|
+
isAttached(): boolean;
|
|
129
|
+
load(services: IChannelServices): Promise<void>;
|
|
130
|
+
protected abstract loadCore(services: IChannelStorageService): Promise<void>;
|
|
131
|
+
protected readonly logger: ITelemetryLoggerExt;
|
|
132
|
+
protected newAckBasedPromise<T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
|
133
|
+
protected onConnect(): void;
|
|
134
|
+
protected abstract onDisconnect(): any;
|
|
135
|
+
protected abstract processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): any;
|
|
136
|
+
protected reSubmitCore(content: any, localOpMetadata: unknown): void;
|
|
137
|
+
protected rollback(content: any, localOpMetadata: unknown): void;
|
|
138
|
+
// (undocumented)
|
|
139
|
+
protected runtime: IFluidDataStoreRuntime;
|
|
140
|
+
protected submitLocalMessage(content: any, localOpMetadata?: unknown): void;
|
|
141
|
+
// (undocumented)
|
|
142
|
+
abstract summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// @internal
|
|
146
|
+
export class SummarySerializer extends FluidSerializer {
|
|
147
|
+
// (undocumented)
|
|
148
|
+
getSerializedRoutes(): string[];
|
|
149
|
+
// (undocumented)
|
|
150
|
+
protected serializeHandle(handle: IFluidHandle, bind: IFluidHandle): {
|
|
151
|
+
type: string;
|
|
152
|
+
url: string;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// @internal
|
|
157
|
+
export enum ValueType {
|
|
158
|
+
Plain = 1,
|
|
159
|
+
// @deprecated
|
|
160
|
+
Shared = 0
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// (No @packageDocumentation comment for this package)
|
|
164
|
+
|
|
165
|
+
```
|
|
@@ -7,12 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.SharedObjectHandle = void 0;
|
|
8
8
|
const datastore_1 = require("@fluidframework/datastore");
|
|
9
9
|
/**
|
|
10
|
-
* Handle for shared object
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* Handle for a shared object.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
*
|
|
14
|
+
* This object is used for already loaded (in-memory) shared objects and is used only for serialization purposes.
|
|
15
|
+
*
|
|
16
|
+
* De-serialization process goes through {@link @fluidframework/datastore#FluidObjectHandle}, and request flow:
|
|
17
|
+
* {@link @fluidframework/datastore#FluidDataStoreRuntime.request} recognizes requests in the form of
|
|
18
|
+
* '/\<shared object id\>' and loads shared object.
|
|
16
19
|
*/
|
|
17
20
|
class SharedObjectHandle extends datastore_1.FluidObjectHandle {
|
|
18
21
|
/**
|
|
@@ -25,10 +28,12 @@ class SharedObjectHandle extends datastore_1.FluidObjectHandle {
|
|
|
25
28
|
* Creates a new SharedObjectHandle.
|
|
26
29
|
* @param value - The shared object this handle is for.
|
|
27
30
|
* @param path - The id of the shared object. It is also the path to this object relative to the routeContext.
|
|
28
|
-
* @param routeContext - The parent IFluidHandleContext that has a route
|
|
31
|
+
* @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
|
|
32
|
+
* to this handle.
|
|
29
33
|
*/
|
|
30
34
|
constructor(value, path, routeContext) {
|
|
31
35
|
super(value, path, routeContext);
|
|
36
|
+
this.value = value;
|
|
32
37
|
}
|
|
33
38
|
/**
|
|
34
39
|
* Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.
|
|
@@ -40,4 +45,4 @@ class SharedObjectHandle extends datastore_1.FluidObjectHandle {
|
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
exports.SharedObjectHandle = SharedObjectHandle;
|
|
43
|
-
//# sourceMappingURL=handle.
|
|
48
|
+
//# sourceMappingURL=handle.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.cjs","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yDAA8D;AAG9D;;;;;;;;;;GAUG;AACH,MAAa,kBAAmB,SAAQ,6BAAgC;IACvE;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,YACoB,KAAoB,EACvC,IAAY,EACZ,YAAiC;QAEjC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAJd,UAAK,GAAL,KAAK,CAAe;IAKxC,CAAC;IAED;;;OAGG;IACI,WAAW;QACjB,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACD;AA/BD,gDA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { ISharedObject } from \"./types\";\n\n/**\n * Handle for a shared object.\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects and is used only for serialization purposes.\n *\n * De-serialization process goes through {@link @fluidframework/datastore#FluidObjectHandle}, and request flow:\n * {@link @fluidframework/datastore#FluidDataStoreRuntime.request} recognizes requests in the form of\n * '/\\<shared object id\\>' and loads shared object.\n */\nexport class SharedObjectHandle extends FluidObjectHandle<ISharedObject> {\n\t/**\n\t * Whether services have been attached for the associated shared object.\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.value.isAttached();\n\t}\n\n\t/**\n\t * Creates a new SharedObjectHandle.\n\t * @param value - The shared object this handle is for.\n\t * @param path - The id of the shared object. It is also the path to this object relative to the routeContext.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: ISharedObject,\n\t\tpath: string,\n\t\trouteContext: IFluidHandleContext,\n\t) {\n\t\tsuper(value, path, routeContext);\n\t}\n\n\t/**\n\t * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.\n\t * When attaching the handle, it registers the associated shared object.\n\t */\n\tpublic attachGraph(): void {\n\t\tthis.value.bindToContext();\n\t\tsuper.attachGraph();\n\t}\n}\n"]}
|
package/dist/handle.d.ts
CHANGED
|
@@ -6,14 +6,18 @@ import { IFluidHandleContext } from "@fluidframework/core-interfaces";
|
|
|
6
6
|
import { FluidObjectHandle } from "@fluidframework/datastore";
|
|
7
7
|
import { ISharedObject } from "./types";
|
|
8
8
|
/**
|
|
9
|
-
* Handle for shared object
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* Handle for a shared object.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
*
|
|
13
|
+
* This object is used for already loaded (in-memory) shared objects and is used only for serialization purposes.
|
|
14
|
+
*
|
|
15
|
+
* De-serialization process goes through {@link @fluidframework/datastore#FluidObjectHandle}, and request flow:
|
|
16
|
+
* {@link @fluidframework/datastore#FluidDataStoreRuntime.request} recognizes requests in the form of
|
|
17
|
+
* '/\<shared object id\>' and loads shared object.
|
|
15
18
|
*/
|
|
16
19
|
export declare class SharedObjectHandle extends FluidObjectHandle<ISharedObject> {
|
|
20
|
+
protected readonly value: ISharedObject;
|
|
17
21
|
/**
|
|
18
22
|
* Whether services have been attached for the associated shared object.
|
|
19
23
|
*/
|
|
@@ -22,7 +26,8 @@ export declare class SharedObjectHandle extends FluidObjectHandle<ISharedObject>
|
|
|
22
26
|
* Creates a new SharedObjectHandle.
|
|
23
27
|
* @param value - The shared object this handle is for.
|
|
24
28
|
* @param path - The id of the shared object. It is also the path to this object relative to the routeContext.
|
|
25
|
-
* @param routeContext - The parent IFluidHandleContext that has a route
|
|
29
|
+
* @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
|
|
30
|
+
* to this handle.
|
|
26
31
|
*/
|
|
27
32
|
constructor(value: ISharedObject, path: string, routeContext: IFluidHandleContext);
|
|
28
33
|
/**
|
package/dist/handle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;;;;;;GAUG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB,CAAC,aAAa,CAAC;IAgBtE,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa;IAfxC;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;;;;;OAMG;gBAEiB,KAAK,EAAE,aAAa,EACvC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB;IAKlC;;;OAGG;IACI,WAAW,IAAI,IAAI;CAI1B"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ValueType = exports.serializeHandles = exports.parseHandles = exports.makeHandlesSerializable = exports.createSingleBlobSummary = exports.SummarySerializer = exports.SharedObjectCore = exports.SharedObject = exports.isSerializedHandle = exports.FluidSerializer = void 0;
|
|
8
|
+
var serializer_1 = require("./serializer.cjs");
|
|
9
|
+
Object.defineProperty(exports, "FluidSerializer", { enumerable: true, get: function () { return serializer_1.FluidSerializer; } });
|
|
10
|
+
Object.defineProperty(exports, "isSerializedHandle", { enumerable: true, get: function () { return serializer_1.isSerializedHandle; } });
|
|
11
|
+
var sharedObject_1 = require("./sharedObject.cjs");
|
|
12
|
+
Object.defineProperty(exports, "SharedObject", { enumerable: true, get: function () { return sharedObject_1.SharedObject; } });
|
|
13
|
+
Object.defineProperty(exports, "SharedObjectCore", { enumerable: true, get: function () { return sharedObject_1.SharedObjectCore; } });
|
|
14
|
+
var summarySerializer_1 = require("./summarySerializer.cjs");
|
|
15
|
+
Object.defineProperty(exports, "SummarySerializer", { enumerable: true, get: function () { return summarySerializer_1.SummarySerializer; } });
|
|
16
|
+
var utils_1 = require("./utils.cjs");
|
|
17
|
+
Object.defineProperty(exports, "createSingleBlobSummary", { enumerable: true, get: function () { return utils_1.createSingleBlobSummary; } });
|
|
18
|
+
Object.defineProperty(exports, "makeHandlesSerializable", { enumerable: true, get: function () { return utils_1.makeHandlesSerializable; } });
|
|
19
|
+
Object.defineProperty(exports, "parseHandles", { enumerable: true, get: function () { return utils_1.parseHandles; } });
|
|
20
|
+
Object.defineProperty(exports, "serializeHandles", { enumerable: true, get: function () { return utils_1.serializeHandles; } });
|
|
21
|
+
var valueType_1 = require("./valueType.cjs");
|
|
22
|
+
Object.defineProperty(exports, "ValueType", { enumerable: true, get: function () { return valueType_1.ValueType; } });
|
|
23
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAKsB;AAJrB,6GAAA,eAAe,OAAA;AAGf,gHAAA,kBAAkB,OAAA;AAEnB,mDAAgE;AAAvD,4GAAA,YAAY,OAAA;AAAE,gHAAA,gBAAgB,OAAA;AACvC,6DAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qCAKiB;AAJhB,gHAAA,uBAAuB,OAAA;AACvB,gHAAA,uBAAuB,OAAA;AACvB,qGAAA,YAAY,OAAA;AACZ,yGAAA,gBAAgB,OAAA;AAEjB,6CAAwC;AAA/B,sGAAA,SAAS,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tFluidSerializer,\n\tIFluidSerializer,\n\tISerializedHandle,\n\tisSerializedHandle,\n} from \"./serializer\";\nexport { SharedObject, SharedObjectCore } from \"./sharedObject\";\nexport { SummarySerializer } from \"./summarySerializer\";\nexport { ISharedObject, ISharedObjectEvents } from \"./types\";\nexport {\n\tcreateSingleBlobSummary,\n\tmakeHandlesSerializable,\n\tparseHandles,\n\tserializeHandles,\n} from \"./utils\";\nexport { ValueType } from \"./valueType\";\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
5
|
+
export { FluidSerializer, IFluidSerializer, ISerializedHandle, isSerializedHandle, } from "./serializer";
|
|
6
|
+
export { SharedObject, SharedObjectCore } from "./sharedObject";
|
|
7
|
+
export { SummarySerializer } from "./summarySerializer";
|
|
8
|
+
export { ISharedObject, ISharedObjectEvents } from "./types";
|
|
9
|
+
export { createSingleBlobSummary, makeHandlesSerializable, parseHandles, serializeHandles, } from "./utils";
|
|
10
|
+
export { ValueType } from "./valueType";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -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.
|
|
12
|
-
//# sourceMappingURL=packageVersion.
|
|
11
|
+
exports.pkgVersion = "2.0.0-dev-rc.1.0.0.224419";
|
|
12
|
+
//# sourceMappingURL=packageVersion.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageVersion.cjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,2BAA2B,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 = \"2.0.0-dev-rc.1.0.0.224419\";\n"]}
|
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 = "2.0.0-dev-rc.1.0.0.224419";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,8BAA8B,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.RemoteFluidObjectHandle = void 0;
|
|
8
|
-
const
|
|
8
|
+
const core_utils_1 = require("@fluidframework/core-utils");
|
|
9
9
|
const container_runtime_1 = require("@fluidframework/container-runtime");
|
|
10
10
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
11
11
|
/**
|
|
@@ -16,6 +16,12 @@ const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
|
16
16
|
* IFluidHandle can be retrieved by calling `get` on it.
|
|
17
17
|
*/
|
|
18
18
|
class RemoteFluidObjectHandle {
|
|
19
|
+
get IFluidHandleContext() {
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
get IFluidHandle() {
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
19
25
|
/**
|
|
20
26
|
* Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.
|
|
21
27
|
* @param absolutePath - The absolute path to the handle from the container runtime.
|
|
@@ -25,16 +31,17 @@ class RemoteFluidObjectHandle {
|
|
|
25
31
|
this.absolutePath = absolutePath;
|
|
26
32
|
this.routeContext = routeContext;
|
|
27
33
|
this.isAttached = true;
|
|
28
|
-
(0,
|
|
34
|
+
(0, core_utils_1.assert)(absolutePath.startsWith("/"), 0x19d /* "Handles should always have absolute paths" */);
|
|
29
35
|
}
|
|
30
|
-
get IFluidRouter() { return this; }
|
|
31
|
-
get IFluidHandleContext() { return this; }
|
|
32
|
-
get IFluidHandle() { return this; }
|
|
33
36
|
async get() {
|
|
34
37
|
if (this.objectP === undefined) {
|
|
35
38
|
// Add `viaHandle` header to distinguish from requests from non-handle paths.
|
|
36
|
-
const request = {
|
|
37
|
-
|
|
39
|
+
const request = {
|
|
40
|
+
url: this.absolutePath,
|
|
41
|
+
headers: { [container_runtime_1.RuntimeHeaders.viaHandle]: true },
|
|
42
|
+
};
|
|
43
|
+
this.objectP = this.routeContext
|
|
44
|
+
.resolveHandle(request)
|
|
38
45
|
.then((response) => {
|
|
39
46
|
if (response.mimeType === "fluid/object") {
|
|
40
47
|
const fluidObject = response.value;
|
|
@@ -51,18 +58,6 @@ class RemoteFluidObjectHandle {
|
|
|
51
58
|
bind(handle) {
|
|
52
59
|
handle.attachGraph();
|
|
53
60
|
}
|
|
54
|
-
async request(request) {
|
|
55
|
-
try {
|
|
56
|
-
const object = await this.get();
|
|
57
|
-
const router = object.IFluidRouter;
|
|
58
|
-
return router !== undefined
|
|
59
|
-
? router.request(request)
|
|
60
|
-
: (0, runtime_utils_1.create404Response)(request);
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
return (0, runtime_utils_1.exceptionToResponse)(error);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
61
|
}
|
|
67
62
|
exports.RemoteFluidObjectHandle = RemoteFluidObjectHandle;
|
|
68
|
-
//# sourceMappingURL=remoteObjectHandle.
|
|
63
|
+
//# sourceMappingURL=remoteObjectHandle.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteObjectHandle.cjs","sourceRoot":"","sources":["../src/remoteObjectHandle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AACpD,yEAAmE;AAOnE,iEAAoE;AAEpE;;;;;;GAMG;AACH,MAAa,uBAAuB;IACnC,IAAW,mBAAmB;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAKD;;;;OAIG;IACH,YACiB,YAAoB,EACpB,YAAiC;QADjC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QAVlC,eAAU,GAAG,IAAI,CAAC;QAYjC,IAAA,mBAAM,EACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YAC/B,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE,EAAE,CAAC,kCAAc,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE;aAC7C,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY;iBAC9B,aAAa,CAAC,OAAO,CAAC;iBACtB,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBAC/B,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;oBACzC,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAK,CAAC;oBAChD,OAAO,WAAW,CAAC;iBACnB;gBACD,MAAM,IAAA,mCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;SACJ;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC/B,MAAM,CAAC,WAAW,EAAE,CAAC;IACtB,CAAC;CACD;AArDD,0DAqDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { RuntimeHeaders } from \"@fluidframework/container-runtime\";\nimport {\n\tIFluidHandle,\n\tIFluidHandleContext,\n\tIRequest,\n\tFluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { 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\tpublic get IFluidHandleContext() {\n\t\treturn this;\n\t}\n\tpublic get IFluidHandle() {\n\t\treturn this;\n\t}\n\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t) {\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<any> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: { [RuntimeHeaders.viaHandle]: true },\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext\n\t\t\t\t.resolveHandle(request)\n\t\t\t\t.then<FluidObject>((response) => {\n\t\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\t\tconst fluidObject: FluidObject = response.value;\n\t\t\t\t\t\treturn fluidObject;\n\t\t\t\t\t}\n\t\t\t\t\tthrow responseToException(response, request);\n\t\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n\n\tpublic bind(handle: IFluidHandle): void {\n\t\thandle.attachGraph();\n\t}\n}\n"]}
|