@fluidframework/driver-definitions 2.116.0-416006 → 2.116.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/README.md +5 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/serviceClient.d.ts +22 -10
- package/dist/serviceClient.d.ts.map +1 -1
- package/dist/serviceClient.js +3 -2
- package/dist/serviceClient.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/serviceClient.d.ts +22 -10
- package/lib/serviceClient.d.ts.map +1 -1
- package/lib/serviceClient.js +3 -2
- package/lib/serviceClient.js.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +1 -1
- package/src/serviceClient.ts +22 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# @fluidframework/driver-definitions
|
|
2
2
|
|
|
3
|
+
## 2.116.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Rename minVersionForCollab to oldestSupportedClient ([#27806](https://github.com/microsoft/FluidFramework/pull/27806)) [86b912170c](https://github.com/microsoft/FluidFramework/commit/86b912170c0e12ebeb481c5201f923c72bf94498)
|
|
8
|
+
|
|
9
|
+
The cross-client compatibility parameter has new names:
|
|
10
|
+
- The
|
|
11
|
+
[`MinimumVersionForCollab`](https://fluidframework.com/docs/api/runtime-definitions/minimumversionforcollab-typealias)
|
|
12
|
+
type is now
|
|
13
|
+
[`OldestSupportedClientVersion`](https://fluidframework.com/docs/api/runtime-definitions/oldestsupportedclientversion-typealias).
|
|
14
|
+
- [`LoadContainerRuntimeParams.minVersionForCollab`](https://fluidframework.com/docs/api/container-runtime/loadcontainerruntimeparams-interface#minversionforcollab-propertysignature)
|
|
15
|
+
is now
|
|
16
|
+
[`LoadContainerRuntimeParams.oldestSupportedClient`](https://fluidframework.com/docs/api/container-runtime/loadcontainerruntimeparams-interface#oldestsupportedclient-propertysignature).
|
|
17
|
+
- [`BaseContainerRuntimeFactoryProps.minVersionForCollab`](https://fluidframework.com/docs/api/aqueduct/basecontainerruntimefactoryprops-interface#minversionforcollab-propertysignature)
|
|
18
|
+
is now
|
|
19
|
+
[`BaseContainerRuntimeFactoryProps.oldestSupportedClient`](https://fluidframework.com/docs/api/aqueduct/basecontainerruntimefactoryprops-interface#oldestsupportedclient-propertysignature).
|
|
20
|
+
- [`createTreeContainerRuntimeFactory`](https://fluidframework.com/docs/api/fluid-static/#createtreecontainerruntimefactory-function)
|
|
21
|
+
now accepts `oldestSupportedClient`.
|
|
22
|
+
`minVersionForCollaboration` remains available as a deprecated overload.
|
|
23
|
+
- `@fluidframework/driver-definitions` now exports its minor-only version type as
|
|
24
|
+
[`OldestSupportedServiceClientVersion`](https://fluidframework.com/docs/api/driver-definitions/oldestsupportedserviceclientversion-typealias),
|
|
25
|
+
and
|
|
26
|
+
[`ServiceOptions.oldestSupportedClient`](https://fluidframework.com/docs/api/driver-definitions/serviceoptions-interface#oldestsupportedclient-propertysignature)
|
|
27
|
+
is available.
|
|
28
|
+
- [`AzureClient`](https://fluidframework.com/docs/api/azure-client/azureclient-class),
|
|
29
|
+
[`OdspClient`](https://fluidframework.com/docs/api/odsp-client/odspclient-class),
|
|
30
|
+
and
|
|
31
|
+
[`TinyliciousClient`](https://fluidframework.com/docs/api/tinylicious-client/tinyliciousclient-class)
|
|
32
|
+
methods now use `oldestSupportedClient` and
|
|
33
|
+
[`OldestSupportedClientVersion`](https://fluidframework.com/docs/api/runtime-definitions/oldestsupportedclientversion-typealias)
|
|
34
|
+
in their signatures.
|
|
35
|
+
|
|
36
|
+
The previous property and type names in `@fluidframework/runtime-definitions`,
|
|
37
|
+
`@fluidframework/container-runtime`, `@fluidframework/aqueduct`, and
|
|
38
|
+
`@fluidframework/fluid-static` are deprecated and will be removed in future
|
|
39
|
+
releases. Where both old and new property names remain available, specifying both
|
|
40
|
+
is an error. The alpha `MinimumVersionForCollaboration` type and
|
|
41
|
+
`ServiceOptions.minVersionForCollaboration` property are replaced directly rather
|
|
42
|
+
than retained as aliases.
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// Before
|
|
46
|
+
const runtime = await loadContainerRuntime({
|
|
47
|
+
context,
|
|
48
|
+
registryEntries,
|
|
49
|
+
provideEntryPoint,
|
|
50
|
+
minVersionForCollab: "2.40.0",
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// After
|
|
54
|
+
const runtime = await loadContainerRuntime({
|
|
55
|
+
context,
|
|
56
|
+
registryEntries,
|
|
57
|
+
provideEntryPoint,
|
|
58
|
+
oldestSupportedClient: "2.40.0",
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Telemetry property names are unchanged.
|
|
63
|
+
|
|
3
64
|
## 2.115.0
|
|
4
65
|
|
|
5
66
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ There are many ways to [contribute](https://github.com/microsoft/FluidFramework/
|
|
|
99
99
|
- Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
|
|
100
100
|
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
|
|
101
101
|
|
|
102
|
-
Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/
|
|
102
|
+
Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md).
|
|
103
103
|
|
|
104
104
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
105
105
|
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
@@ -110,9 +110,11 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
|
|
|
110
110
|
|
|
111
111
|
## Help
|
|
112
112
|
|
|
113
|
-
Not finding what you're looking for in this README?
|
|
113
|
+
Not finding what you're looking for in this README?
|
|
114
|
+
Check out [fluidframework.com](https://fluidframework.com/docs/).
|
|
114
115
|
|
|
115
|
-
Still not finding what you're looking for?
|
|
116
|
+
Still not finding what you're looking for?
|
|
117
|
+
Please [file an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
|
|
116
118
|
|
|
117
119
|
Thank you!
|
|
118
120
|
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ export { DriverHeader } from "./urlResolver.js";
|
|
|
12
12
|
export type { ConnectionMode, IApprovedProposal, IAttachment, IBlob, IBranchOrigin, ICapabilities, IClient, IClientConfiguration, IClientDetails, IClientJoin, ICommittedProposal, IConnect, IConnected, ICreateBlobResponse, IDocumentAttributes, IDocumentMessage, IDocumentSystemMessage, INack, INackContent, IProcessMessageResult, IProposal, IProtocolState, IQuorum, IQuorumClients, IQuorumProposals, ISentSignalMessage, ISequencedClient, ISequencedDocumentAugmentedMessage, ISequencedDocumentMessage, ISequencedDocumentMessageExperimental, ISequencedDocumentSystemMessage, ISequencedProposal, IServerError, ISignalClient, ISignalMessage, ISignalMessageBase, ISnapshotTree, ISnapshotTreeEx, IsoDate, ISummaryAck, ISummaryAttachment, ISummaryBlob, ISummaryContent, ISummaryHandle, ISummaryNack, ISummaryProposal, ISummaryTree, ITokenClaims, ITrace, ITree, ITreeEntry, IUploadedSummaryDetails, IUser, IVersion, SummaryObject, SummaryTree, SummaryTypeNoHandle, } from "./protocol/index.js";
|
|
13
13
|
export { FileMode, MessageType, NackErrorType, ScopeType, SignalType, SummaryType, TreeEntry, } from "./protocol/index.js";
|
|
14
14
|
export type { IGitAuthor, IGitBlob, IGitCommitDetails, IGitCommitHash, IGitCommitter, IGitCreateBlobParams, IGitCreateBlobResponse, IGitCreateTreeEntry, IGitCreateTreeParams, IGitTree, IGitTreeEntry, } from "./git/index.js";
|
|
15
|
-
export type { DataStoreCreator, DataStoreKey, DataStoreKind, DataStoreRegistry, FluidContainer, FluidContainerAttached, FluidContainerWithService,
|
|
15
|
+
export type { DataStoreCreator, DataStoreKey, DataStoreKind, DataStoreRegistry, FluidContainer, FluidContainerAttached, FluidContainerWithService, OldestSupportedServiceClientVersion, Registry, RegistryKey, ServiceClient, ServiceOptions, } from "./serviceClient.js";
|
|
16
16
|
export { createBasicRegistryKey, lookupInRegistry, featureVersion } from "./serviceClient.js";
|
|
17
17
|
//# 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,YAAY,EACX,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACX,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,OAAO,EACP,aAAa,EACb,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAChE,YAAY,EACX,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,YAAY,EACX,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,aAAa,EACb,aAAa,EACb,OAAO,EACP,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,YAAY,EACZ,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kCAAkC,EAClC,yBAAyB,EACzB,qCAAqC,EACrC,+BAA+B,EAC/B,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,EACV,uBAAuB,EACvB,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GACT,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,QAAQ,EACR,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACX,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,OAAO,EACP,aAAa,EACb,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAChE,YAAY,EACX,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,YAAY,EACX,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,aAAa,EACb,aAAa,EACb,OAAO,EACP,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,YAAY,EACZ,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kCAAkC,EAClC,yBAAyB,EACzB,qCAAqC,EACrC,+BAA+B,EAC/B,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,EACV,uBAAuB,EACvB,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GACT,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,QAAQ,EACR,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,mCAAmC,EACnC,QAAQ,EACR,WAAW,EACX,aAAa,EACb,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmBH,mDAAoD;AAA3C,kHAAA,gBAAgB,OAAA;AAoBzB,2CAAgE;AAAvD,yGAAA,WAAW,OAAA;AAAE,iHAAA,mBAAmB,OAAA;AAQzC,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AA6DrB,gDAQ6B;AAP5B,oGAAA,QAAQ,OAAA;AACR,uGAAA,WAAW,OAAA;AACX,yGAAA,aAAa,OAAA;AACb,qGAAA,SAAS,OAAA;AACT,sGAAA,UAAU,OAAA;AACV,uGAAA,WAAW,OAAA;AACX,qGAAA,SAAS,OAAA;AA6BV,uDAA8F;AAArF,0HAAA,sBAAsB,OAAA;AAAE,oHAAA,gBAAgB,OAAA;AAAE,kHAAA,cAAc,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n} from \"./cacheDefinitions.js\";\n\nexport type {\n\tDriverError,\n\tIAnyDriverError,\n\tIAuthorizationError,\n\tIDriverErrorBase,\n\tIDriverBasicError,\n\tIGenericNetworkError,\n\tILocationRedirectionError,\n\tIThrottlingWarning,\n} from \"./driverError.js\";\nexport { DriverErrorTypes } from \"./driverError.js\";\nexport type {\n\tFiveDaysMs,\n\tIDeltasFetchResult,\n\tIDeltaStorageService,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tIStream,\n\tIStreamResult,\n\tISummaryContext,\n} from \"./storage.js\";\nexport { FetchSource, LoaderCachingPolicy } from \"./storage.js\";\nexport type {\n\tDriverPreCheckInfo,\n\tIContainerPackageInfo,\n\tIDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver.js\";\nexport { DriverHeader } from \"./urlResolver.js\";\n\nexport type {\n\tConnectionMode,\n\tIApprovedProposal,\n\tIAttachment,\n\tIBlob,\n\tIBranchOrigin,\n\tICapabilities,\n\tIClient,\n\tIClientConfiguration,\n\tIClientDetails,\n\tIClientJoin,\n\tICommittedProposal,\n\tIConnect,\n\tIConnected,\n\tICreateBlobResponse,\n\tIDocumentAttributes,\n\tIDocumentMessage,\n\tIDocumentSystemMessage,\n\tINack,\n\tINackContent,\n\tIProcessMessageResult,\n\tIProposal,\n\tIProtocolState,\n\tIQuorum,\n\tIQuorumClients,\n\tIQuorumProposals,\n\tISentSignalMessage,\n\tISequencedClient,\n\tISequencedDocumentAugmentedMessage,\n\tISequencedDocumentMessage,\n\tISequencedDocumentMessageExperimental,\n\tISequencedDocumentSystemMessage,\n\tISequencedProposal,\n\tIServerError,\n\tISignalClient,\n\tISignalMessage,\n\tISignalMessageBase,\n\tISnapshotTree,\n\tISnapshotTreeEx,\n\tIsoDate,\n\tISummaryAck,\n\tISummaryAttachment,\n\tISummaryBlob,\n\tISummaryContent,\n\tISummaryHandle,\n\tISummaryNack,\n\tISummaryProposal,\n\tISummaryTree,\n\tITokenClaims,\n\tITrace,\n\tITree,\n\tITreeEntry,\n\tIUploadedSummaryDetails,\n\tIUser,\n\tIVersion,\n\tSummaryObject,\n\tSummaryTree,\n\tSummaryTypeNoHandle,\n} from \"./protocol/index.js\";\nexport {\n\tFileMode,\n\tMessageType,\n\tNackErrorType,\n\tScopeType,\n\tSignalType,\n\tSummaryType,\n\tTreeEntry,\n} from \"./protocol/index.js\";\nexport type {\n\tIGitAuthor,\n\tIGitBlob,\n\tIGitCommitDetails,\n\tIGitCommitHash,\n\tIGitCommitter,\n\tIGitCreateBlobParams,\n\tIGitCreateBlobResponse,\n\tIGitCreateTreeEntry,\n\tIGitCreateTreeParams,\n\tIGitTree,\n\tIGitTreeEntry,\n} from \"./git/index.js\";\nexport type {\n\tDataStoreCreator,\n\tDataStoreKey,\n\tDataStoreKind,\n\tDataStoreRegistry,\n\tFluidContainer,\n\tFluidContainerAttached,\n\tFluidContainerWithService,\n\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmBH,mDAAoD;AAA3C,kHAAA,gBAAgB,OAAA;AAoBzB,2CAAgE;AAAvD,yGAAA,WAAW,OAAA;AAAE,iHAAA,mBAAmB,OAAA;AAQzC,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AA6DrB,gDAQ6B;AAP5B,oGAAA,QAAQ,OAAA;AACR,uGAAA,WAAW,OAAA;AACX,yGAAA,aAAa,OAAA;AACb,qGAAA,SAAS,OAAA;AACT,sGAAA,UAAU,OAAA;AACV,uGAAA,WAAW,OAAA;AACX,qGAAA,SAAS,OAAA;AA6BV,uDAA8F;AAArF,0HAAA,sBAAsB,OAAA;AAAE,oHAAA,gBAAgB,OAAA;AAAE,kHAAA,cAAc,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n} from \"./cacheDefinitions.js\";\n\nexport type {\n\tDriverError,\n\tIAnyDriverError,\n\tIAuthorizationError,\n\tIDriverErrorBase,\n\tIDriverBasicError,\n\tIGenericNetworkError,\n\tILocationRedirectionError,\n\tIThrottlingWarning,\n} from \"./driverError.js\";\nexport { DriverErrorTypes } from \"./driverError.js\";\nexport type {\n\tFiveDaysMs,\n\tIDeltasFetchResult,\n\tIDeltaStorageService,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tIStream,\n\tIStreamResult,\n\tISummaryContext,\n} from \"./storage.js\";\nexport { FetchSource, LoaderCachingPolicy } from \"./storage.js\";\nexport type {\n\tDriverPreCheckInfo,\n\tIContainerPackageInfo,\n\tIDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver.js\";\nexport { DriverHeader } from \"./urlResolver.js\";\n\nexport type {\n\tConnectionMode,\n\tIApprovedProposal,\n\tIAttachment,\n\tIBlob,\n\tIBranchOrigin,\n\tICapabilities,\n\tIClient,\n\tIClientConfiguration,\n\tIClientDetails,\n\tIClientJoin,\n\tICommittedProposal,\n\tIConnect,\n\tIConnected,\n\tICreateBlobResponse,\n\tIDocumentAttributes,\n\tIDocumentMessage,\n\tIDocumentSystemMessage,\n\tINack,\n\tINackContent,\n\tIProcessMessageResult,\n\tIProposal,\n\tIProtocolState,\n\tIQuorum,\n\tIQuorumClients,\n\tIQuorumProposals,\n\tISentSignalMessage,\n\tISequencedClient,\n\tISequencedDocumentAugmentedMessage,\n\tISequencedDocumentMessage,\n\tISequencedDocumentMessageExperimental,\n\tISequencedDocumentSystemMessage,\n\tISequencedProposal,\n\tIServerError,\n\tISignalClient,\n\tISignalMessage,\n\tISignalMessageBase,\n\tISnapshotTree,\n\tISnapshotTreeEx,\n\tIsoDate,\n\tISummaryAck,\n\tISummaryAttachment,\n\tISummaryBlob,\n\tISummaryContent,\n\tISummaryHandle,\n\tISummaryNack,\n\tISummaryProposal,\n\tISummaryTree,\n\tITokenClaims,\n\tITrace,\n\tITree,\n\tITreeEntry,\n\tIUploadedSummaryDetails,\n\tIUser,\n\tIVersion,\n\tSummaryObject,\n\tSummaryTree,\n\tSummaryTypeNoHandle,\n} from \"./protocol/index.js\";\nexport {\n\tFileMode,\n\tMessageType,\n\tNackErrorType,\n\tScopeType,\n\tSignalType,\n\tSummaryType,\n\tTreeEntry,\n} from \"./protocol/index.js\";\nexport type {\n\tIGitAuthor,\n\tIGitBlob,\n\tIGitCommitDetails,\n\tIGitCommitHash,\n\tIGitCommitter,\n\tIGitCreateBlobParams,\n\tIGitCreateBlobResponse,\n\tIGitCreateTreeEntry,\n\tIGitCreateTreeParams,\n\tIGitTree,\n\tIGitTreeEntry,\n} from \"./git/index.js\";\nexport type {\n\tDataStoreCreator,\n\tDataStoreKey,\n\tDataStoreKind,\n\tDataStoreRegistry,\n\tFluidContainer,\n\tFluidContainerAttached,\n\tFluidContainerWithService,\n\tOldestSupportedServiceClientVersion,\n\tRegistry,\n\tRegistryKey,\n\tServiceClient,\n\tServiceOptions,\n} from \"./serviceClient.js\";\nexport { createBasicRegistryKey, lookupInRegistry, featureVersion } from \"./serviceClient.js\";\n"]}
|
package/dist/serviceClient.d.ts
CHANGED
|
@@ -93,20 +93,21 @@ export declare function lookupInRegistry<TOut, TIn>(registry: Registry<TIn>, key
|
|
|
93
93
|
*/
|
|
94
94
|
export declare function createBasicRegistryKey<T>(type: string): RegistryKey<T, T>;
|
|
95
95
|
/**
|
|
96
|
-
* Oldest
|
|
96
|
+
* Oldest Fluid Framework client version that must be able to open and process documents written
|
|
97
|
+
* by a service client.
|
|
97
98
|
* @remarks
|
|
98
99
|
* A string in SemVer format indicating a specific version of the Fluid Framework client package, or the special case of {@link @fluidframework/runtime-utils#defaultMinVersionForCollab}.
|
|
99
100
|
*
|
|
100
|
-
*
|
|
101
|
-
* to the
|
|
101
|
+
* Service clients use this value to select write formats and features. Clients using this version
|
|
102
|
+
* or newer must be able to open and process documents written by the service client. Choosing an
|
|
103
|
+
* older version may limit the features and write formats the application can use to those
|
|
104
|
+
* supported by that version.
|
|
102
105
|
*
|
|
103
106
|
* Cannot exceed the version of any Fluid Framework client package in use by the local client.
|
|
104
107
|
*
|
|
105
|
-
* The higher the version specified, the more features and optimizations will be enabled. *
|
|
106
108
|
* @privateRemarks
|
|
107
|
-
* This is similar to, and a subset of, the `
|
|
109
|
+
* This is similar to, and a subset of, the `OldestSupportedClientVersion` type in `@fluidframework/runtime-definitions`.
|
|
108
110
|
* This differs in that:
|
|
109
|
-
* - This avoids the shorthand "collab" to instead align with our preferred whole word naming convention.
|
|
110
111
|
* - This is `alpha` instead of `public`.
|
|
111
112
|
* - This is available to drivers due to its location in `driver-definitions` instead of `runtime-definitions`.
|
|
112
113
|
* - This does not allow requesting collaboration with pre-2.0.0 versions, including the special case of `2.0.0-defaults`.
|
|
@@ -116,17 +117,18 @@ export declare function createBasicRegistryKey<T>(type: string): RegistryKey<T,
|
|
|
116
117
|
* @input
|
|
117
118
|
* @alpha
|
|
118
119
|
*/
|
|
119
|
-
export type
|
|
120
|
+
export type OldestSupportedServiceClientVersion = `2.${bigint}.0`;
|
|
120
121
|
/**
|
|
121
122
|
* Strips patch and prerelease from a SemVer string, returning only the major and minor version.
|
|
122
123
|
* @remarks
|
|
123
|
-
* This formats a version in the same style used by {@link
|
|
124
|
+
* This formats a version in the same style used by {@link OldestSupportedServiceClientVersion}, specifying only the major and minor versions,
|
|
124
125
|
* which are the portions used for feature selection.
|
|
125
126
|
* @typeParam major - The major version number of `version` as a string, preserved in the result type.
|
|
126
127
|
* @typeParam minor - The minor version number of `version` as a string, preserved in the result type.
|
|
127
128
|
* @privateRemarks
|
|
128
129
|
* This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.
|
|
129
|
-
* It can be used to workaround our generated pkgVersion values being invalid
|
|
130
|
+
* It can be used to workaround our generated pkgVersion values being invalid
|
|
131
|
+
* `OldestSupportedServiceClientVersion` on CI due to prerelease or patched release branches.
|
|
130
132
|
* @alpha
|
|
131
133
|
*/
|
|
132
134
|
export declare function featureVersion<major extends `${bigint}`, minor extends `${bigint}`>(version: `${major}.${minor}.${bigint}-${string}` | `${major}.${minor}.${bigint}`): `${major}.${minor}.0`;
|
|
@@ -141,7 +143,17 @@ export declare function featureVersion<major extends `${bigint}`, minor extends
|
|
|
141
143
|
* @alpha
|
|
142
144
|
*/
|
|
143
145
|
export interface ServiceOptions {
|
|
144
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Oldest Fluid Framework client version that must be able to open and process documents written
|
|
148
|
+
* by the service client.
|
|
149
|
+
*
|
|
150
|
+
* @remarks
|
|
151
|
+
* Choosing an older version may limit the features and write formats the application can use to
|
|
152
|
+
* those supported by that version.
|
|
153
|
+
*
|
|
154
|
+
* A service may provide a default when this option is omitted.
|
|
155
|
+
*/
|
|
156
|
+
readonly oldestSupportedClient?: OldestSupportedServiceClientVersion;
|
|
145
157
|
}
|
|
146
158
|
/**
|
|
147
159
|
* A {@link RegistryKey} for a {@link DataStoreKind}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceClient.d.ts","sourceRoot":"","sources":["../src/serviceClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO;IAC/C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,EACzC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,EACvB,GAAG,EAAE,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,GACzB,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAKzE;AAMD
|
|
1
|
+
{"version":3,"file":"serviceClient.d.ts","sourceRoot":"","sources":["../src/serviceClient.ts"],"names":[],"mappings":"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"}
|
package/dist/serviceClient.js
CHANGED
|
@@ -30,13 +30,14 @@ exports.createBasicRegistryKey = createBasicRegistryKey;
|
|
|
30
30
|
/**
|
|
31
31
|
* Strips patch and prerelease from a SemVer string, returning only the major and minor version.
|
|
32
32
|
* @remarks
|
|
33
|
-
* This formats a version in the same style used by {@link
|
|
33
|
+
* This formats a version in the same style used by {@link OldestSupportedServiceClientVersion}, specifying only the major and minor versions,
|
|
34
34
|
* which are the portions used for feature selection.
|
|
35
35
|
* @typeParam major - The major version number of `version` as a string, preserved in the result type.
|
|
36
36
|
* @typeParam minor - The minor version number of `version` as a string, preserved in the result type.
|
|
37
37
|
* @privateRemarks
|
|
38
38
|
* This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.
|
|
39
|
-
* It can be used to workaround our generated pkgVersion values being invalid
|
|
39
|
+
* It can be used to workaround our generated pkgVersion values being invalid
|
|
40
|
+
* `OldestSupportedServiceClientVersion` on CI due to prerelease or patched release branches.
|
|
40
41
|
* @alpha
|
|
41
42
|
*/
|
|
42
43
|
function featureVersion(version) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceClient.js","sourceRoot":"","sources":["../src/serviceClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsFH;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC/B,QAAuB,EACvB,GAA2B;IAE3B,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AALD,4CAKC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAI,IAAY;IACrD,OAAO;QACN,IAAI;QACJ,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;KACvB,CAAC;AACH,CAAC;AALD,wDAKC;AAgCD;;;;;;;;;;;GAWG;AACH,SAAgB,cAAc,CAC7B,OAAgF;IAEhF,6KAA6K;IAC7K,2JAA2J;IAC3J,6KAA6K;IAC7K,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAU,IAAI,MAAM,CAAC,CAAC,CAAU,IAAI,CAAC;AACxD,CAAC;AARD,wCAQC;AA0QD,aAAa","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedBaseType } from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * This file defines the external facing API for the {@link ServiceClient} and related types.\n *\n * It provides an API surface at a similar abstraction level to aqueduct and fluid-static, but is intended to be a replacement for those which solves several problems with them.\n * Mainly it strives to have the encapsulation of implementation details (including all legacy APIs from aqueduct and lower level internals) like fluid-static\n * while being both more flexible and simpler.\n *\n * This aims to be the cleanest practical way to build applications on the Fluid Framework Client.\n * There are however several known cases where the API quality was sacrificed to ease initial implementation,\n * since some of the unification desired in this API's design are not yet implemented in the underlying Fluid Framework Client code or require additional work to implement.\n * These cases are called out with TODOs in this file.\n * These should be considered and addressed before stabilizing this API past alpha.\n *\n * All code interacting through this API surface within a single client must avoid using multiple copies of any Fluid Framework client package (at the same or different versions).\n * This mirrors the `@public` \"declarative model\" APIs and is a deliberate simplification of what is allowed in the legacy API surface.\n * It is enforced best-effort only: `@sealed` nominal erased types catch many mismatches at compile time, and factory identity checks throw a UsageError (\"Conflicting ... with same type\") at run time, but the checking is not exhaustive.\n * See `LayerCompatibilityUnified.md` for the full policy, rationale, and failure signatures.\n *\n * TODO:\n * Before stabilizing any of this past beta, evaluate whether this single-copy requirement must be relaxed, and if so how.\n * Whatever rule is chosen (relaxed or not) should be enforced at both compile time and run time as much as possible.\n *\n * TODO:\n * Fault isolation should be considered in this API design.\n * When are exceptions recoverable and how?\n * Likely we can fault isolate exceptions to containers in most cases,\n * and containers can indicate their status by being closed or disposed.\n * Non fatal errors should not be exceptions.\n */\n\n// #region Registry types\n\n/**\n * A collection of entries looked up by a `type` string.\n * @remarks\n * Use of a function for this allows a few things that most collections would not:\n * 1. It's possible to generate placeholder / error values on demand.\n * 2. It makes loading from some external registry on demand practical.\n * 3. The lookup can throw an exception if appropriate (this would typically indicate a bug and produce a fatal error).\n * 4. Generation of values can be lazy, and even asynchronous if `T` allows for a promise.\n *\n * This flexibility lets the implementer decide how to handle requests for unknown types.\n * They can produce placeholders, assert, fall back to a generic implementation etc.\n * @typeParam T - The type of entry produced for any given `type` string.\n * @input\n * @alpha\n */\nexport type Registry<T> = (type: string) => T;\n\n/**\n * A strongly typed key for a {@link Registry}.\n * Use with {@link lookupInRegistry}.\n * @remarks\n * Used to look up a `TIn` in a `Registry<TIn>`, and produce a `TOut` from it.\n * @typeParam TOut - The type produced by {@link RegistryKey.adapt} from a looked-up entry.\n * @typeParam TIn - The type of the entries in the {@link Registry} this key is used with.\n * @privateRemarks\n * This is currently input and sealed, meaning effectively type erased since the design might change.\n * @input\n * @sealed\n * @alpha\n */\nexport interface RegistryKey<TOut, TIn = unknown> {\n\t/**\n\t * Identifier to provide to the {@link Registry}.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * Convert a value from the registry to the desired output type.\n\t * @remarks\n\t * How this is done is up to the implementation.\n\t *\n\t * This might be a type guard which throws if the input is not valid.\n\t * Or it could be a conversion, an identity function, or something else.\n\t *\n\t * @param value - The value from the registry.\n\t * @returns The converted value.\n\t */\n\tadapt(value: TIn): TOut;\n}\n\n/**\n * Lookup an entry in a {@link Registry} using a {@link RegistryKey}.\n * @typeParam TOut - The type produced from the looked-up entry.\n * @typeParam TIn - The type of the entries in `registry`.\n * @alpha\n */\nexport function lookupInRegistry<TOut, TIn>(\n\tregistry: Registry<TIn>,\n\tkey: RegistryKey<TOut, TIn>,\n): TOut {\n\treturn key.adapt(registry(key.type));\n}\n\n/**\n * Creates a simple {@link RegistryKey} which does no type conversion.\n * @typeParam T - The type of the registry entry, which is returned unchanged by the key.\n * @alpha\n */\nexport function createBasicRegistryKey<T>(type: string): RegistryKey<T, T> {\n\treturn {\n\t\ttype,\n\t\tadapt: (value) => value,\n\t};\n}\n\n// #endregion\n\n// #region ServiceClient types\n\n/**\n * Oldest version of Fluid Framework client packages to support collaborating with.\n * @remarks\n * A string in SemVer format indicating a specific version of the Fluid Framework client package, or the special case of {@link @fluidframework/runtime-utils#defaultMinVersionForCollab}.\n *\n * Collaboration with other clients is only supported when all Fluid Framework client packages used by the client have a version that is greater than or equal\n * to the specified `MinimumVersionForCollaboration`.\n *\n * Cannot exceed the version of any Fluid Framework client package in use by the local client.\n *\n * The higher the version specified, the more features and optimizations will be enabled. *\n * @privateRemarks\n * This is similar to, and a subset of, the `MinimumVersionForCollab` type in `@fluidframework/runtime-definitions`.\n * This differs in that:\n * - This avoids the shorthand \"collab\" to instead align with our preferred whole word naming convention.\n * - This is `alpha` instead of `public`.\n * - This is available to drivers due to its location in `driver-definitions` instead of `runtime-definitions`.\n * - This does not allow requesting collaboration with pre-2.0.0 versions, including the special case of `2.0.0-defaults`.\n * - Patch versions cannot be set: a given minor release is not guaranteed to be greater or equal compat wise to all patches of the previous release, so we do not enable features based on patch versions (instead fall back to the next minor if needed).\n * Therefore allowing patch versions here could be misleading and could lead to bugs.\n *\n * @input\n * @alpha\n */\nexport type MinimumVersionForCollaboration = `2.${bigint}.0`;\n\n/**\n * Strips patch and prerelease from a SemVer string, returning only the major and minor version.\n * @remarks\n * This formats a version in the same style used by {@link MinimumVersionForCollaboration}, specifying only the major and minor versions,\n * which are the portions used for feature selection.\n * @typeParam major - The major version number of `version` as a string, preserved in the result type.\n * @typeParam minor - The minor version number of `version` as a string, preserved in the result type.\n * @privateRemarks\n * This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.\n * It can be used to workaround our generated pkgVersion values being invalid `MinimumVersionForCollaboration` on CI (due to prerelease) or patched release branches.\n * @alpha\n */\nexport function featureVersion<major extends `${bigint}`, minor extends `${bigint}`>(\n\tversion: `${major}.${minor}.${bigint}-${string}` | `${major}.${minor}.${bigint}`,\n): `${major}.${minor}.0` {\n\t// The SemVer package could be used to parse this version, but it wouldn't gain us anything, and would just make it harder to determine that the down casting below is valid.\n\t// Since we have a strongly typed string input, we know exactly which formats are allowed, so we don't need its more general parsing and validation either.\n\t// If we wanted to preserve the patch or prerelease version, that would require more complex parsing and would justify using the SemVer package, but we don't need that here.\n\tconst parsed = version.split(\".\");\n\treturn `${parsed[0] as major}.${parsed[1] as minor}.0`;\n}\n\n/**\n * Options for configuring a {@link ServiceClient}.\n * @remarks\n * These are the options which apply to all services.\n *\n * Individual services will extend with additional options.\n *\n * @input\n * @alpha\n */\nexport interface ServiceOptions {\n\treadonly minVersionForCollaboration: MinimumVersionForCollaboration;\n}\n\n/**\n * A {@link RegistryKey} for a {@link DataStoreKind}.\n * @remarks\n * This is implemented by {@link DataStoreKind}, but alternative implementations can be used if needed.\n *\n * If you want lazy loading and need a key that does not eagerly load the {@link DataStoreKind}, an alternative {@link DataStoreKey} can be implemented.\n * @typeParam T - The type to expose from the {@link DataStoreKind} this key resolves to.\n * @typeParam TAll - The type covering all {@link DataStoreKind}s in the {@link Registry} this key is used with.\n * @privateRemarks\n * TODO: A built in common pattern for the lazy key case should be provided.\n * TODO: things probably break if \"adapt\" does anything except throw or return the result from the input promise.\n * @input\n * @alpha\n */\nexport type DataStoreKey<T, TAll = unknown> = RegistryKey<\n\tPromise<DataStoreKind<T>>,\n\tPromise<DataStoreKind<TAll>>\n>;\n\n/**\n * A context which has a registry and can create data stores using it.\n * @sealed\n * @alpha\n */\nexport interface DataStoreCreator {\n\t/**\n\t * Create a new detached data store `T` which can be attached to the {@link FluidContainer}.\n\t * by adding a handle to a data store or shared object which is already attached to the {@link FluidContainer}.\n\t * @remarks\n\t * `kind` will be looked up in the {@link Registry} used to create or load this {@link DataStoreCreator}.\n\t * It is up to that registry to decide how it handles unknown types, for example by throwing an exception or returning a placeholder.\n\t * @typeParam T - type implemented by the data store to expose in the result, as defined by `kind`.\n\t */\n\tcreateDataStore<T>(kind: DataStoreKey<T>): Promise<T>;\n}\n\n/**\n * A Fluid container.\n * @remarks\n * A document which can be stored to or loaded from a Fluid service using a {@link ServiceClient}.\n *\n * @typeParam TData - The type of the container's root data store, exposed via {@link FluidContainer.data}.\n * @privateRemarks\n * This will likely end up needing many of IFluidContainer's APIs, like disconnect, connectionState, events etc.\n * Before adding them though, care should be taken to consider if they can be improved or simplified.\n * For example maybe a single status enum for `detached -> attaching -> dirty -> saved -> closed` would be good.\n * Or maybe `detached -> attaching -> attached -> closed` and a timer for how long since the last unsaved change was created.\n *\n * The underlying IContainer has a lifecycle which includes both a closed and disposed state.\n * This should be avoidable: the closed but not disposed state exists so its possible to read out some state at that time.\n * We have made the close remove all the timers, so the the dispose step should be unnecessary and we can just have a single closed state.\n *\n * @sealed\n * @alpha\n */\nexport interface FluidContainer<TData = unknown>\n\textends DataStoreCreator,\n\t\tErasedBaseType<readonly [\"FluidContainer\", TData]> {\n\t/**\n\t * The unique identifier for this container within its service.\n\t * @remarks\n\t * `undefined` if the container has not yet been attached to a service.\n\t * This can be used to load another instance of this container from the service using {@link ServiceClient.loadContainer}.\n\t */\n\treadonly id?: string | undefined;\n\n\t/**\n\t * The root data store of the container.\n\t * @remarks\n\t * The type of the root data store is defined by the {@link DataStoreKind} used to create the container.\n\t */\n\treadonly data: TData;\n\n\t/**\n\t * Close the container, stopping all networking and cancelling runtime timers.\n\t *\n\t * @remarks\n\t * After calling `close()`, the container's data can still be read but no further operations can be sent.\n\t * @privateRemarks\n\t * TODO: we should document the what the expected behavior is if one tries to modify the data after close, or tries to call close multiple times.\n\t * TODO: we also likely want to have a way to detect if closed and events for on close.\n\t * TODO: ensure this truly closes all timers: it seems like we might still leak some related to the summarizer.\n\t * TODO: we should clarify how this interacts with unsaved content including inprogress summaries,\n\t * and likely also provide an async API with some options for how to handle that.\n\t */\n\tclose(): void;\n}\n\n/**\n * A Fluid container with an associated {@link ServiceClient} it can attach to.\n * @typeParam TData - The type of the container's root data store.\n * @sealed\n * @alpha\n */\nexport interface FluidContainerWithService<TData = unknown> extends FluidContainer<TData> {\n\t/**\n\t * Attaches this container to the associated service client.\n\t *\n\t * The returned promise resolves once the container is attached: the container from the promise is the same one passed in as the argument.\n\t */\n\tattach(): Promise<FluidContainerAttached<TData>>;\n\n\t// This could expose access to the ServiceClient if needed.\n}\n\n/**\n * A Fluid container that has been attached to a service.\n * @typeParam TData - The type of the container's root data store.\n * @sealed\n * @alpha\n */\nexport interface FluidContainerAttached<TData = unknown> extends FluidContainer<TData> {\n\t/**\n\t * {@inheritdoc FluidContainer.id}\n\t */\n\treadonly id: string;\n}\n\n/**\n * Defines a {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind} of data store, allowing creating and loading instances of it.\n * @remarks\n * A `DataStoreKind` acts as the factory and type descriptor for a category of data store:\n * it defines the `type` used to identify the data store in a {@link DataStoreRegistry},\n * and the `T` API surface that instances of that data store expose.\n *\n * Provide a `DataStoreKind` to {@link ServiceClient.(createContainer:1)} or {@link DataStoreCreator.createDataStore}\n * to create new instances, and to {@link ServiceClient.loadContainer} to load existing ones.\n *\n * A `DataStoreKind` is not constructed directly.\n * Instead, obtain one from a framework-provided factory:\n * use {@link @fluidframework/shared-object-base#defineDataStore} to define a data store which wraps a root shared object,\n * or use a more specific wrapper around that,\n * such as {@link @fluidframework/tree#defineTreeDataStore} for a {@link @fluidframework/tree#TreeView}-backed data store.\n *\n * Since it implements {@link DataStoreKey}, a `DataStoreKind` can also be used directly as the key to look\n * itself up in a {@link Registry}.\n * @typeParam T - The API surface that instances of this data store kind expose.\n * @privateRemarks\n * TODO:\n * SharedObjects should be usable as these (though putting shared objects directly in the container might need special logic).\n * Type erased {@link IFluidDataStoreFactory}.\n * @sealed\n * @alpha\n */\nexport interface DataStoreKind<out T = unknown>\n\textends DataStoreKey<T>,\n\t\tErasedBaseType<readonly [\"DataStoreKind\", T]> {}\n\n/**\n * A registry of {@link DataStoreKind}s.\n * @privateRemarks\n * TODO: unify this with SharedObjectRegistry.\n *\n * @typeParam T - The type covering all {@link DataStoreKind}s in the registry.\n * @input\n * @alpha\n */\nexport type DataStoreRegistry<out T = unknown> = Registry<Promise<DataStoreKind<T>>>;\n\n/**\n * A connection to a Fluid storage service.\n * @sealed\n * @alpha\n */\nexport interface ServiceClient {\n\t/**\n\t * Creates a detached container associated with this service client.\n\t * @typeParam T - The type of the container's root data store, as defined by `root`.\n\t * @param root - A {@link DataStoreKind} to use for the root.\n\t * @remarks\n\t * This overload is a shorthand for a simple case of {@link ServiceClient.(createContainer:2)}\n\t * where a single item registry is produced which contains only the root.\n\t * This is usable only when the root {@link DataStoreKind} is available eagerly (e.g. not lazy loaded),\n\t * and when the container does not need a registry for creating additional data stores beyond the root.\n\t * @privateRemarks\n\t * TODO: As this is a detached container, it should be able to be created synchronously.\n\t *\n\t * TODO: Provide more general alternative to this in the form of a service-independent `createContainer` free function.\n\t * It would work with a `ServiceClient.attachContainer<T>(detached: FluidContainer<T>): Promise<FluidContainerAttached<T>>`\n\t * which returns a promise that resolves once the detached container has been attached\n\t * (pointing to the same container object, but with the new type).\n\t *\n\t * Challenges:\n\t *\n\t * Currently the service must be provided at creation time because `IContainer.attach` does not accept a service client,\n\t * making it unclear whether a truly service-independent path is feasible in the near term.\n\t */\n\tcreateContainer<T>(root: DataStoreKind<T>): Promise<FluidContainerWithService<T>>;\n\n\t/**\n\t * Creates a detached container associated with this service client.\n\t * @typeParam T - The type of the container's root data store, as defined by `root`.\n\t * @param root - A {@link DataStoreKey} used to look up the root's {@link DataStoreKind} from `registry`.\n\t * @param registry - The {@link DataStoreRegistry} supplying the {@link DataStoreKind} for the root and any other data stores the container may need to create.\n\t * @remarks\n\t * Use this overload when the root {@link DataStoreKind} is not available eagerly (e.g. for lazy loading),\n\t * or when the container needs a registry for creating additional data stores beyond the root.\n\t */\n\tcreateContainer<T>(\n\t\troot: DataStoreKey<T>,\n\t\tregistry: DataStoreRegistry,\n\t): Promise<FluidContainerWithService<T>>;\n\n\t/**\n\t * A shorthand for {@link ServiceClient.(createContainer:1)} followed by {@link FluidContainerWithService.attach}.\n\t * @remarks\n\t * Due to current implementation limitations making container creation async and service specific,\n\t * creating then attaching one is a bit verbose with two awaits that are messy to include inline.\n\t * This provides a convenient way to create and attach a container in a single step.\n\t * @privateRemarks\n\t * TODO: We should fix ergonomics issues that make this helpful,\n\t * then remove (or deprecate) this method in favor of `service.attach(createContainer(root))` as a better orthogonalized API.\n\t * See private remarks on {@link ServiceClient.(createContainer:1)}.\n\t */\n\tcreateAttachedContainer<T>(root: DataStoreKind<T>): Promise<FluidContainerAttached<T>>;\n\n\t/**\n\t * A shorthand for {@link ServiceClient.(createContainer:2)} followed by {@link FluidContainerWithService.attach}.\n\t * @remarks\n\t * Due to current implementation limitations making container creation async and service specific,\n\t * creating then attaching one is a bit verbose with two awaits that are messy to include inline.\n\t * This provides a convenient way to create and attach a container in a single step.\n\t */\n\tcreateAttachedContainer<T>(\n\t\troot: DataStoreKey<T>,\n\t\tregistry: DataStoreRegistry,\n\t): Promise<FluidContainerAttached<T>>;\n\n\t/**\n\t * Loads an existing container from the service.\n\t * @typeParam T - The type of the container's root data store.\n\t * @param id - The unique identifier of the container to load.\n\t * @param root - The {@link DataStoreKind} for the root, or a registry which will be used to look up the root based on its type.\n\t *\n\t * @throws a {@link @fluidframework/telemetry-utils#UsageError} if the DataStoreKind's type (either the root directly or looked up from the registry) does not match the type of the root data store in the container.\n\t *\n\t * @privateRemarks\n\t * The ability to provide a registry here means that it's possible to:\n\t * 1. Load a container which might have a few different possible roots, for example because of versioning.\n\t * 2. Generate the DataStoreKind on demand based on the type: this approach could be used for things like debug tools which can load any possible container.\n\t * 3. Generating the DataStoreKind if the type is unrecognized, for example to provide a placeholder which might support some minimal functionality (like debug inspection, and summary).\n\t *\n\t * The ability to provide just a single DataStoreKind<T> is purely a convenience to make it cleaner to use this in simple cases.\n\t */\n\tloadContainer<T>(\n\t\tid: string,\n\t\troot: DataStoreKind<T> | DataStoreRegistry<T>,\n\t): Promise<FluidContainerAttached<T>>;\n}\n\n// #endregion\n"]}
|
|
1
|
+
{"version":3,"file":"serviceClient.js","sourceRoot":"","sources":["../src/serviceClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsFH;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC/B,QAAuB,EACvB,GAA2B;IAE3B,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AALD,4CAKC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAI,IAAY;IACrD,OAAO;QACN,IAAI;QACJ,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;KACvB,CAAC;AACH,CAAC;AALD,wDAKC;AAiCD;;;;;;;;;;;;GAYG;AACH,SAAgB,cAAc,CAC7B,OAAgF;IAEhF,6KAA6K;IAC7K,2JAA2J;IAC3J,6KAA6K;IAC7K,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAU,IAAI,MAAM,CAAC,CAAC,CAAU,IAAI,CAAC;AACxD,CAAC;AARD,wCAQC;AAoRD,aAAa","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedBaseType } from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * This file defines the external facing API for the {@link ServiceClient} and related types.\n *\n * It provides an API surface at a similar abstraction level to aqueduct and fluid-static, but is intended to be a replacement for those which solves several problems with them.\n * Mainly it strives to have the encapsulation of implementation details (including all legacy APIs from aqueduct and lower level internals) like fluid-static\n * while being both more flexible and simpler.\n *\n * This aims to be the cleanest practical way to build applications on the Fluid Framework Client.\n * There are however several known cases where the API quality was sacrificed to ease initial implementation,\n * since some of the unification desired in this API's design are not yet implemented in the underlying Fluid Framework Client code or require additional work to implement.\n * These cases are called out with TODOs in this file.\n * These should be considered and addressed before stabilizing this API past alpha.\n *\n * All code interacting through this API surface within a single client must avoid using multiple copies of any Fluid Framework client package (at the same or different versions).\n * This mirrors the `@public` \"declarative model\" APIs and is a deliberate simplification of what is allowed in the legacy API surface.\n * It is enforced best-effort only: `@sealed` nominal erased types catch many mismatches at compile time, and factory identity checks throw a UsageError (\"Conflicting ... with same type\") at run time, but the checking is not exhaustive.\n * See `LayerCompatibilityUnified.md` for the full policy, rationale, and failure signatures.\n *\n * TODO:\n * Before stabilizing any of this past beta, evaluate whether this single-copy requirement must be relaxed, and if so how.\n * Whatever rule is chosen (relaxed or not) should be enforced at both compile time and run time as much as possible.\n *\n * TODO:\n * Fault isolation should be considered in this API design.\n * When are exceptions recoverable and how?\n * Likely we can fault isolate exceptions to containers in most cases,\n * and containers can indicate their status by being closed or disposed.\n * Non fatal errors should not be exceptions.\n */\n\n// #region Registry types\n\n/**\n * A collection of entries looked up by a `type` string.\n * @remarks\n * Use of a function for this allows a few things that most collections would not:\n * 1. It's possible to generate placeholder / error values on demand.\n * 2. It makes loading from some external registry on demand practical.\n * 3. The lookup can throw an exception if appropriate (this would typically indicate a bug and produce a fatal error).\n * 4. Generation of values can be lazy, and even asynchronous if `T` allows for a promise.\n *\n * This flexibility lets the implementer decide how to handle requests for unknown types.\n * They can produce placeholders, assert, fall back to a generic implementation etc.\n * @typeParam T - The type of entry produced for any given `type` string.\n * @input\n * @alpha\n */\nexport type Registry<T> = (type: string) => T;\n\n/**\n * A strongly typed key for a {@link Registry}.\n * Use with {@link lookupInRegistry}.\n * @remarks\n * Used to look up a `TIn` in a `Registry<TIn>`, and produce a `TOut` from it.\n * @typeParam TOut - The type produced by {@link RegistryKey.adapt} from a looked-up entry.\n * @typeParam TIn - The type of the entries in the {@link Registry} this key is used with.\n * @privateRemarks\n * This is currently input and sealed, meaning effectively type erased since the design might change.\n * @input\n * @sealed\n * @alpha\n */\nexport interface RegistryKey<TOut, TIn = unknown> {\n\t/**\n\t * Identifier to provide to the {@link Registry}.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * Convert a value from the registry to the desired output type.\n\t * @remarks\n\t * How this is done is up to the implementation.\n\t *\n\t * This might be a type guard which throws if the input is not valid.\n\t * Or it could be a conversion, an identity function, or something else.\n\t *\n\t * @param value - The value from the registry.\n\t * @returns The converted value.\n\t */\n\tadapt(value: TIn): TOut;\n}\n\n/**\n * Lookup an entry in a {@link Registry} using a {@link RegistryKey}.\n * @typeParam TOut - The type produced from the looked-up entry.\n * @typeParam TIn - The type of the entries in `registry`.\n * @alpha\n */\nexport function lookupInRegistry<TOut, TIn>(\n\tregistry: Registry<TIn>,\n\tkey: RegistryKey<TOut, TIn>,\n): TOut {\n\treturn key.adapt(registry(key.type));\n}\n\n/**\n * Creates a simple {@link RegistryKey} which does no type conversion.\n * @typeParam T - The type of the registry entry, which is returned unchanged by the key.\n * @alpha\n */\nexport function createBasicRegistryKey<T>(type: string): RegistryKey<T, T> {\n\treturn {\n\t\ttype,\n\t\tadapt: (value) => value,\n\t};\n}\n\n// #endregion\n\n// #region ServiceClient types\n\n/**\n * Oldest Fluid Framework client version that must be able to open and process documents written\n * by a service client.\n * @remarks\n * A string in SemVer format indicating a specific version of the Fluid Framework client package, or the special case of {@link @fluidframework/runtime-utils#defaultMinVersionForCollab}.\n *\n * Service clients use this value to select write formats and features. Clients using this version\n * or newer must be able to open and process documents written by the service client. Choosing an\n * older version may limit the features and write formats the application can use to those\n * supported by that version.\n *\n * Cannot exceed the version of any Fluid Framework client package in use by the local client.\n *\n * @privateRemarks\n * This is similar to, and a subset of, the `OldestSupportedClientVersion` type in `@fluidframework/runtime-definitions`.\n * This differs in that:\n * - This is `alpha` instead of `public`.\n * - This is available to drivers due to its location in `driver-definitions` instead of `runtime-definitions`.\n * - This does not allow requesting collaboration with pre-2.0.0 versions, including the special case of `2.0.0-defaults`.\n * - Patch versions cannot be set: a given minor release is not guaranteed to be greater or equal compat wise to all patches of the previous release, so we do not enable features based on patch versions (instead fall back to the next minor if needed).\n * Therefore allowing patch versions here could be misleading and could lead to bugs.\n *\n * @input\n * @alpha\n */\nexport type OldestSupportedServiceClientVersion = `2.${bigint}.0`;\n\n/**\n * Strips patch and prerelease from a SemVer string, returning only the major and minor version.\n * @remarks\n * This formats a version in the same style used by {@link OldestSupportedServiceClientVersion}, specifying only the major and minor versions,\n * which are the portions used for feature selection.\n * @typeParam major - The major version number of `version` as a string, preserved in the result type.\n * @typeParam minor - The minor version number of `version` as a string, preserved in the result type.\n * @privateRemarks\n * This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.\n * It can be used to workaround our generated pkgVersion values being invalid\n * `OldestSupportedServiceClientVersion` on CI due to prerelease or patched release branches.\n * @alpha\n */\nexport function featureVersion<major extends `${bigint}`, minor extends `${bigint}`>(\n\tversion: `${major}.${minor}.${bigint}-${string}` | `${major}.${minor}.${bigint}`,\n): `${major}.${minor}.0` {\n\t// The SemVer package could be used to parse this version, but it wouldn't gain us anything, and would just make it harder to determine that the down casting below is valid.\n\t// Since we have a strongly typed string input, we know exactly which formats are allowed, so we don't need its more general parsing and validation either.\n\t// If we wanted to preserve the patch or prerelease version, that would require more complex parsing and would justify using the SemVer package, but we don't need that here.\n\tconst parsed = version.split(\".\");\n\treturn `${parsed[0] as major}.${parsed[1] as minor}.0`;\n}\n\n/**\n * Options for configuring a {@link ServiceClient}.\n * @remarks\n * These are the options which apply to all services.\n *\n * Individual services will extend with additional options.\n *\n * @input\n * @alpha\n */\nexport interface ServiceOptions {\n\t/**\n\t * Oldest Fluid Framework client version that must be able to open and process documents written\n\t * by the service client.\n\t *\n\t * @remarks\n\t * Choosing an older version may limit the features and write formats the application can use to\n\t * those supported by that version.\n\t *\n\t * A service may provide a default when this option is omitted.\n\t */\n\treadonly oldestSupportedClient?: OldestSupportedServiceClientVersion;\n}\n\n/**\n * A {@link RegistryKey} for a {@link DataStoreKind}.\n * @remarks\n * This is implemented by {@link DataStoreKind}, but alternative implementations can be used if needed.\n *\n * If you want lazy loading and need a key that does not eagerly load the {@link DataStoreKind}, an alternative {@link DataStoreKey} can be implemented.\n * @typeParam T - The type to expose from the {@link DataStoreKind} this key resolves to.\n * @typeParam TAll - The type covering all {@link DataStoreKind}s in the {@link Registry} this key is used with.\n * @privateRemarks\n * TODO: A built in common pattern for the lazy key case should be provided.\n * TODO: things probably break if \"adapt\" does anything except throw or return the result from the input promise.\n * @input\n * @alpha\n */\nexport type DataStoreKey<T, TAll = unknown> = RegistryKey<\n\tPromise<DataStoreKind<T>>,\n\tPromise<DataStoreKind<TAll>>\n>;\n\n/**\n * A context which has a registry and can create data stores using it.\n * @sealed\n * @alpha\n */\nexport interface DataStoreCreator {\n\t/**\n\t * Create a new detached data store `T` which can be attached to the {@link FluidContainer}.\n\t * by adding a handle to a data store or shared object which is already attached to the {@link FluidContainer}.\n\t * @remarks\n\t * `kind` will be looked up in the {@link Registry} used to create or load this {@link DataStoreCreator}.\n\t * It is up to that registry to decide how it handles unknown types, for example by throwing an exception or returning a placeholder.\n\t * @typeParam T - type implemented by the data store to expose in the result, as defined by `kind`.\n\t */\n\tcreateDataStore<T>(kind: DataStoreKey<T>): Promise<T>;\n}\n\n/**\n * A Fluid container.\n * @remarks\n * A document which can be stored to or loaded from a Fluid service using a {@link ServiceClient}.\n *\n * @typeParam TData - The type of the container's root data store, exposed via {@link FluidContainer.data}.\n * @privateRemarks\n * This will likely end up needing many of IFluidContainer's APIs, like disconnect, connectionState, events etc.\n * Before adding them though, care should be taken to consider if they can be improved or simplified.\n * For example maybe a single status enum for `detached -> attaching -> dirty -> saved -> closed` would be good.\n * Or maybe `detached -> attaching -> attached -> closed` and a timer for how long since the last unsaved change was created.\n *\n * The underlying IContainer has a lifecycle which includes both a closed and disposed state.\n * This should be avoidable: the closed but not disposed state exists so its possible to read out some state at that time.\n * We have made the close remove all the timers, so the the dispose step should be unnecessary and we can just have a single closed state.\n *\n * @sealed\n * @alpha\n */\nexport interface FluidContainer<TData = unknown>\n\textends DataStoreCreator,\n\t\tErasedBaseType<readonly [\"FluidContainer\", TData]> {\n\t/**\n\t * The unique identifier for this container within its service.\n\t * @remarks\n\t * `undefined` if the container has not yet been attached to a service.\n\t * This can be used to load another instance of this container from the service using {@link ServiceClient.loadContainer}.\n\t */\n\treadonly id?: string | undefined;\n\n\t/**\n\t * The root data store of the container.\n\t * @remarks\n\t * The type of the root data store is defined by the {@link DataStoreKind} used to create the container.\n\t */\n\treadonly data: TData;\n\n\t/**\n\t * Close the container, stopping all networking and cancelling runtime timers.\n\t *\n\t * @remarks\n\t * After calling `close()`, the container's data can still be read but no further operations can be sent.\n\t * @privateRemarks\n\t * TODO: we should document the what the expected behavior is if one tries to modify the data after close, or tries to call close multiple times.\n\t * TODO: we also likely want to have a way to detect if closed and events for on close.\n\t * TODO: ensure this truly closes all timers: it seems like we might still leak some related to the summarizer.\n\t * TODO: we should clarify how this interacts with unsaved content including inprogress summaries,\n\t * and likely also provide an async API with some options for how to handle that.\n\t */\n\tclose(): void;\n}\n\n/**\n * A Fluid container with an associated {@link ServiceClient} it can attach to.\n * @typeParam TData - The type of the container's root data store.\n * @sealed\n * @alpha\n */\nexport interface FluidContainerWithService<TData = unknown> extends FluidContainer<TData> {\n\t/**\n\t * Attaches this container to the associated service client.\n\t *\n\t * The returned promise resolves once the container is attached: the container from the promise is the same one passed in as the argument.\n\t */\n\tattach(): Promise<FluidContainerAttached<TData>>;\n\n\t// This could expose access to the ServiceClient if needed.\n}\n\n/**\n * A Fluid container that has been attached to a service.\n * @typeParam TData - The type of the container's root data store.\n * @sealed\n * @alpha\n */\nexport interface FluidContainerAttached<TData = unknown> extends FluidContainer<TData> {\n\t/**\n\t * {@inheritdoc FluidContainer.id}\n\t */\n\treadonly id: string;\n}\n\n/**\n * Defines a {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind} of data store, allowing creating and loading instances of it.\n * @remarks\n * A `DataStoreKind` acts as the factory and type descriptor for a category of data store:\n * it defines the `type` used to identify the data store in a {@link DataStoreRegistry},\n * and the `T` API surface that instances of that data store expose.\n *\n * Provide a `DataStoreKind` to {@link ServiceClient.(createContainer:1)} or {@link DataStoreCreator.createDataStore}\n * to create new instances, and to {@link ServiceClient.loadContainer} to load existing ones.\n *\n * A `DataStoreKind` is not constructed directly.\n * Instead, obtain one from a framework-provided factory:\n * use {@link @fluidframework/shared-object-base#defineDataStore} to define a data store which wraps a root shared object,\n * or use a more specific wrapper around that,\n * such as {@link @fluidframework/tree#defineTreeDataStore} for a {@link @fluidframework/tree#TreeView}-backed data store.\n *\n * Since it implements {@link DataStoreKey}, a `DataStoreKind` can also be used directly as the key to look\n * itself up in a {@link Registry}.\n * @typeParam T - The API surface that instances of this data store kind expose.\n * @privateRemarks\n * TODO:\n * SharedObjects should be usable as these (though putting shared objects directly in the container might need special logic).\n * Type erased {@link IFluidDataStoreFactory}.\n * @sealed\n * @alpha\n */\nexport interface DataStoreKind<out T = unknown>\n\textends DataStoreKey<T>,\n\t\tErasedBaseType<readonly [\"DataStoreKind\", T]> {}\n\n/**\n * A registry of {@link DataStoreKind}s.\n * @privateRemarks\n * TODO: unify this with SharedObjectRegistry.\n *\n * @typeParam T - The type covering all {@link DataStoreKind}s in the registry.\n * @input\n * @alpha\n */\nexport type DataStoreRegistry<out T = unknown> = Registry<Promise<DataStoreKind<T>>>;\n\n/**\n * A connection to a Fluid storage service.\n * @sealed\n * @alpha\n */\nexport interface ServiceClient {\n\t/**\n\t * Creates a detached container associated with this service client.\n\t * @typeParam T - The type of the container's root data store, as defined by `root`.\n\t * @param root - A {@link DataStoreKind} to use for the root.\n\t * @remarks\n\t * This overload is a shorthand for a simple case of {@link ServiceClient.(createContainer:2)}\n\t * where a single item registry is produced which contains only the root.\n\t * This is usable only when the root {@link DataStoreKind} is available eagerly (e.g. not lazy loaded),\n\t * and when the container does not need a registry for creating additional data stores beyond the root.\n\t * @privateRemarks\n\t * TODO: As this is a detached container, it should be able to be created synchronously.\n\t *\n\t * TODO: Provide more general alternative to this in the form of a service-independent `createContainer` free function.\n\t * It would work with a `ServiceClient.attachContainer<T>(detached: FluidContainer<T>): Promise<FluidContainerAttached<T>>`\n\t * which returns a promise that resolves once the detached container has been attached\n\t * (pointing to the same container object, but with the new type).\n\t *\n\t * Challenges:\n\t *\n\t * Currently the service must be provided at creation time because `IContainer.attach` does not accept a service client,\n\t * making it unclear whether a truly service-independent path is feasible in the near term.\n\t */\n\tcreateContainer<T>(root: DataStoreKind<T>): Promise<FluidContainerWithService<T>>;\n\n\t/**\n\t * Creates a detached container associated with this service client.\n\t * @typeParam T - The type of the container's root data store, as defined by `root`.\n\t * @param root - A {@link DataStoreKey} used to look up the root's {@link DataStoreKind} from `registry`.\n\t * @param registry - The {@link DataStoreRegistry} supplying the {@link DataStoreKind} for the root and any other data stores the container may need to create.\n\t * @remarks\n\t * Use this overload when the root {@link DataStoreKind} is not available eagerly (e.g. for lazy loading),\n\t * or when the container needs a registry for creating additional data stores beyond the root.\n\t */\n\tcreateContainer<T>(\n\t\troot: DataStoreKey<T>,\n\t\tregistry: DataStoreRegistry,\n\t): Promise<FluidContainerWithService<T>>;\n\n\t/**\n\t * A shorthand for {@link ServiceClient.(createContainer:1)} followed by {@link FluidContainerWithService.attach}.\n\t * @remarks\n\t * Due to current implementation limitations making container creation async and service specific,\n\t * creating then attaching one is a bit verbose with two awaits that are messy to include inline.\n\t * This provides a convenient way to create and attach a container in a single step.\n\t * @privateRemarks\n\t * TODO: We should fix ergonomics issues that make this helpful,\n\t * then remove (or deprecate) this method in favor of `service.attach(createContainer(root))` as a better orthogonalized API.\n\t * See private remarks on {@link ServiceClient.(createContainer:1)}.\n\t */\n\tcreateAttachedContainer<T>(root: DataStoreKind<T>): Promise<FluidContainerAttached<T>>;\n\n\t/**\n\t * A shorthand for {@link ServiceClient.(createContainer:2)} followed by {@link FluidContainerWithService.attach}.\n\t * @remarks\n\t * Due to current implementation limitations making container creation async and service specific,\n\t * creating then attaching one is a bit verbose with two awaits that are messy to include inline.\n\t * This provides a convenient way to create and attach a container in a single step.\n\t */\n\tcreateAttachedContainer<T>(\n\t\troot: DataStoreKey<T>,\n\t\tregistry: DataStoreRegistry,\n\t): Promise<FluidContainerAttached<T>>;\n\n\t/**\n\t * Loads an existing container from the service.\n\t * @typeParam T - The type of the container's root data store.\n\t * @param id - The unique identifier of the container to load.\n\t * @param root - The {@link DataStoreKind} for the root, or a registry which will be used to look up the root based on its type.\n\t *\n\t * @throws a {@link @fluidframework/telemetry-utils#UsageError} if the DataStoreKind's type (either the root directly or looked up from the registry) does not match the type of the root data store in the container.\n\t *\n\t * @privateRemarks\n\t * The ability to provide a registry here means that it's possible to:\n\t * 1. Load a container which might have a few different possible roots, for example because of versioning.\n\t * 2. Generate the DataStoreKind on demand based on the type: this approach could be used for things like debug tools which can load any possible container.\n\t * 3. Generating the DataStoreKind if the type is unrecognized, for example to provide a placeholder which might support some minimal functionality (like debug inspection, and summary).\n\t *\n\t * The ability to provide just a single DataStoreKind<T> is purely a convenience to make it cleaner to use this in simple cases.\n\t */\n\tloadContainer<T>(\n\t\tid: string,\n\t\troot: DataStoreKind<T> | DataStoreRegistry<T>,\n\t): Promise<FluidContainerAttached<T>>;\n}\n\n// #endregion\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ export { DriverHeader } from "./urlResolver.js";
|
|
|
12
12
|
export type { ConnectionMode, IApprovedProposal, IAttachment, IBlob, IBranchOrigin, ICapabilities, IClient, IClientConfiguration, IClientDetails, IClientJoin, ICommittedProposal, IConnect, IConnected, ICreateBlobResponse, IDocumentAttributes, IDocumentMessage, IDocumentSystemMessage, INack, INackContent, IProcessMessageResult, IProposal, IProtocolState, IQuorum, IQuorumClients, IQuorumProposals, ISentSignalMessage, ISequencedClient, ISequencedDocumentAugmentedMessage, ISequencedDocumentMessage, ISequencedDocumentMessageExperimental, ISequencedDocumentSystemMessage, ISequencedProposal, IServerError, ISignalClient, ISignalMessage, ISignalMessageBase, ISnapshotTree, ISnapshotTreeEx, IsoDate, ISummaryAck, ISummaryAttachment, ISummaryBlob, ISummaryContent, ISummaryHandle, ISummaryNack, ISummaryProposal, ISummaryTree, ITokenClaims, ITrace, ITree, ITreeEntry, IUploadedSummaryDetails, IUser, IVersion, SummaryObject, SummaryTree, SummaryTypeNoHandle, } from "./protocol/index.js";
|
|
13
13
|
export { FileMode, MessageType, NackErrorType, ScopeType, SignalType, SummaryType, TreeEntry, } from "./protocol/index.js";
|
|
14
14
|
export type { IGitAuthor, IGitBlob, IGitCommitDetails, IGitCommitHash, IGitCommitter, IGitCreateBlobParams, IGitCreateBlobResponse, IGitCreateTreeEntry, IGitCreateTreeParams, IGitTree, IGitTreeEntry, } from "./git/index.js";
|
|
15
|
-
export type { DataStoreCreator, DataStoreKey, DataStoreKind, DataStoreRegistry, FluidContainer, FluidContainerAttached, FluidContainerWithService,
|
|
15
|
+
export type { DataStoreCreator, DataStoreKey, DataStoreKind, DataStoreRegistry, FluidContainer, FluidContainerAttached, FluidContainerWithService, OldestSupportedServiceClientVersion, Registry, RegistryKey, ServiceClient, ServiceOptions, } from "./serviceClient.js";
|
|
16
16
|
export { createBasicRegistryKey, lookupInRegistry, featureVersion } from "./serviceClient.js";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACX,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,OAAO,EACP,aAAa,EACb,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAChE,YAAY,EACX,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,YAAY,EACX,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,aAAa,EACb,aAAa,EACb,OAAO,EACP,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,YAAY,EACZ,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kCAAkC,EAClC,yBAAyB,EACzB,qCAAqC,EACrC,+BAA+B,EAC/B,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,EACV,uBAAuB,EACvB,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GACT,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,QAAQ,EACR,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACX,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,SAAS,EACT,qBAAqB,EACrB,OAAO,EACP,aAAa,EACb,eAAe,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAChE,YAAY,EACX,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,YAAY,EACX,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,aAAa,EACb,aAAa,EACb,OAAO,EACP,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,EACL,YAAY,EACZ,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kCAAkC,EAClC,yBAAyB,EACzB,qCAAqC,EACrC,+BAA+B,EAC/B,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,EACV,uBAAuB,EACvB,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GACT,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,QAAQ,EACR,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,mCAAmC,EACnC,QAAQ,EACR,WAAW,EACX,aAAa,EACb,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAoBpD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAQhE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA6DhD,OAAO,EACN,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GACT,MAAM,qBAAqB,CAAC;AA4B7B,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n} from \"./cacheDefinitions.js\";\n\nexport type {\n\tDriverError,\n\tIAnyDriverError,\n\tIAuthorizationError,\n\tIDriverErrorBase,\n\tIDriverBasicError,\n\tIGenericNetworkError,\n\tILocationRedirectionError,\n\tIThrottlingWarning,\n} from \"./driverError.js\";\nexport { DriverErrorTypes } from \"./driverError.js\";\nexport type {\n\tFiveDaysMs,\n\tIDeltasFetchResult,\n\tIDeltaStorageService,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tIStream,\n\tIStreamResult,\n\tISummaryContext,\n} from \"./storage.js\";\nexport { FetchSource, LoaderCachingPolicy } from \"./storage.js\";\nexport type {\n\tDriverPreCheckInfo,\n\tIContainerPackageInfo,\n\tIDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver.js\";\nexport { DriverHeader } from \"./urlResolver.js\";\n\nexport type {\n\tConnectionMode,\n\tIApprovedProposal,\n\tIAttachment,\n\tIBlob,\n\tIBranchOrigin,\n\tICapabilities,\n\tIClient,\n\tIClientConfiguration,\n\tIClientDetails,\n\tIClientJoin,\n\tICommittedProposal,\n\tIConnect,\n\tIConnected,\n\tICreateBlobResponse,\n\tIDocumentAttributes,\n\tIDocumentMessage,\n\tIDocumentSystemMessage,\n\tINack,\n\tINackContent,\n\tIProcessMessageResult,\n\tIProposal,\n\tIProtocolState,\n\tIQuorum,\n\tIQuorumClients,\n\tIQuorumProposals,\n\tISentSignalMessage,\n\tISequencedClient,\n\tISequencedDocumentAugmentedMessage,\n\tISequencedDocumentMessage,\n\tISequencedDocumentMessageExperimental,\n\tISequencedDocumentSystemMessage,\n\tISequencedProposal,\n\tIServerError,\n\tISignalClient,\n\tISignalMessage,\n\tISignalMessageBase,\n\tISnapshotTree,\n\tISnapshotTreeEx,\n\tIsoDate,\n\tISummaryAck,\n\tISummaryAttachment,\n\tISummaryBlob,\n\tISummaryContent,\n\tISummaryHandle,\n\tISummaryNack,\n\tISummaryProposal,\n\tISummaryTree,\n\tITokenClaims,\n\tITrace,\n\tITree,\n\tITreeEntry,\n\tIUploadedSummaryDetails,\n\tIUser,\n\tIVersion,\n\tSummaryObject,\n\tSummaryTree,\n\tSummaryTypeNoHandle,\n} from \"./protocol/index.js\";\nexport {\n\tFileMode,\n\tMessageType,\n\tNackErrorType,\n\tScopeType,\n\tSignalType,\n\tSummaryType,\n\tTreeEntry,\n} from \"./protocol/index.js\";\nexport type {\n\tIGitAuthor,\n\tIGitBlob,\n\tIGitCommitDetails,\n\tIGitCommitHash,\n\tIGitCommitter,\n\tIGitCreateBlobParams,\n\tIGitCreateBlobResponse,\n\tIGitCreateTreeEntry,\n\tIGitCreateTreeParams,\n\tIGitTree,\n\tIGitTreeEntry,\n} from \"./git/index.js\";\nexport type {\n\tDataStoreCreator,\n\tDataStoreKey,\n\tDataStoreKind,\n\tDataStoreRegistry,\n\tFluidContainer,\n\tFluidContainerAttached,\n\tFluidContainerWithService,\n\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAoBpD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAQhE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA6DhD,OAAO,EACN,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GACT,MAAM,qBAAqB,CAAC;AA4B7B,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n} from \"./cacheDefinitions.js\";\n\nexport type {\n\tDriverError,\n\tIAnyDriverError,\n\tIAuthorizationError,\n\tIDriverErrorBase,\n\tIDriverBasicError,\n\tIGenericNetworkError,\n\tILocationRedirectionError,\n\tIThrottlingWarning,\n} from \"./driverError.js\";\nexport { DriverErrorTypes } from \"./driverError.js\";\nexport type {\n\tFiveDaysMs,\n\tIDeltasFetchResult,\n\tIDeltaStorageService,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tISnapshot,\n\tISnapshotFetchOptions,\n\tIStream,\n\tIStreamResult,\n\tISummaryContext,\n} from \"./storage.js\";\nexport { FetchSource, LoaderCachingPolicy } from \"./storage.js\";\nexport type {\n\tDriverPreCheckInfo,\n\tIContainerPackageInfo,\n\tIDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver.js\";\nexport { DriverHeader } from \"./urlResolver.js\";\n\nexport type {\n\tConnectionMode,\n\tIApprovedProposal,\n\tIAttachment,\n\tIBlob,\n\tIBranchOrigin,\n\tICapabilities,\n\tIClient,\n\tIClientConfiguration,\n\tIClientDetails,\n\tIClientJoin,\n\tICommittedProposal,\n\tIConnect,\n\tIConnected,\n\tICreateBlobResponse,\n\tIDocumentAttributes,\n\tIDocumentMessage,\n\tIDocumentSystemMessage,\n\tINack,\n\tINackContent,\n\tIProcessMessageResult,\n\tIProposal,\n\tIProtocolState,\n\tIQuorum,\n\tIQuorumClients,\n\tIQuorumProposals,\n\tISentSignalMessage,\n\tISequencedClient,\n\tISequencedDocumentAugmentedMessage,\n\tISequencedDocumentMessage,\n\tISequencedDocumentMessageExperimental,\n\tISequencedDocumentSystemMessage,\n\tISequencedProposal,\n\tIServerError,\n\tISignalClient,\n\tISignalMessage,\n\tISignalMessageBase,\n\tISnapshotTree,\n\tISnapshotTreeEx,\n\tIsoDate,\n\tISummaryAck,\n\tISummaryAttachment,\n\tISummaryBlob,\n\tISummaryContent,\n\tISummaryHandle,\n\tISummaryNack,\n\tISummaryProposal,\n\tISummaryTree,\n\tITokenClaims,\n\tITrace,\n\tITree,\n\tITreeEntry,\n\tIUploadedSummaryDetails,\n\tIUser,\n\tIVersion,\n\tSummaryObject,\n\tSummaryTree,\n\tSummaryTypeNoHandle,\n} from \"./protocol/index.js\";\nexport {\n\tFileMode,\n\tMessageType,\n\tNackErrorType,\n\tScopeType,\n\tSignalType,\n\tSummaryType,\n\tTreeEntry,\n} from \"./protocol/index.js\";\nexport type {\n\tIGitAuthor,\n\tIGitBlob,\n\tIGitCommitDetails,\n\tIGitCommitHash,\n\tIGitCommitter,\n\tIGitCreateBlobParams,\n\tIGitCreateBlobResponse,\n\tIGitCreateTreeEntry,\n\tIGitCreateTreeParams,\n\tIGitTree,\n\tIGitTreeEntry,\n} from \"./git/index.js\";\nexport type {\n\tDataStoreCreator,\n\tDataStoreKey,\n\tDataStoreKind,\n\tDataStoreRegistry,\n\tFluidContainer,\n\tFluidContainerAttached,\n\tFluidContainerWithService,\n\tOldestSupportedServiceClientVersion,\n\tRegistry,\n\tRegistryKey,\n\tServiceClient,\n\tServiceOptions,\n} from \"./serviceClient.js\";\nexport { createBasicRegistryKey, lookupInRegistry, featureVersion } from \"./serviceClient.js\";\n"]}
|
package/lib/serviceClient.d.ts
CHANGED
|
@@ -93,20 +93,21 @@ export declare function lookupInRegistry<TOut, TIn>(registry: Registry<TIn>, key
|
|
|
93
93
|
*/
|
|
94
94
|
export declare function createBasicRegistryKey<T>(type: string): RegistryKey<T, T>;
|
|
95
95
|
/**
|
|
96
|
-
* Oldest
|
|
96
|
+
* Oldest Fluid Framework client version that must be able to open and process documents written
|
|
97
|
+
* by a service client.
|
|
97
98
|
* @remarks
|
|
98
99
|
* A string in SemVer format indicating a specific version of the Fluid Framework client package, or the special case of {@link @fluidframework/runtime-utils#defaultMinVersionForCollab}.
|
|
99
100
|
*
|
|
100
|
-
*
|
|
101
|
-
* to the
|
|
101
|
+
* Service clients use this value to select write formats and features. Clients using this version
|
|
102
|
+
* or newer must be able to open and process documents written by the service client. Choosing an
|
|
103
|
+
* older version may limit the features and write formats the application can use to those
|
|
104
|
+
* supported by that version.
|
|
102
105
|
*
|
|
103
106
|
* Cannot exceed the version of any Fluid Framework client package in use by the local client.
|
|
104
107
|
*
|
|
105
|
-
* The higher the version specified, the more features and optimizations will be enabled. *
|
|
106
108
|
* @privateRemarks
|
|
107
|
-
* This is similar to, and a subset of, the `
|
|
109
|
+
* This is similar to, and a subset of, the `OldestSupportedClientVersion` type in `@fluidframework/runtime-definitions`.
|
|
108
110
|
* This differs in that:
|
|
109
|
-
* - This avoids the shorthand "collab" to instead align with our preferred whole word naming convention.
|
|
110
111
|
* - This is `alpha` instead of `public`.
|
|
111
112
|
* - This is available to drivers due to its location in `driver-definitions` instead of `runtime-definitions`.
|
|
112
113
|
* - This does not allow requesting collaboration with pre-2.0.0 versions, including the special case of `2.0.0-defaults`.
|
|
@@ -116,17 +117,18 @@ export declare function createBasicRegistryKey<T>(type: string): RegistryKey<T,
|
|
|
116
117
|
* @input
|
|
117
118
|
* @alpha
|
|
118
119
|
*/
|
|
119
|
-
export type
|
|
120
|
+
export type OldestSupportedServiceClientVersion = `2.${bigint}.0`;
|
|
120
121
|
/**
|
|
121
122
|
* Strips patch and prerelease from a SemVer string, returning only the major and minor version.
|
|
122
123
|
* @remarks
|
|
123
|
-
* This formats a version in the same style used by {@link
|
|
124
|
+
* This formats a version in the same style used by {@link OldestSupportedServiceClientVersion}, specifying only the major and minor versions,
|
|
124
125
|
* which are the portions used for feature selection.
|
|
125
126
|
* @typeParam major - The major version number of `version` as a string, preserved in the result type.
|
|
126
127
|
* @typeParam minor - The minor version number of `version` as a string, preserved in the result type.
|
|
127
128
|
* @privateRemarks
|
|
128
129
|
* This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.
|
|
129
|
-
* It can be used to workaround our generated pkgVersion values being invalid
|
|
130
|
+
* It can be used to workaround our generated pkgVersion values being invalid
|
|
131
|
+
* `OldestSupportedServiceClientVersion` on CI due to prerelease or patched release branches.
|
|
130
132
|
* @alpha
|
|
131
133
|
*/
|
|
132
134
|
export declare function featureVersion<major extends `${bigint}`, minor extends `${bigint}`>(version: `${major}.${minor}.${bigint}-${string}` | `${major}.${minor}.${bigint}`): `${major}.${minor}.0`;
|
|
@@ -141,7 +143,17 @@ export declare function featureVersion<major extends `${bigint}`, minor extends
|
|
|
141
143
|
* @alpha
|
|
142
144
|
*/
|
|
143
145
|
export interface ServiceOptions {
|
|
144
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Oldest Fluid Framework client version that must be able to open and process documents written
|
|
148
|
+
* by the service client.
|
|
149
|
+
*
|
|
150
|
+
* @remarks
|
|
151
|
+
* Choosing an older version may limit the features and write formats the application can use to
|
|
152
|
+
* those supported by that version.
|
|
153
|
+
*
|
|
154
|
+
* A service may provide a default when this option is omitted.
|
|
155
|
+
*/
|
|
156
|
+
readonly oldestSupportedClient?: OldestSupportedServiceClientVersion;
|
|
145
157
|
}
|
|
146
158
|
/**
|
|
147
159
|
* A {@link RegistryKey} for a {@link DataStoreKind}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceClient.d.ts","sourceRoot":"","sources":["../src/serviceClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO;IAC/C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,EACzC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,EACvB,GAAG,EAAE,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,GACzB,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAKzE;AAMD
|
|
1
|
+
{"version":3,"file":"serviceClient.d.ts","sourceRoot":"","sources":["../src/serviceClient.ts"],"names":[],"mappings":"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"}
|
package/lib/serviceClient.js
CHANGED
|
@@ -25,13 +25,14 @@ export function createBasicRegistryKey(type) {
|
|
|
25
25
|
/**
|
|
26
26
|
* Strips patch and prerelease from a SemVer string, returning only the major and minor version.
|
|
27
27
|
* @remarks
|
|
28
|
-
* This formats a version in the same style used by {@link
|
|
28
|
+
* This formats a version in the same style used by {@link OldestSupportedServiceClientVersion}, specifying only the major and minor versions,
|
|
29
29
|
* which are the portions used for feature selection.
|
|
30
30
|
* @typeParam major - The major version number of `version` as a string, preserved in the result type.
|
|
31
31
|
* @typeParam minor - The minor version number of `version` as a string, preserved in the result type.
|
|
32
32
|
* @privateRemarks
|
|
33
33
|
* This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.
|
|
34
|
-
* It can be used to workaround our generated pkgVersion values being invalid
|
|
34
|
+
* It can be used to workaround our generated pkgVersion values being invalid
|
|
35
|
+
* `OldestSupportedServiceClientVersion` on CI due to prerelease or patched release branches.
|
|
35
36
|
* @alpha
|
|
36
37
|
*/
|
|
37
38
|
export function featureVersion(version) {
|
package/lib/serviceClient.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceClient.js","sourceRoot":"","sources":["../src/serviceClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsFH;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC/B,QAAuB,EACvB,GAA2B;IAE3B,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAI,IAAY;IACrD,OAAO;QACN,IAAI;QACJ,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;KACvB,CAAC;AACH,CAAC;AAgCD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAC7B,OAAgF;IAEhF,6KAA6K;IAC7K,2JAA2J;IAC3J,6KAA6K;IAC7K,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAU,IAAI,MAAM,CAAC,CAAC,CAAU,IAAI,CAAC;AACxD,CAAC;AA0QD,aAAa","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedBaseType } from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * This file defines the external facing API for the {@link ServiceClient} and related types.\n *\n * It provides an API surface at a similar abstraction level to aqueduct and fluid-static, but is intended to be a replacement for those which solves several problems with them.\n * Mainly it strives to have the encapsulation of implementation details (including all legacy APIs from aqueduct and lower level internals) like fluid-static\n * while being both more flexible and simpler.\n *\n * This aims to be the cleanest practical way to build applications on the Fluid Framework Client.\n * There are however several known cases where the API quality was sacrificed to ease initial implementation,\n * since some of the unification desired in this API's design are not yet implemented in the underlying Fluid Framework Client code or require additional work to implement.\n * These cases are called out with TODOs in this file.\n * These should be considered and addressed before stabilizing this API past alpha.\n *\n * All code interacting through this API surface within a single client must avoid using multiple copies of any Fluid Framework client package (at the same or different versions).\n * This mirrors the `@public` \"declarative model\" APIs and is a deliberate simplification of what is allowed in the legacy API surface.\n * It is enforced best-effort only: `@sealed` nominal erased types catch many mismatches at compile time, and factory identity checks throw a UsageError (\"Conflicting ... with same type\") at run time, but the checking is not exhaustive.\n * See `LayerCompatibilityUnified.md` for the full policy, rationale, and failure signatures.\n *\n * TODO:\n * Before stabilizing any of this past beta, evaluate whether this single-copy requirement must be relaxed, and if so how.\n * Whatever rule is chosen (relaxed or not) should be enforced at both compile time and run time as much as possible.\n *\n * TODO:\n * Fault isolation should be considered in this API design.\n * When are exceptions recoverable and how?\n * Likely we can fault isolate exceptions to containers in most cases,\n * and containers can indicate their status by being closed or disposed.\n * Non fatal errors should not be exceptions.\n */\n\n// #region Registry types\n\n/**\n * A collection of entries looked up by a `type` string.\n * @remarks\n * Use of a function for this allows a few things that most collections would not:\n * 1. It's possible to generate placeholder / error values on demand.\n * 2. It makes loading from some external registry on demand practical.\n * 3. The lookup can throw an exception if appropriate (this would typically indicate a bug and produce a fatal error).\n * 4. Generation of values can be lazy, and even asynchronous if `T` allows for a promise.\n *\n * This flexibility lets the implementer decide how to handle requests for unknown types.\n * They can produce placeholders, assert, fall back to a generic implementation etc.\n * @typeParam T - The type of entry produced for any given `type` string.\n * @input\n * @alpha\n */\nexport type Registry<T> = (type: string) => T;\n\n/**\n * A strongly typed key for a {@link Registry}.\n * Use with {@link lookupInRegistry}.\n * @remarks\n * Used to look up a `TIn` in a `Registry<TIn>`, and produce a `TOut` from it.\n * @typeParam TOut - The type produced by {@link RegistryKey.adapt} from a looked-up entry.\n * @typeParam TIn - The type of the entries in the {@link Registry} this key is used with.\n * @privateRemarks\n * This is currently input and sealed, meaning effectively type erased since the design might change.\n * @input\n * @sealed\n * @alpha\n */\nexport interface RegistryKey<TOut, TIn = unknown> {\n\t/**\n\t * Identifier to provide to the {@link Registry}.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * Convert a value from the registry to the desired output type.\n\t * @remarks\n\t * How this is done is up to the implementation.\n\t *\n\t * This might be a type guard which throws if the input is not valid.\n\t * Or it could be a conversion, an identity function, or something else.\n\t *\n\t * @param value - The value from the registry.\n\t * @returns The converted value.\n\t */\n\tadapt(value: TIn): TOut;\n}\n\n/**\n * Lookup an entry in a {@link Registry} using a {@link RegistryKey}.\n * @typeParam TOut - The type produced from the looked-up entry.\n * @typeParam TIn - The type of the entries in `registry`.\n * @alpha\n */\nexport function lookupInRegistry<TOut, TIn>(\n\tregistry: Registry<TIn>,\n\tkey: RegistryKey<TOut, TIn>,\n): TOut {\n\treturn key.adapt(registry(key.type));\n}\n\n/**\n * Creates a simple {@link RegistryKey} which does no type conversion.\n * @typeParam T - The type of the registry entry, which is returned unchanged by the key.\n * @alpha\n */\nexport function createBasicRegistryKey<T>(type: string): RegistryKey<T, T> {\n\treturn {\n\t\ttype,\n\t\tadapt: (value) => value,\n\t};\n}\n\n// #endregion\n\n// #region ServiceClient types\n\n/**\n * Oldest version of Fluid Framework client packages to support collaborating with.\n * @remarks\n * A string in SemVer format indicating a specific version of the Fluid Framework client package, or the special case of {@link @fluidframework/runtime-utils#defaultMinVersionForCollab}.\n *\n * Collaboration with other clients is only supported when all Fluid Framework client packages used by the client have a version that is greater than or equal\n * to the specified `MinimumVersionForCollaboration`.\n *\n * Cannot exceed the version of any Fluid Framework client package in use by the local client.\n *\n * The higher the version specified, the more features and optimizations will be enabled. *\n * @privateRemarks\n * This is similar to, and a subset of, the `MinimumVersionForCollab` type in `@fluidframework/runtime-definitions`.\n * This differs in that:\n * - This avoids the shorthand \"collab\" to instead align with our preferred whole word naming convention.\n * - This is `alpha` instead of `public`.\n * - This is available to drivers due to its location in `driver-definitions` instead of `runtime-definitions`.\n * - This does not allow requesting collaboration with pre-2.0.0 versions, including the special case of `2.0.0-defaults`.\n * - Patch versions cannot be set: a given minor release is not guaranteed to be greater or equal compat wise to all patches of the previous release, so we do not enable features based on patch versions (instead fall back to the next minor if needed).\n * Therefore allowing patch versions here could be misleading and could lead to bugs.\n *\n * @input\n * @alpha\n */\nexport type MinimumVersionForCollaboration = `2.${bigint}.0`;\n\n/**\n * Strips patch and prerelease from a SemVer string, returning only the major and minor version.\n * @remarks\n * This formats a version in the same style used by {@link MinimumVersionForCollaboration}, specifying only the major and minor versions,\n * which are the portions used for feature selection.\n * @typeParam major - The major version number of `version` as a string, preserved in the result type.\n * @typeParam minor - The minor version number of `version` as a string, preserved in the result type.\n * @privateRemarks\n * This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.\n * It can be used to workaround our generated pkgVersion values being invalid `MinimumVersionForCollaboration` on CI (due to prerelease) or patched release branches.\n * @alpha\n */\nexport function featureVersion<major extends `${bigint}`, minor extends `${bigint}`>(\n\tversion: `${major}.${minor}.${bigint}-${string}` | `${major}.${minor}.${bigint}`,\n): `${major}.${minor}.0` {\n\t// The SemVer package could be used to parse this version, but it wouldn't gain us anything, and would just make it harder to determine that the down casting below is valid.\n\t// Since we have a strongly typed string input, we know exactly which formats are allowed, so we don't need its more general parsing and validation either.\n\t// If we wanted to preserve the patch or prerelease version, that would require more complex parsing and would justify using the SemVer package, but we don't need that here.\n\tconst parsed = version.split(\".\");\n\treturn `${parsed[0] as major}.${parsed[1] as minor}.0`;\n}\n\n/**\n * Options for configuring a {@link ServiceClient}.\n * @remarks\n * These are the options which apply to all services.\n *\n * Individual services will extend with additional options.\n *\n * @input\n * @alpha\n */\nexport interface ServiceOptions {\n\treadonly minVersionForCollaboration: MinimumVersionForCollaboration;\n}\n\n/**\n * A {@link RegistryKey} for a {@link DataStoreKind}.\n * @remarks\n * This is implemented by {@link DataStoreKind}, but alternative implementations can be used if needed.\n *\n * If you want lazy loading and need a key that does not eagerly load the {@link DataStoreKind}, an alternative {@link DataStoreKey} can be implemented.\n * @typeParam T - The type to expose from the {@link DataStoreKind} this key resolves to.\n * @typeParam TAll - The type covering all {@link DataStoreKind}s in the {@link Registry} this key is used with.\n * @privateRemarks\n * TODO: A built in common pattern for the lazy key case should be provided.\n * TODO: things probably break if \"adapt\" does anything except throw or return the result from the input promise.\n * @input\n * @alpha\n */\nexport type DataStoreKey<T, TAll = unknown> = RegistryKey<\n\tPromise<DataStoreKind<T>>,\n\tPromise<DataStoreKind<TAll>>\n>;\n\n/**\n * A context which has a registry and can create data stores using it.\n * @sealed\n * @alpha\n */\nexport interface DataStoreCreator {\n\t/**\n\t * Create a new detached data store `T` which can be attached to the {@link FluidContainer}.\n\t * by adding a handle to a data store or shared object which is already attached to the {@link FluidContainer}.\n\t * @remarks\n\t * `kind` will be looked up in the {@link Registry} used to create or load this {@link DataStoreCreator}.\n\t * It is up to that registry to decide how it handles unknown types, for example by throwing an exception or returning a placeholder.\n\t * @typeParam T - type implemented by the data store to expose in the result, as defined by `kind`.\n\t */\n\tcreateDataStore<T>(kind: DataStoreKey<T>): Promise<T>;\n}\n\n/**\n * A Fluid container.\n * @remarks\n * A document which can be stored to or loaded from a Fluid service using a {@link ServiceClient}.\n *\n * @typeParam TData - The type of the container's root data store, exposed via {@link FluidContainer.data}.\n * @privateRemarks\n * This will likely end up needing many of IFluidContainer's APIs, like disconnect, connectionState, events etc.\n * Before adding them though, care should be taken to consider if they can be improved or simplified.\n * For example maybe a single status enum for `detached -> attaching -> dirty -> saved -> closed` would be good.\n * Or maybe `detached -> attaching -> attached -> closed` and a timer for how long since the last unsaved change was created.\n *\n * The underlying IContainer has a lifecycle which includes both a closed and disposed state.\n * This should be avoidable: the closed but not disposed state exists so its possible to read out some state at that time.\n * We have made the close remove all the timers, so the the dispose step should be unnecessary and we can just have a single closed state.\n *\n * @sealed\n * @alpha\n */\nexport interface FluidContainer<TData = unknown>\n\textends DataStoreCreator,\n\t\tErasedBaseType<readonly [\"FluidContainer\", TData]> {\n\t/**\n\t * The unique identifier for this container within its service.\n\t * @remarks\n\t * `undefined` if the container has not yet been attached to a service.\n\t * This can be used to load another instance of this container from the service using {@link ServiceClient.loadContainer}.\n\t */\n\treadonly id?: string | undefined;\n\n\t/**\n\t * The root data store of the container.\n\t * @remarks\n\t * The type of the root data store is defined by the {@link DataStoreKind} used to create the container.\n\t */\n\treadonly data: TData;\n\n\t/**\n\t * Close the container, stopping all networking and cancelling runtime timers.\n\t *\n\t * @remarks\n\t * After calling `close()`, the container's data can still be read but no further operations can be sent.\n\t * @privateRemarks\n\t * TODO: we should document the what the expected behavior is if one tries to modify the data after close, or tries to call close multiple times.\n\t * TODO: we also likely want to have a way to detect if closed and events for on close.\n\t * TODO: ensure this truly closes all timers: it seems like we might still leak some related to the summarizer.\n\t * TODO: we should clarify how this interacts with unsaved content including inprogress summaries,\n\t * and likely also provide an async API with some options for how to handle that.\n\t */\n\tclose(): void;\n}\n\n/**\n * A Fluid container with an associated {@link ServiceClient} it can attach to.\n * @typeParam TData - The type of the container's root data store.\n * @sealed\n * @alpha\n */\nexport interface FluidContainerWithService<TData = unknown> extends FluidContainer<TData> {\n\t/**\n\t * Attaches this container to the associated service client.\n\t *\n\t * The returned promise resolves once the container is attached: the container from the promise is the same one passed in as the argument.\n\t */\n\tattach(): Promise<FluidContainerAttached<TData>>;\n\n\t// This could expose access to the ServiceClient if needed.\n}\n\n/**\n * A Fluid container that has been attached to a service.\n * @typeParam TData - The type of the container's root data store.\n * @sealed\n * @alpha\n */\nexport interface FluidContainerAttached<TData = unknown> extends FluidContainer<TData> {\n\t/**\n\t * {@inheritdoc FluidContainer.id}\n\t */\n\treadonly id: string;\n}\n\n/**\n * Defines a {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind} of data store, allowing creating and loading instances of it.\n * @remarks\n * A `DataStoreKind` acts as the factory and type descriptor for a category of data store:\n * it defines the `type` used to identify the data store in a {@link DataStoreRegistry},\n * and the `T` API surface that instances of that data store expose.\n *\n * Provide a `DataStoreKind` to {@link ServiceClient.(createContainer:1)} or {@link DataStoreCreator.createDataStore}\n * to create new instances, and to {@link ServiceClient.loadContainer} to load existing ones.\n *\n * A `DataStoreKind` is not constructed directly.\n * Instead, obtain one from a framework-provided factory:\n * use {@link @fluidframework/shared-object-base#defineDataStore} to define a data store which wraps a root shared object,\n * or use a more specific wrapper around that,\n * such as {@link @fluidframework/tree#defineTreeDataStore} for a {@link @fluidframework/tree#TreeView}-backed data store.\n *\n * Since it implements {@link DataStoreKey}, a `DataStoreKind` can also be used directly as the key to look\n * itself up in a {@link Registry}.\n * @typeParam T - The API surface that instances of this data store kind expose.\n * @privateRemarks\n * TODO:\n * SharedObjects should be usable as these (though putting shared objects directly in the container might need special logic).\n * Type erased {@link IFluidDataStoreFactory}.\n * @sealed\n * @alpha\n */\nexport interface DataStoreKind<out T = unknown>\n\textends DataStoreKey<T>,\n\t\tErasedBaseType<readonly [\"DataStoreKind\", T]> {}\n\n/**\n * A registry of {@link DataStoreKind}s.\n * @privateRemarks\n * TODO: unify this with SharedObjectRegistry.\n *\n * @typeParam T - The type covering all {@link DataStoreKind}s in the registry.\n * @input\n * @alpha\n */\nexport type DataStoreRegistry<out T = unknown> = Registry<Promise<DataStoreKind<T>>>;\n\n/**\n * A connection to a Fluid storage service.\n * @sealed\n * @alpha\n */\nexport interface ServiceClient {\n\t/**\n\t * Creates a detached container associated with this service client.\n\t * @typeParam T - The type of the container's root data store, as defined by `root`.\n\t * @param root - A {@link DataStoreKind} to use for the root.\n\t * @remarks\n\t * This overload is a shorthand for a simple case of {@link ServiceClient.(createContainer:2)}\n\t * where a single item registry is produced which contains only the root.\n\t * This is usable only when the root {@link DataStoreKind} is available eagerly (e.g. not lazy loaded),\n\t * and when the container does not need a registry for creating additional data stores beyond the root.\n\t * @privateRemarks\n\t * TODO: As this is a detached container, it should be able to be created synchronously.\n\t *\n\t * TODO: Provide more general alternative to this in the form of a service-independent `createContainer` free function.\n\t * It would work with a `ServiceClient.attachContainer<T>(detached: FluidContainer<T>): Promise<FluidContainerAttached<T>>`\n\t * which returns a promise that resolves once the detached container has been attached\n\t * (pointing to the same container object, but with the new type).\n\t *\n\t * Challenges:\n\t *\n\t * Currently the service must be provided at creation time because `IContainer.attach` does not accept a service client,\n\t * making it unclear whether a truly service-independent path is feasible in the near term.\n\t */\n\tcreateContainer<T>(root: DataStoreKind<T>): Promise<FluidContainerWithService<T>>;\n\n\t/**\n\t * Creates a detached container associated with this service client.\n\t * @typeParam T - The type of the container's root data store, as defined by `root`.\n\t * @param root - A {@link DataStoreKey} used to look up the root's {@link DataStoreKind} from `registry`.\n\t * @param registry - The {@link DataStoreRegistry} supplying the {@link DataStoreKind} for the root and any other data stores the container may need to create.\n\t * @remarks\n\t * Use this overload when the root {@link DataStoreKind} is not available eagerly (e.g. for lazy loading),\n\t * or when the container needs a registry for creating additional data stores beyond the root.\n\t */\n\tcreateContainer<T>(\n\t\troot: DataStoreKey<T>,\n\t\tregistry: DataStoreRegistry,\n\t): Promise<FluidContainerWithService<T>>;\n\n\t/**\n\t * A shorthand for {@link ServiceClient.(createContainer:1)} followed by {@link FluidContainerWithService.attach}.\n\t * @remarks\n\t * Due to current implementation limitations making container creation async and service specific,\n\t * creating then attaching one is a bit verbose with two awaits that are messy to include inline.\n\t * This provides a convenient way to create and attach a container in a single step.\n\t * @privateRemarks\n\t * TODO: We should fix ergonomics issues that make this helpful,\n\t * then remove (or deprecate) this method in favor of `service.attach(createContainer(root))` as a better orthogonalized API.\n\t * See private remarks on {@link ServiceClient.(createContainer:1)}.\n\t */\n\tcreateAttachedContainer<T>(root: DataStoreKind<T>): Promise<FluidContainerAttached<T>>;\n\n\t/**\n\t * A shorthand for {@link ServiceClient.(createContainer:2)} followed by {@link FluidContainerWithService.attach}.\n\t * @remarks\n\t * Due to current implementation limitations making container creation async and service specific,\n\t * creating then attaching one is a bit verbose with two awaits that are messy to include inline.\n\t * This provides a convenient way to create and attach a container in a single step.\n\t */\n\tcreateAttachedContainer<T>(\n\t\troot: DataStoreKey<T>,\n\t\tregistry: DataStoreRegistry,\n\t): Promise<FluidContainerAttached<T>>;\n\n\t/**\n\t * Loads an existing container from the service.\n\t * @typeParam T - The type of the container's root data store.\n\t * @param id - The unique identifier of the container to load.\n\t * @param root - The {@link DataStoreKind} for the root, or a registry which will be used to look up the root based on its type.\n\t *\n\t * @throws a {@link @fluidframework/telemetry-utils#UsageError} if the DataStoreKind's type (either the root directly or looked up from the registry) does not match the type of the root data store in the container.\n\t *\n\t * @privateRemarks\n\t * The ability to provide a registry here means that it's possible to:\n\t * 1. Load a container which might have a few different possible roots, for example because of versioning.\n\t * 2. Generate the DataStoreKind on demand based on the type: this approach could be used for things like debug tools which can load any possible container.\n\t * 3. Generating the DataStoreKind if the type is unrecognized, for example to provide a placeholder which might support some minimal functionality (like debug inspection, and summary).\n\t *\n\t * The ability to provide just a single DataStoreKind<T> is purely a convenience to make it cleaner to use this in simple cases.\n\t */\n\tloadContainer<T>(\n\t\tid: string,\n\t\troot: DataStoreKind<T> | DataStoreRegistry<T>,\n\t): Promise<FluidContainerAttached<T>>;\n}\n\n// #endregion\n"]}
|
|
1
|
+
{"version":3,"file":"serviceClient.js","sourceRoot":"","sources":["../src/serviceClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsFH;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC/B,QAAuB,EACvB,GAA2B;IAE3B,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAI,IAAY;IACrD,OAAO;QACN,IAAI;QACJ,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;KACvB,CAAC;AACH,CAAC;AAiCD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAC7B,OAAgF;IAEhF,6KAA6K;IAC7K,2JAA2J;IAC3J,6KAA6K;IAC7K,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAU,IAAI,MAAM,CAAC,CAAC,CAAU,IAAI,CAAC;AACxD,CAAC;AAoRD,aAAa","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedBaseType } from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * This file defines the external facing API for the {@link ServiceClient} and related types.\n *\n * It provides an API surface at a similar abstraction level to aqueduct and fluid-static, but is intended to be a replacement for those which solves several problems with them.\n * Mainly it strives to have the encapsulation of implementation details (including all legacy APIs from aqueduct and lower level internals) like fluid-static\n * while being both more flexible and simpler.\n *\n * This aims to be the cleanest practical way to build applications on the Fluid Framework Client.\n * There are however several known cases where the API quality was sacrificed to ease initial implementation,\n * since some of the unification desired in this API's design are not yet implemented in the underlying Fluid Framework Client code or require additional work to implement.\n * These cases are called out with TODOs in this file.\n * These should be considered and addressed before stabilizing this API past alpha.\n *\n * All code interacting through this API surface within a single client must avoid using multiple copies of any Fluid Framework client package (at the same or different versions).\n * This mirrors the `@public` \"declarative model\" APIs and is a deliberate simplification of what is allowed in the legacy API surface.\n * It is enforced best-effort only: `@sealed` nominal erased types catch many mismatches at compile time, and factory identity checks throw a UsageError (\"Conflicting ... with same type\") at run time, but the checking is not exhaustive.\n * See `LayerCompatibilityUnified.md` for the full policy, rationale, and failure signatures.\n *\n * TODO:\n * Before stabilizing any of this past beta, evaluate whether this single-copy requirement must be relaxed, and if so how.\n * Whatever rule is chosen (relaxed or not) should be enforced at both compile time and run time as much as possible.\n *\n * TODO:\n * Fault isolation should be considered in this API design.\n * When are exceptions recoverable and how?\n * Likely we can fault isolate exceptions to containers in most cases,\n * and containers can indicate their status by being closed or disposed.\n * Non fatal errors should not be exceptions.\n */\n\n// #region Registry types\n\n/**\n * A collection of entries looked up by a `type` string.\n * @remarks\n * Use of a function for this allows a few things that most collections would not:\n * 1. It's possible to generate placeholder / error values on demand.\n * 2. It makes loading from some external registry on demand practical.\n * 3. The lookup can throw an exception if appropriate (this would typically indicate a bug and produce a fatal error).\n * 4. Generation of values can be lazy, and even asynchronous if `T` allows for a promise.\n *\n * This flexibility lets the implementer decide how to handle requests for unknown types.\n * They can produce placeholders, assert, fall back to a generic implementation etc.\n * @typeParam T - The type of entry produced for any given `type` string.\n * @input\n * @alpha\n */\nexport type Registry<T> = (type: string) => T;\n\n/**\n * A strongly typed key for a {@link Registry}.\n * Use with {@link lookupInRegistry}.\n * @remarks\n * Used to look up a `TIn` in a `Registry<TIn>`, and produce a `TOut` from it.\n * @typeParam TOut - The type produced by {@link RegistryKey.adapt} from a looked-up entry.\n * @typeParam TIn - The type of the entries in the {@link Registry} this key is used with.\n * @privateRemarks\n * This is currently input and sealed, meaning effectively type erased since the design might change.\n * @input\n * @sealed\n * @alpha\n */\nexport interface RegistryKey<TOut, TIn = unknown> {\n\t/**\n\t * Identifier to provide to the {@link Registry}.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * Convert a value from the registry to the desired output type.\n\t * @remarks\n\t * How this is done is up to the implementation.\n\t *\n\t * This might be a type guard which throws if the input is not valid.\n\t * Or it could be a conversion, an identity function, or something else.\n\t *\n\t * @param value - The value from the registry.\n\t * @returns The converted value.\n\t */\n\tadapt(value: TIn): TOut;\n}\n\n/**\n * Lookup an entry in a {@link Registry} using a {@link RegistryKey}.\n * @typeParam TOut - The type produced from the looked-up entry.\n * @typeParam TIn - The type of the entries in `registry`.\n * @alpha\n */\nexport function lookupInRegistry<TOut, TIn>(\n\tregistry: Registry<TIn>,\n\tkey: RegistryKey<TOut, TIn>,\n): TOut {\n\treturn key.adapt(registry(key.type));\n}\n\n/**\n * Creates a simple {@link RegistryKey} which does no type conversion.\n * @typeParam T - The type of the registry entry, which is returned unchanged by the key.\n * @alpha\n */\nexport function createBasicRegistryKey<T>(type: string): RegistryKey<T, T> {\n\treturn {\n\t\ttype,\n\t\tadapt: (value) => value,\n\t};\n}\n\n// #endregion\n\n// #region ServiceClient types\n\n/**\n * Oldest Fluid Framework client version that must be able to open and process documents written\n * by a service client.\n * @remarks\n * A string in SemVer format indicating a specific version of the Fluid Framework client package, or the special case of {@link @fluidframework/runtime-utils#defaultMinVersionForCollab}.\n *\n * Service clients use this value to select write formats and features. Clients using this version\n * or newer must be able to open and process documents written by the service client. Choosing an\n * older version may limit the features and write formats the application can use to those\n * supported by that version.\n *\n * Cannot exceed the version of any Fluid Framework client package in use by the local client.\n *\n * @privateRemarks\n * This is similar to, and a subset of, the `OldestSupportedClientVersion` type in `@fluidframework/runtime-definitions`.\n * This differs in that:\n * - This is `alpha` instead of `public`.\n * - This is available to drivers due to its location in `driver-definitions` instead of `runtime-definitions`.\n * - This does not allow requesting collaboration with pre-2.0.0 versions, including the special case of `2.0.0-defaults`.\n * - Patch versions cannot be set: a given minor release is not guaranteed to be greater or equal compat wise to all patches of the previous release, so we do not enable features based on patch versions (instead fall back to the next minor if needed).\n * Therefore allowing patch versions here could be misleading and could lead to bugs.\n *\n * @input\n * @alpha\n */\nexport type OldestSupportedServiceClientVersion = `2.${bigint}.0`;\n\n/**\n * Strips patch and prerelease from a SemVer string, returning only the major and minor version.\n * @remarks\n * This formats a version in the same style used by {@link OldestSupportedServiceClientVersion}, specifying only the major and minor versions,\n * which are the portions used for feature selection.\n * @typeParam major - The major version number of `version` as a string, preserved in the result type.\n * @typeParam minor - The minor version number of `version` as a string, preserved in the result type.\n * @privateRemarks\n * This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.\n * It can be used to workaround our generated pkgVersion values being invalid\n * `OldestSupportedServiceClientVersion` on CI due to prerelease or patched release branches.\n * @alpha\n */\nexport function featureVersion<major extends `${bigint}`, minor extends `${bigint}`>(\n\tversion: `${major}.${minor}.${bigint}-${string}` | `${major}.${minor}.${bigint}`,\n): `${major}.${minor}.0` {\n\t// The SemVer package could be used to parse this version, but it wouldn't gain us anything, and would just make it harder to determine that the down casting below is valid.\n\t// Since we have a strongly typed string input, we know exactly which formats are allowed, so we don't need its more general parsing and validation either.\n\t// If we wanted to preserve the patch or prerelease version, that would require more complex parsing and would justify using the SemVer package, but we don't need that here.\n\tconst parsed = version.split(\".\");\n\treturn `${parsed[0] as major}.${parsed[1] as minor}.0`;\n}\n\n/**\n * Options for configuring a {@link ServiceClient}.\n * @remarks\n * These are the options which apply to all services.\n *\n * Individual services will extend with additional options.\n *\n * @input\n * @alpha\n */\nexport interface ServiceOptions {\n\t/**\n\t * Oldest Fluid Framework client version that must be able to open and process documents written\n\t * by the service client.\n\t *\n\t * @remarks\n\t * Choosing an older version may limit the features and write formats the application can use to\n\t * those supported by that version.\n\t *\n\t * A service may provide a default when this option is omitted.\n\t */\n\treadonly oldestSupportedClient?: OldestSupportedServiceClientVersion;\n}\n\n/**\n * A {@link RegistryKey} for a {@link DataStoreKind}.\n * @remarks\n * This is implemented by {@link DataStoreKind}, but alternative implementations can be used if needed.\n *\n * If you want lazy loading and need a key that does not eagerly load the {@link DataStoreKind}, an alternative {@link DataStoreKey} can be implemented.\n * @typeParam T - The type to expose from the {@link DataStoreKind} this key resolves to.\n * @typeParam TAll - The type covering all {@link DataStoreKind}s in the {@link Registry} this key is used with.\n * @privateRemarks\n * TODO: A built in common pattern for the lazy key case should be provided.\n * TODO: things probably break if \"adapt\" does anything except throw or return the result from the input promise.\n * @input\n * @alpha\n */\nexport type DataStoreKey<T, TAll = unknown> = RegistryKey<\n\tPromise<DataStoreKind<T>>,\n\tPromise<DataStoreKind<TAll>>\n>;\n\n/**\n * A context which has a registry and can create data stores using it.\n * @sealed\n * @alpha\n */\nexport interface DataStoreCreator {\n\t/**\n\t * Create a new detached data store `T` which can be attached to the {@link FluidContainer}.\n\t * by adding a handle to a data store or shared object which is already attached to the {@link FluidContainer}.\n\t * @remarks\n\t * `kind` will be looked up in the {@link Registry} used to create or load this {@link DataStoreCreator}.\n\t * It is up to that registry to decide how it handles unknown types, for example by throwing an exception or returning a placeholder.\n\t * @typeParam T - type implemented by the data store to expose in the result, as defined by `kind`.\n\t */\n\tcreateDataStore<T>(kind: DataStoreKey<T>): Promise<T>;\n}\n\n/**\n * A Fluid container.\n * @remarks\n * A document which can be stored to or loaded from a Fluid service using a {@link ServiceClient}.\n *\n * @typeParam TData - The type of the container's root data store, exposed via {@link FluidContainer.data}.\n * @privateRemarks\n * This will likely end up needing many of IFluidContainer's APIs, like disconnect, connectionState, events etc.\n * Before adding them though, care should be taken to consider if they can be improved or simplified.\n * For example maybe a single status enum for `detached -> attaching -> dirty -> saved -> closed` would be good.\n * Or maybe `detached -> attaching -> attached -> closed` and a timer for how long since the last unsaved change was created.\n *\n * The underlying IContainer has a lifecycle which includes both a closed and disposed state.\n * This should be avoidable: the closed but not disposed state exists so its possible to read out some state at that time.\n * We have made the close remove all the timers, so the the dispose step should be unnecessary and we can just have a single closed state.\n *\n * @sealed\n * @alpha\n */\nexport interface FluidContainer<TData = unknown>\n\textends DataStoreCreator,\n\t\tErasedBaseType<readonly [\"FluidContainer\", TData]> {\n\t/**\n\t * The unique identifier for this container within its service.\n\t * @remarks\n\t * `undefined` if the container has not yet been attached to a service.\n\t * This can be used to load another instance of this container from the service using {@link ServiceClient.loadContainer}.\n\t */\n\treadonly id?: string | undefined;\n\n\t/**\n\t * The root data store of the container.\n\t * @remarks\n\t * The type of the root data store is defined by the {@link DataStoreKind} used to create the container.\n\t */\n\treadonly data: TData;\n\n\t/**\n\t * Close the container, stopping all networking and cancelling runtime timers.\n\t *\n\t * @remarks\n\t * After calling `close()`, the container's data can still be read but no further operations can be sent.\n\t * @privateRemarks\n\t * TODO: we should document the what the expected behavior is if one tries to modify the data after close, or tries to call close multiple times.\n\t * TODO: we also likely want to have a way to detect if closed and events for on close.\n\t * TODO: ensure this truly closes all timers: it seems like we might still leak some related to the summarizer.\n\t * TODO: we should clarify how this interacts with unsaved content including inprogress summaries,\n\t * and likely also provide an async API with some options for how to handle that.\n\t */\n\tclose(): void;\n}\n\n/**\n * A Fluid container with an associated {@link ServiceClient} it can attach to.\n * @typeParam TData - The type of the container's root data store.\n * @sealed\n * @alpha\n */\nexport interface FluidContainerWithService<TData = unknown> extends FluidContainer<TData> {\n\t/**\n\t * Attaches this container to the associated service client.\n\t *\n\t * The returned promise resolves once the container is attached: the container from the promise is the same one passed in as the argument.\n\t */\n\tattach(): Promise<FluidContainerAttached<TData>>;\n\n\t// This could expose access to the ServiceClient if needed.\n}\n\n/**\n * A Fluid container that has been attached to a service.\n * @typeParam TData - The type of the container's root data store.\n * @sealed\n * @alpha\n */\nexport interface FluidContainerAttached<TData = unknown> extends FluidContainer<TData> {\n\t/**\n\t * {@inheritdoc FluidContainer.id}\n\t */\n\treadonly id: string;\n}\n\n/**\n * Defines a {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind} of data store, allowing creating and loading instances of it.\n * @remarks\n * A `DataStoreKind` acts as the factory and type descriptor for a category of data store:\n * it defines the `type` used to identify the data store in a {@link DataStoreRegistry},\n * and the `T` API surface that instances of that data store expose.\n *\n * Provide a `DataStoreKind` to {@link ServiceClient.(createContainer:1)} or {@link DataStoreCreator.createDataStore}\n * to create new instances, and to {@link ServiceClient.loadContainer} to load existing ones.\n *\n * A `DataStoreKind` is not constructed directly.\n * Instead, obtain one from a framework-provided factory:\n * use {@link @fluidframework/shared-object-base#defineDataStore} to define a data store which wraps a root shared object,\n * or use a more specific wrapper around that,\n * such as {@link @fluidframework/tree#defineTreeDataStore} for a {@link @fluidframework/tree#TreeView}-backed data store.\n *\n * Since it implements {@link DataStoreKey}, a `DataStoreKind` can also be used directly as the key to look\n * itself up in a {@link Registry}.\n * @typeParam T - The API surface that instances of this data store kind expose.\n * @privateRemarks\n * TODO:\n * SharedObjects should be usable as these (though putting shared objects directly in the container might need special logic).\n * Type erased {@link IFluidDataStoreFactory}.\n * @sealed\n * @alpha\n */\nexport interface DataStoreKind<out T = unknown>\n\textends DataStoreKey<T>,\n\t\tErasedBaseType<readonly [\"DataStoreKind\", T]> {}\n\n/**\n * A registry of {@link DataStoreKind}s.\n * @privateRemarks\n * TODO: unify this with SharedObjectRegistry.\n *\n * @typeParam T - The type covering all {@link DataStoreKind}s in the registry.\n * @input\n * @alpha\n */\nexport type DataStoreRegistry<out T = unknown> = Registry<Promise<DataStoreKind<T>>>;\n\n/**\n * A connection to a Fluid storage service.\n * @sealed\n * @alpha\n */\nexport interface ServiceClient {\n\t/**\n\t * Creates a detached container associated with this service client.\n\t * @typeParam T - The type of the container's root data store, as defined by `root`.\n\t * @param root - A {@link DataStoreKind} to use for the root.\n\t * @remarks\n\t * This overload is a shorthand for a simple case of {@link ServiceClient.(createContainer:2)}\n\t * where a single item registry is produced which contains only the root.\n\t * This is usable only when the root {@link DataStoreKind} is available eagerly (e.g. not lazy loaded),\n\t * and when the container does not need a registry for creating additional data stores beyond the root.\n\t * @privateRemarks\n\t * TODO: As this is a detached container, it should be able to be created synchronously.\n\t *\n\t * TODO: Provide more general alternative to this in the form of a service-independent `createContainer` free function.\n\t * It would work with a `ServiceClient.attachContainer<T>(detached: FluidContainer<T>): Promise<FluidContainerAttached<T>>`\n\t * which returns a promise that resolves once the detached container has been attached\n\t * (pointing to the same container object, but with the new type).\n\t *\n\t * Challenges:\n\t *\n\t * Currently the service must be provided at creation time because `IContainer.attach` does not accept a service client,\n\t * making it unclear whether a truly service-independent path is feasible in the near term.\n\t */\n\tcreateContainer<T>(root: DataStoreKind<T>): Promise<FluidContainerWithService<T>>;\n\n\t/**\n\t * Creates a detached container associated with this service client.\n\t * @typeParam T - The type of the container's root data store, as defined by `root`.\n\t * @param root - A {@link DataStoreKey} used to look up the root's {@link DataStoreKind} from `registry`.\n\t * @param registry - The {@link DataStoreRegistry} supplying the {@link DataStoreKind} for the root and any other data stores the container may need to create.\n\t * @remarks\n\t * Use this overload when the root {@link DataStoreKind} is not available eagerly (e.g. for lazy loading),\n\t * or when the container needs a registry for creating additional data stores beyond the root.\n\t */\n\tcreateContainer<T>(\n\t\troot: DataStoreKey<T>,\n\t\tregistry: DataStoreRegistry,\n\t): Promise<FluidContainerWithService<T>>;\n\n\t/**\n\t * A shorthand for {@link ServiceClient.(createContainer:1)} followed by {@link FluidContainerWithService.attach}.\n\t * @remarks\n\t * Due to current implementation limitations making container creation async and service specific,\n\t * creating then attaching one is a bit verbose with two awaits that are messy to include inline.\n\t * This provides a convenient way to create and attach a container in a single step.\n\t * @privateRemarks\n\t * TODO: We should fix ergonomics issues that make this helpful,\n\t * then remove (or deprecate) this method in favor of `service.attach(createContainer(root))` as a better orthogonalized API.\n\t * See private remarks on {@link ServiceClient.(createContainer:1)}.\n\t */\n\tcreateAttachedContainer<T>(root: DataStoreKind<T>): Promise<FluidContainerAttached<T>>;\n\n\t/**\n\t * A shorthand for {@link ServiceClient.(createContainer:2)} followed by {@link FluidContainerWithService.attach}.\n\t * @remarks\n\t * Due to current implementation limitations making container creation async and service specific,\n\t * creating then attaching one is a bit verbose with two awaits that are messy to include inline.\n\t * This provides a convenient way to create and attach a container in a single step.\n\t */\n\tcreateAttachedContainer<T>(\n\t\troot: DataStoreKey<T>,\n\t\tregistry: DataStoreRegistry,\n\t): Promise<FluidContainerAttached<T>>;\n\n\t/**\n\t * Loads an existing container from the service.\n\t * @typeParam T - The type of the container's root data store.\n\t * @param id - The unique identifier of the container to load.\n\t * @param root - The {@link DataStoreKind} for the root, or a registry which will be used to look up the root based on its type.\n\t *\n\t * @throws a {@link @fluidframework/telemetry-utils#UsageError} if the DataStoreKind's type (either the root directly or looked up from the registry) does not match the type of the root data store in the container.\n\t *\n\t * @privateRemarks\n\t * The ability to provide a registry here means that it's possible to:\n\t * 1. Load a container which might have a few different possible roots, for example because of versioning.\n\t * 2. Generate the DataStoreKind on demand based on the type: this approach could be used for things like debug tools which can load any possible container.\n\t * 3. Generating the DataStoreKind if the type is unrecognized, for example to provide a placeholder which might support some minimal functionality (like debug inspection, and summary).\n\t *\n\t * The ability to provide just a single DataStoreKind<T> is purely a convenience to make it cleaner to use this in simple cases.\n\t */\n\tloadContainer<T>(\n\t\tid: string,\n\t\troot: DataStoreKind<T> | DataStoreRegistry<T>,\n\t): Promise<FluidContainerAttached<T>>;\n}\n\n// #endregion\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-definitions",
|
|
3
|
-
"version": "2.116.
|
|
3
|
+
"version": "2.116.1",
|
|
4
4
|
"description": "Fluid driver definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
"main": "lib/index.js",
|
|
48
48
|
"types": "lib/public.d.ts",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@fluidframework/core-interfaces": "2.116.
|
|
50
|
+
"@fluidframework/core-interfaces": "~2.116.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@arethetypeswrong/cli": "^0.18.
|
|
53
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
54
54
|
"@biomejs/biome": "~2.4.5",
|
|
55
|
-
"@fluid-tools/build-cli": "^0.
|
|
55
|
+
"@fluid-tools/build-cli": "^0.67.0",
|
|
56
56
|
"@fluidframework/build-common": "^2.0.3",
|
|
57
|
-
"@fluidframework/build-tools": "^0.
|
|
58
|
-
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.
|
|
59
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
57
|
+
"@fluidframework/build-tools": "^0.67.0",
|
|
58
|
+
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.116.0",
|
|
59
|
+
"@fluidframework/eslint-config-fluid": "^14.0.0",
|
|
60
60
|
"@microsoft/api-extractor": "7.58.1",
|
|
61
61
|
"concurrently": "^10.0.3",
|
|
62
62
|
"copyfiles": "^2.4.1",
|
package/src/index.ts
CHANGED
package/src/serviceClient.ts
CHANGED
|
@@ -117,20 +117,21 @@ export function createBasicRegistryKey<T>(type: string): RegistryKey<T, T> {
|
|
|
117
117
|
// #region ServiceClient types
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
* Oldest
|
|
120
|
+
* Oldest Fluid Framework client version that must be able to open and process documents written
|
|
121
|
+
* by a service client.
|
|
121
122
|
* @remarks
|
|
122
123
|
* A string in SemVer format indicating a specific version of the Fluid Framework client package, or the special case of {@link @fluidframework/runtime-utils#defaultMinVersionForCollab}.
|
|
123
124
|
*
|
|
124
|
-
*
|
|
125
|
-
* to the
|
|
125
|
+
* Service clients use this value to select write formats and features. Clients using this version
|
|
126
|
+
* or newer must be able to open and process documents written by the service client. Choosing an
|
|
127
|
+
* older version may limit the features and write formats the application can use to those
|
|
128
|
+
* supported by that version.
|
|
126
129
|
*
|
|
127
130
|
* Cannot exceed the version of any Fluid Framework client package in use by the local client.
|
|
128
131
|
*
|
|
129
|
-
* The higher the version specified, the more features and optimizations will be enabled. *
|
|
130
132
|
* @privateRemarks
|
|
131
|
-
* This is similar to, and a subset of, the `
|
|
133
|
+
* This is similar to, and a subset of, the `OldestSupportedClientVersion` type in `@fluidframework/runtime-definitions`.
|
|
132
134
|
* This differs in that:
|
|
133
|
-
* - This avoids the shorthand "collab" to instead align with our preferred whole word naming convention.
|
|
134
135
|
* - This is `alpha` instead of `public`.
|
|
135
136
|
* - This is available to drivers due to its location in `driver-definitions` instead of `runtime-definitions`.
|
|
136
137
|
* - This does not allow requesting collaboration with pre-2.0.0 versions, including the special case of `2.0.0-defaults`.
|
|
@@ -140,18 +141,19 @@ export function createBasicRegistryKey<T>(type: string): RegistryKey<T, T> {
|
|
|
140
141
|
* @input
|
|
141
142
|
* @alpha
|
|
142
143
|
*/
|
|
143
|
-
export type
|
|
144
|
+
export type OldestSupportedServiceClientVersion = `2.${bigint}.0`;
|
|
144
145
|
|
|
145
146
|
/**
|
|
146
147
|
* Strips patch and prerelease from a SemVer string, returning only the major and minor version.
|
|
147
148
|
* @remarks
|
|
148
|
-
* This formats a version in the same style used by {@link
|
|
149
|
+
* This formats a version in the same style used by {@link OldestSupportedServiceClientVersion}, specifying only the major and minor versions,
|
|
149
150
|
* which are the portions used for feature selection.
|
|
150
151
|
* @typeParam major - The major version number of `version` as a string, preserved in the result type.
|
|
151
152
|
* @typeParam minor - The minor version number of `version` as a string, preserved in the result type.
|
|
152
153
|
* @privateRemarks
|
|
153
154
|
* This fills a similar role as cleanedPackageVersion in `@fluidframework/runtime-utils`.
|
|
154
|
-
* It can be used to workaround our generated pkgVersion values being invalid
|
|
155
|
+
* It can be used to workaround our generated pkgVersion values being invalid
|
|
156
|
+
* `OldestSupportedServiceClientVersion` on CI due to prerelease or patched release branches.
|
|
155
157
|
* @alpha
|
|
156
158
|
*/
|
|
157
159
|
export function featureVersion<major extends `${bigint}`, minor extends `${bigint}`>(
|
|
@@ -175,7 +177,17 @@ export function featureVersion<major extends `${bigint}`, minor extends `${bigin
|
|
|
175
177
|
* @alpha
|
|
176
178
|
*/
|
|
177
179
|
export interface ServiceOptions {
|
|
178
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Oldest Fluid Framework client version that must be able to open and process documents written
|
|
182
|
+
* by the service client.
|
|
183
|
+
*
|
|
184
|
+
* @remarks
|
|
185
|
+
* Choosing an older version may limit the features and write formats the application can use to
|
|
186
|
+
* those supported by that version.
|
|
187
|
+
*
|
|
188
|
+
* A service may provide a default when this option is omitted.
|
|
189
|
+
*/
|
|
190
|
+
readonly oldestSupportedClient?: OldestSupportedServiceClientVersion;
|
|
179
191
|
}
|
|
180
192
|
|
|
181
193
|
/**
|