@fluidframework/driver-definitions 2.42.0 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/storage.d.ts +6 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js.map +1 -1
- package/lib/storage.d.ts +6 -0
- package/lib/storage.d.ts.map +1 -1
- package/lib/storage.js.map +1 -1
- package/package.json +5 -5
- package/src/storage.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @fluidframework/driver-definitions
|
|
2
2
|
|
|
3
|
+
## 2.43.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- The reason parameter on the disconnect event is now optional to allow for clean, non-error disconnections ([#24840](https://github.com/microsoft/FluidFramework/pull/24840)) [82a1c5a1362](https://github.com/microsoft/FluidFramework/commit/82a1c5a1362d3362886bdcc12859ce60a2744bdb)
|
|
8
|
+
|
|
9
|
+
To enable better handling of intentional disconnects (for example [`Container.dispose()`](https://fluidframework.com/docs/api/container-loader/container/dispose)), the `reason` parameter of the `disconnect` event on [`IDocumentDeltaConnectionEvents`](https://fluidframework.com/docs/api/driver-definitions/idocumentdeltaconnectionevents) is being deprecated as a required parameter.
|
|
10
|
+
|
|
11
|
+
In a future release, the `reason` parameter will become optional.
|
|
12
|
+
|
|
13
|
+
**Old signature:**
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
listener: (reason: IAnyDriverError) => void
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**New signature:**
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
listener: (reason?: IAnyDriverError) => void
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Developers with listeners for the `disconnect` event should update their implementations to handle cases where the `reason` parameter is `undefined`.
|
|
26
|
+
This indicates a clean disconnect, which should not be treated as an error.
|
|
27
|
+
|
|
28
|
+
The breaking change is scheduled to be released in version **2.60**.
|
|
29
|
+
|
|
3
30
|
## 2.42.0
|
|
4
31
|
|
|
5
32
|
Dependency updates only.
|
package/dist/storage.d.ts
CHANGED
|
@@ -178,6 +178,12 @@ export interface IDocumentServiceEvents extends IEvent {
|
|
|
178
178
|
*/
|
|
179
179
|
export interface IDocumentDeltaConnectionEvents extends IErrorEvent {
|
|
180
180
|
(event: "nack", listener: (documentId: string, message: INack[]) => void): any;
|
|
181
|
+
/**
|
|
182
|
+
* @param reason - The reason for the disconnection.
|
|
183
|
+
* Note: this parameter will become optional in a future release to support clean disconnections.
|
|
184
|
+
* Signature will change from `(reason: IAnyDriverError) => void` to `(reason?: IAnyDriverError) => void`.
|
|
185
|
+
* Update your listener implementations to handle cases where `reason` is undefined.
|
|
186
|
+
*/
|
|
181
187
|
(event: "disconnect", listener: (reason: IAnyDriverError) => void): any;
|
|
182
188
|
(event: "op", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void): any;
|
|
183
189
|
(event: "signal", listener: (message: ISignalMessage | ISignalMessage[]) => void): any;
|
package/dist/storage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EACX,cAAc,EACd,OAAO,EACP,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,EACL,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CA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BAAqB;IACrC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B"}
|
package/dist/storage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyUH;;;GAGG;AACH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC9B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACT,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B;AAgID;;;GAGG;AACH,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACpB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDisposable,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n\nimport type { IAnyDriverError } from \"./driverError.js\";\nimport type {\n\tConnectionMode,\n\tIClient,\n\tIClientConfiguration,\n\tICreateBlobResponse,\n\tIDocumentMessage,\n\tINack,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tITokenClaims,\n\tIVersion,\n} from \"./protocol/index.js\";\nimport type { IResolvedUrl } from \"./urlResolver.js\";\n\n/**\n * @internal\n */\nexport interface IDeltasFetchResult {\n\t/**\n\t * Sequential set of messages starting from 'from' sequence number.\n\t * May be partial result, i.e. not fulfill original request in full.\n\t */\n\tmessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * If true, storage only partially fulfilled request, but has more ops\n\t * If false, the request was fulfilled. If less ops were returned then\n\t * requested, then storage does not have more ops in this range.\n\t */\n\tpartialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @internal\n */\nexport interface IDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the inclusive sequence number range\n\t * @param tenantId - Id of the tenant.\n\t * @param id - document id.\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tget(\n\t\ttenantId: string,\n\t\tid: string,\n\t\tfrom: number, // inclusive\n\t\tto: number, // exclusive\n\t\tfetchReason?: string,\n\t): Promise<IDeltasFetchResult>;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type IStreamResult<T> = { done: true } | { done: false; value: T };\n\n/**\n * Read interface for the Queue\n * @legacy\n * @alpha\n */\nexport interface IStream<T> {\n\tread(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the exclusive sequence number range\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param abortSignal - signal that aborts operation\n\t * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t\tfetchReason?: string,\n\t): IStream<ISequencedDocumentMessage[]>;\n}\n\n// DO NOT INCREASE THIS TYPE'S VALUE\n// If a driver started using a larger value,\n// internal assumptions of the Runtime's GC feature will be violated\n// DO NOT INCREASE THIS TYPE'S VALUE\n/**\n * @legacy\n * @alpha\n */\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\n/**\n * Policies describing attributes or characteristics of the driver's storage service,\n * to direct how other components interact with the driver\n * @legacy\n * @alpha\n */\nexport interface IDocumentStorageServicePolicies {\n\t/**\n\t * Should the Loader implement any sort of pre-fetching or caching mechanism?\n\t */\n\treadonly caching?: LoaderCachingPolicy;\n\n\t/**\n\t * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used\n\t * in applications where Garbage Collection is enabled. Otherwise data loss may occur.\n\t *\n\t * This policy pertains to requests for the latest snapshot from the service.\n\t * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.\n\t * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n\t */\n\treadonly maximumCacheDurationMs?: FiveDaysMs;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n * @legacy\n * @alpha\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies | undefined;\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from\n\t * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.\n\t * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the\n\t * driver when fetching the snapshot.\n\t */\n\tgetSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\n/**\n * Events emitted by {@link IDocumentService}.\n * @legacy\n * @alpha\n */\nexport interface IDocumentServiceEvents extends IEvent {\n\t/**\n\t * This event is used to communicate any metadata related to the container. We might have received metadata from the service.\n\t * Read more info on this event from here `IContainer.containerMetadata`.\n\t */\n\t(event: \"metadataUpdate\", listener: (metadata: Record<string, string>) => void);\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n\t(event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n\t(event: \"disconnect\", listener: (reason: IAnyDriverError) => void);\n\t(event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n\t(event: \"signal\", listener: (message: ISignalMessage | ISignalMessage[]) => void);\n\t(event: \"pong\", listener: (latency: number) => void);\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(event: \"error\", listener: (error: any) => void);\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaConnection\n\textends IDisposable,\n\t\tIEventProvider<IDocumentDeltaConnectionEvents> {\n\t/**\n\t * ClientID for the connection\n\t */\n\tclientId: string;\n\n\t/**\n\t * Claims for the client\n\t */\n\tclaims: ITokenClaims;\n\n\t/**\n\t * Mode of the client\n\t */\n\tmode: ConnectionMode;\n\n\t/**\n\t * Whether the connection was made to a new or existing document\n\t */\n\texisting: boolean;\n\n\t/**\n\t * Protocol version being used with the service\n\t */\n\tversion: string;\n\n\t/**\n\t * Messages sent during the connection\n\t */\n\tinitialMessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * Signals sent during the connection\n\t */\n\tinitialSignals: ISignalMessage[];\n\n\t/**\n\t * Prior clients already connected.\n\t */\n\tinitialClients: ISignalClient[];\n\n\t/**\n\t * Configuration details provided by the service\n\t */\n\tserviceConfiguration: IClientConfiguration;\n\n\t/**\n\t * Last known sequence number to ordering service at the time of connection\n\t * It may lap actual last sequence number (quite a bit, if container is very active).\n\t * But it's best information for client to figure out how far it is behind, at least\n\t * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n\t * that is likely to be more up-to-date.\n\t */\n\tcheckpointSequenceNumber?: number;\n\n\t/**\n\t * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n\t * it could contain info like build version, environment, region etc. These properties can be logged by client\n\t * to better understand server environment etc. and use it in case error occurs.\n\t * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n\t */\n\trelayServiceAgent?: string;\n\n\t/**\n\t * Submit a new message to the server\n\t */\n\tsubmit(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Submits a new signal to the server\n\t *\n\t * @privateRemarks\n\t * UnknownShouldBe<string> can be string if {@link IDocumentServiceFactory} becomes internal.\n\t */\n\tsubmitSignal: (content: string, targetClientId?: string) => void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport enum LoaderCachingPolicy {\n\t/**\n\t * The loader should not implement any prefetching or caching policy.\n\t */\n\tNoCaching,\n\n\t/**\n\t * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n\t */\n\tPrefetch,\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentServicePolicies {\n\t/**\n\t * Do not connect to delta stream\n\t */\n\treadonly storageOnly?: boolean;\n\n\t/**\n\t * Summarizer uploads the protocol tree too when summarizing.\n\t */\n\treadonly summarizeProtocolTree?: boolean;\n\n\t/**\n\t * Whether the driver supports the new getSnapshot api which returns snapshot which\n\t * contains all contents along with the snapshot tree. Enable this by default when the\n\t * driver can fully support the api.\n\t */\n\treadonly supportGetSnapshotApi?: boolean;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentService extends IEventProvider<IDocumentServiceEvents> {\n\tresolvedUrl: IResolvedUrl;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\tpolicies?: IDocumentServicePolicies;\n\n\t/**\n\t * Access to storage associated with the document\n\t */\n\tconnectToStorage(): Promise<IDocumentStorageService>;\n\n\t/**\n\t * Access to delta storage associated with the document\n\t */\n\tconnectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n\t/**\n\t * Subscribes to the document delta stream\n\t */\n\tconnectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n\t/**\n\t * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n\t * Useful for storage to commit any pending state if any (including any local caching).\n\t * Please note that it does not remove the need for caller to close all active delta connections,\n\t * as storage may not be tracking such objects.\n\t * @param error - tells if container (and storage) are closed due to critical error.\n\t * Error might be due to disconnect between client & server knowledge about file, like file being overwritten\n\t * in storage, but client having stale local cache.\n\t * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdispose(error?: any): void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentServiceFactory {\n\t/**\n\t * Creates the document service after extracting different endpoints URLs from a resolved URL.\n\t *\n\t * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t *\n\t * @returns An instance of {@link IDocumentService}.\n\t */\n\tcreateDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n\n\t/**\n\t * Creates a new document with the provided options. Returns the document service.\n\t *\n\t * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n\t * should be posted later, before connecting to ordering service.\n\t * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t */\n\tcreateContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n * @legacy\n * @alpha\n */\nexport interface ISummaryContext {\n\t/**\n\t * Parent summary proposed handle (from summary op)\n\t */\n\treadonly proposalHandle: string | undefined;\n\n\t/**\n\t * Parent summary acked handle (from summary ack)\n\t */\n\treadonly ackHandle: string | undefined;\n\n\treadonly referenceSequenceNumber: number;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport enum FetchSource {\n\tdefault = \"default\",\n\tnoCache = \"noCache\",\n}\n\n/**\n * A \"Full\" container Snapshot, including ISnapshotTree, blobs and outstanding ops (and other metadata)\n *\n * @legacy\n * @alpha\n */\nexport interface ISnapshot {\n\tsnapshotTree: ISnapshotTree;\n\tblobContents: Map<string, ArrayBuffer>;\n\tops: ISequencedDocumentMessage[];\n\n\t/**\n\t * Sequence number of the snapshot\n\t */\n\tsequenceNumber: number | undefined;\n\n\t/**\n\t * Sequence number for the latest op/snapshot for the file in ODSP\n\t */\n\tlatestSequenceNumber: number | undefined;\n\n\tsnapshotFormatV: 1;\n}\n\n/**\n * Snapshot fetch options which are used to communicate different things to the driver\n * when fetching the snapshot.\n * @legacy\n * @alpha\n */\nexport interface ISnapshotFetchOptions {\n\t/**\n\t * Indicates scenario in which the snapshot is fetched. It is a free form string mostly\n\t * used for telemetry purposes.\n\t */\n\tscenarioName?: string;\n\t/**\n\t * Tell driver to cache the fetched snapshot. Driver is supposed to cache the fetched snapshot if this is\n\t * set to true. If undefined, then it is upto the driver, to cache it or not.\n\t */\n\tcacheSnapshot?: boolean;\n\n\t/**\n\t * Version of the snapshot to be fetched. Certain storage services just keep 1 snapshot for the\n\t * container, so specifying version is not necessary for storage services.\n\t */\n\tversionId?: string;\n\n\t/**\n\t * List of loading groupId of datastores for which the snapshot needs to be fetched. If not provided, content with\n\t * default/missing groupIDs will be requested from the service. It is upto the service, to include snapshot for\n\t * content with groupIds or not. Don't provide anything here for fetching content for initial container boot.\n\t */\n\tloadingGroupIds?: string[];\n\n\t/**\n\t * Specify if you want default behavior of the driver to fetch the snapshot like lets say simultaneously fetch from\n\t * network and cache or specify FetchSource.noCache to just fetch from network.\n\t */\n\tfetchSource?: FetchSource;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+UH;;;GAGG;AACH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC9B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACT,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B;AAgID;;;GAGG;AACH,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACpB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDisposable,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n\nimport type { IAnyDriverError } from \"./driverError.js\";\nimport type {\n\tConnectionMode,\n\tIClient,\n\tIClientConfiguration,\n\tICreateBlobResponse,\n\tIDocumentMessage,\n\tINack,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tITokenClaims,\n\tIVersion,\n} from \"./protocol/index.js\";\nimport type { IResolvedUrl } from \"./urlResolver.js\";\n\n/**\n * @internal\n */\nexport interface IDeltasFetchResult {\n\t/**\n\t * Sequential set of messages starting from 'from' sequence number.\n\t * May be partial result, i.e. not fulfill original request in full.\n\t */\n\tmessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * If true, storage only partially fulfilled request, but has more ops\n\t * If false, the request was fulfilled. If less ops were returned then\n\t * requested, then storage does not have more ops in this range.\n\t */\n\tpartialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @internal\n */\nexport interface IDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the inclusive sequence number range\n\t * @param tenantId - Id of the tenant.\n\t * @param id - document id.\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tget(\n\t\ttenantId: string,\n\t\tid: string,\n\t\tfrom: number, // inclusive\n\t\tto: number, // exclusive\n\t\tfetchReason?: string,\n\t): Promise<IDeltasFetchResult>;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type IStreamResult<T> = { done: true } | { done: false; value: T };\n\n/**\n * Read interface for the Queue\n * @legacy\n * @alpha\n */\nexport interface IStream<T> {\n\tread(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the exclusive sequence number range\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param abortSignal - signal that aborts operation\n\t * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t\tfetchReason?: string,\n\t): IStream<ISequencedDocumentMessage[]>;\n}\n\n// DO NOT INCREASE THIS TYPE'S VALUE\n// If a driver started using a larger value,\n// internal assumptions of the Runtime's GC feature will be violated\n// DO NOT INCREASE THIS TYPE'S VALUE\n/**\n * @legacy\n * @alpha\n */\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\n/**\n * Policies describing attributes or characteristics of the driver's storage service,\n * to direct how other components interact with the driver\n * @legacy\n * @alpha\n */\nexport interface IDocumentStorageServicePolicies {\n\t/**\n\t * Should the Loader implement any sort of pre-fetching or caching mechanism?\n\t */\n\treadonly caching?: LoaderCachingPolicy;\n\n\t/**\n\t * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used\n\t * in applications where Garbage Collection is enabled. Otherwise data loss may occur.\n\t *\n\t * This policy pertains to requests for the latest snapshot from the service.\n\t * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.\n\t * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n\t */\n\treadonly maximumCacheDurationMs?: FiveDaysMs;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n * @legacy\n * @alpha\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies | undefined;\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from\n\t * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.\n\t * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the\n\t * driver when fetching the snapshot.\n\t */\n\tgetSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\n/**\n * Events emitted by {@link IDocumentService}.\n * @legacy\n * @alpha\n */\nexport interface IDocumentServiceEvents extends IEvent {\n\t/**\n\t * This event is used to communicate any metadata related to the container. We might have received metadata from the service.\n\t * Read more info on this event from here `IContainer.containerMetadata`.\n\t */\n\t(event: \"metadataUpdate\", listener: (metadata: Record<string, string>) => void);\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n\t(event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n\t/**\n\t * @param reason - The reason for the disconnection.\n\t * Note: this parameter will become optional in a future release to support clean disconnections.\n\t * Signature will change from `(reason: IAnyDriverError) => void` to `(reason?: IAnyDriverError) => void`.\n\t * Update your listener implementations to handle cases where `reason` is undefined.\n\t */\n\t(event: \"disconnect\", listener: (reason: IAnyDriverError) => void);\n\t(event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n\t(event: \"signal\", listener: (message: ISignalMessage | ISignalMessage[]) => void);\n\t(event: \"pong\", listener: (latency: number) => void);\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(event: \"error\", listener: (error: any) => void);\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaConnection\n\textends IDisposable,\n\t\tIEventProvider<IDocumentDeltaConnectionEvents> {\n\t/**\n\t * ClientID for the connection\n\t */\n\tclientId: string;\n\n\t/**\n\t * Claims for the client\n\t */\n\tclaims: ITokenClaims;\n\n\t/**\n\t * Mode of the client\n\t */\n\tmode: ConnectionMode;\n\n\t/**\n\t * Whether the connection was made to a new or existing document\n\t */\n\texisting: boolean;\n\n\t/**\n\t * Protocol version being used with the service\n\t */\n\tversion: string;\n\n\t/**\n\t * Messages sent during the connection\n\t */\n\tinitialMessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * Signals sent during the connection\n\t */\n\tinitialSignals: ISignalMessage[];\n\n\t/**\n\t * Prior clients already connected.\n\t */\n\tinitialClients: ISignalClient[];\n\n\t/**\n\t * Configuration details provided by the service\n\t */\n\tserviceConfiguration: IClientConfiguration;\n\n\t/**\n\t * Last known sequence number to ordering service at the time of connection\n\t * It may lap actual last sequence number (quite a bit, if container is very active).\n\t * But it's best information for client to figure out how far it is behind, at least\n\t * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n\t * that is likely to be more up-to-date.\n\t */\n\tcheckpointSequenceNumber?: number;\n\n\t/**\n\t * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n\t * it could contain info like build version, environment, region etc. These properties can be logged by client\n\t * to better understand server environment etc. and use it in case error occurs.\n\t * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n\t */\n\trelayServiceAgent?: string;\n\n\t/**\n\t * Submit a new message to the server\n\t */\n\tsubmit(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Submits a new signal to the server\n\t *\n\t * @privateRemarks\n\t * UnknownShouldBe<string> can be string if {@link IDocumentServiceFactory} becomes internal.\n\t */\n\tsubmitSignal: (content: string, targetClientId?: string) => void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport enum LoaderCachingPolicy {\n\t/**\n\t * The loader should not implement any prefetching or caching policy.\n\t */\n\tNoCaching,\n\n\t/**\n\t * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n\t */\n\tPrefetch,\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentServicePolicies {\n\t/**\n\t * Do not connect to delta stream\n\t */\n\treadonly storageOnly?: boolean;\n\n\t/**\n\t * Summarizer uploads the protocol tree too when summarizing.\n\t */\n\treadonly summarizeProtocolTree?: boolean;\n\n\t/**\n\t * Whether the driver supports the new getSnapshot api which returns snapshot which\n\t * contains all contents along with the snapshot tree. Enable this by default when the\n\t * driver can fully support the api.\n\t */\n\treadonly supportGetSnapshotApi?: boolean;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentService extends IEventProvider<IDocumentServiceEvents> {\n\tresolvedUrl: IResolvedUrl;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\tpolicies?: IDocumentServicePolicies;\n\n\t/**\n\t * Access to storage associated with the document\n\t */\n\tconnectToStorage(): Promise<IDocumentStorageService>;\n\n\t/**\n\t * Access to delta storage associated with the document\n\t */\n\tconnectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n\t/**\n\t * Subscribes to the document delta stream\n\t */\n\tconnectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n\t/**\n\t * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n\t * Useful for storage to commit any pending state if any (including any local caching).\n\t * Please note that it does not remove the need for caller to close all active delta connections,\n\t * as storage may not be tracking such objects.\n\t * @param error - tells if container (and storage) are closed due to critical error.\n\t * Error might be due to disconnect between client & server knowledge about file, like file being overwritten\n\t * in storage, but client having stale local cache.\n\t * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdispose(error?: any): void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentServiceFactory {\n\t/**\n\t * Creates the document service after extracting different endpoints URLs from a resolved URL.\n\t *\n\t * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t *\n\t * @returns An instance of {@link IDocumentService}.\n\t */\n\tcreateDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n\n\t/**\n\t * Creates a new document with the provided options. Returns the document service.\n\t *\n\t * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n\t * should be posted later, before connecting to ordering service.\n\t * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t */\n\tcreateContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n * @legacy\n * @alpha\n */\nexport interface ISummaryContext {\n\t/**\n\t * Parent summary proposed handle (from summary op)\n\t */\n\treadonly proposalHandle: string | undefined;\n\n\t/**\n\t * Parent summary acked handle (from summary ack)\n\t */\n\treadonly ackHandle: string | undefined;\n\n\treadonly referenceSequenceNumber: number;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport enum FetchSource {\n\tdefault = \"default\",\n\tnoCache = \"noCache\",\n}\n\n/**\n * A \"Full\" container Snapshot, including ISnapshotTree, blobs and outstanding ops (and other metadata)\n *\n * @legacy\n * @alpha\n */\nexport interface ISnapshot {\n\tsnapshotTree: ISnapshotTree;\n\tblobContents: Map<string, ArrayBuffer>;\n\tops: ISequencedDocumentMessage[];\n\n\t/**\n\t * Sequence number of the snapshot\n\t */\n\tsequenceNumber: number | undefined;\n\n\t/**\n\t * Sequence number for the latest op/snapshot for the file in ODSP\n\t */\n\tlatestSequenceNumber: number | undefined;\n\n\tsnapshotFormatV: 1;\n}\n\n/**\n * Snapshot fetch options which are used to communicate different things to the driver\n * when fetching the snapshot.\n * @legacy\n * @alpha\n */\nexport interface ISnapshotFetchOptions {\n\t/**\n\t * Indicates scenario in which the snapshot is fetched. It is a free form string mostly\n\t * used for telemetry purposes.\n\t */\n\tscenarioName?: string;\n\t/**\n\t * Tell driver to cache the fetched snapshot. Driver is supposed to cache the fetched snapshot if this is\n\t * set to true. If undefined, then it is upto the driver, to cache it or not.\n\t */\n\tcacheSnapshot?: boolean;\n\n\t/**\n\t * Version of the snapshot to be fetched. Certain storage services just keep 1 snapshot for the\n\t * container, so specifying version is not necessary for storage services.\n\t */\n\tversionId?: string;\n\n\t/**\n\t * List of loading groupId of datastores for which the snapshot needs to be fetched. If not provided, content with\n\t * default/missing groupIDs will be requested from the service. It is upto the service, to include snapshot for\n\t * content with groupIds or not. Don't provide anything here for fetching content for initial container boot.\n\t */\n\tloadingGroupIds?: string[];\n\n\t/**\n\t * Specify if you want default behavior of the driver to fetch the snapshot like lets say simultaneously fetch from\n\t * network and cache or specify FetchSource.noCache to just fetch from network.\n\t */\n\tfetchSource?: FetchSource;\n}\n"]}
|
package/lib/storage.d.ts
CHANGED
|
@@ -178,6 +178,12 @@ export interface IDocumentServiceEvents extends IEvent {
|
|
|
178
178
|
*/
|
|
179
179
|
export interface IDocumentDeltaConnectionEvents extends IErrorEvent {
|
|
180
180
|
(event: "nack", listener: (documentId: string, message: INack[]) => void): any;
|
|
181
|
+
/**
|
|
182
|
+
* @param reason - The reason for the disconnection.
|
|
183
|
+
* Note: this parameter will become optional in a future release to support clean disconnections.
|
|
184
|
+
* Signature will change from `(reason: IAnyDriverError) => void` to `(reason?: IAnyDriverError) => void`.
|
|
185
|
+
* Update your listener implementations to handle cases where `reason` is undefined.
|
|
186
|
+
*/
|
|
181
187
|
(event: "disconnect", listener: (reason: IAnyDriverError) => void): any;
|
|
182
188
|
(event: "op", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void): any;
|
|
183
189
|
(event: "signal", listener: (message: ISignalMessage | ISignalMessage[]) => void): any;
|
package/lib/storage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EACX,cAAc,EACd,OAAO,EACP,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,EACL,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,QAAQ,EAAE,yBAAyB,EA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C,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B"}
|
package/lib/storage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyUH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC9B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACT,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B;AAgID;;;GAGG;AACH,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACpB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDisposable,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n\nimport type { IAnyDriverError } from \"./driverError.js\";\nimport type {\n\tConnectionMode,\n\tIClient,\n\tIClientConfiguration,\n\tICreateBlobResponse,\n\tIDocumentMessage,\n\tINack,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tITokenClaims,\n\tIVersion,\n} from \"./protocol/index.js\";\nimport type { IResolvedUrl } from \"./urlResolver.js\";\n\n/**\n * @internal\n */\nexport interface IDeltasFetchResult {\n\t/**\n\t * Sequential set of messages starting from 'from' sequence number.\n\t * May be partial result, i.e. not fulfill original request in full.\n\t */\n\tmessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * If true, storage only partially fulfilled request, but has more ops\n\t * If false, the request was fulfilled. If less ops were returned then\n\t * requested, then storage does not have more ops in this range.\n\t */\n\tpartialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @internal\n */\nexport interface IDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the inclusive sequence number range\n\t * @param tenantId - Id of the tenant.\n\t * @param id - document id.\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tget(\n\t\ttenantId: string,\n\t\tid: string,\n\t\tfrom: number, // inclusive\n\t\tto: number, // exclusive\n\t\tfetchReason?: string,\n\t): Promise<IDeltasFetchResult>;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type IStreamResult<T> = { done: true } | { done: false; value: T };\n\n/**\n * Read interface for the Queue\n * @legacy\n * @alpha\n */\nexport interface IStream<T> {\n\tread(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the exclusive sequence number range\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param abortSignal - signal that aborts operation\n\t * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t\tfetchReason?: string,\n\t): IStream<ISequencedDocumentMessage[]>;\n}\n\n// DO NOT INCREASE THIS TYPE'S VALUE\n// If a driver started using a larger value,\n// internal assumptions of the Runtime's GC feature will be violated\n// DO NOT INCREASE THIS TYPE'S VALUE\n/**\n * @legacy\n * @alpha\n */\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\n/**\n * Policies describing attributes or characteristics of the driver's storage service,\n * to direct how other components interact with the driver\n * @legacy\n * @alpha\n */\nexport interface IDocumentStorageServicePolicies {\n\t/**\n\t * Should the Loader implement any sort of pre-fetching or caching mechanism?\n\t */\n\treadonly caching?: LoaderCachingPolicy;\n\n\t/**\n\t * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used\n\t * in applications where Garbage Collection is enabled. Otherwise data loss may occur.\n\t *\n\t * This policy pertains to requests for the latest snapshot from the service.\n\t * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.\n\t * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n\t */\n\treadonly maximumCacheDurationMs?: FiveDaysMs;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n * @legacy\n * @alpha\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies | undefined;\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from\n\t * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.\n\t * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the\n\t * driver when fetching the snapshot.\n\t */\n\tgetSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\n/**\n * Events emitted by {@link IDocumentService}.\n * @legacy\n * @alpha\n */\nexport interface IDocumentServiceEvents extends IEvent {\n\t/**\n\t * This event is used to communicate any metadata related to the container. We might have received metadata from the service.\n\t * Read more info on this event from here `IContainer.containerMetadata`.\n\t */\n\t(event: \"metadataUpdate\", listener: (metadata: Record<string, string>) => void);\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n\t(event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n\t(event: \"disconnect\", listener: (reason: IAnyDriverError) => void);\n\t(event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n\t(event: \"signal\", listener: (message: ISignalMessage | ISignalMessage[]) => void);\n\t(event: \"pong\", listener: (latency: number) => void);\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(event: \"error\", listener: (error: any) => void);\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaConnection\n\textends IDisposable,\n\t\tIEventProvider<IDocumentDeltaConnectionEvents> {\n\t/**\n\t * ClientID for the connection\n\t */\n\tclientId: string;\n\n\t/**\n\t * Claims for the client\n\t */\n\tclaims: ITokenClaims;\n\n\t/**\n\t * Mode of the client\n\t */\n\tmode: ConnectionMode;\n\n\t/**\n\t * Whether the connection was made to a new or existing document\n\t */\n\texisting: boolean;\n\n\t/**\n\t * Protocol version being used with the service\n\t */\n\tversion: string;\n\n\t/**\n\t * Messages sent during the connection\n\t */\n\tinitialMessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * Signals sent during the connection\n\t */\n\tinitialSignals: ISignalMessage[];\n\n\t/**\n\t * Prior clients already connected.\n\t */\n\tinitialClients: ISignalClient[];\n\n\t/**\n\t * Configuration details provided by the service\n\t */\n\tserviceConfiguration: IClientConfiguration;\n\n\t/**\n\t * Last known sequence number to ordering service at the time of connection\n\t * It may lap actual last sequence number (quite a bit, if container is very active).\n\t * But it's best information for client to figure out how far it is behind, at least\n\t * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n\t * that is likely to be more up-to-date.\n\t */\n\tcheckpointSequenceNumber?: number;\n\n\t/**\n\t * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n\t * it could contain info like build version, environment, region etc. These properties can be logged by client\n\t * to better understand server environment etc. and use it in case error occurs.\n\t * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n\t */\n\trelayServiceAgent?: string;\n\n\t/**\n\t * Submit a new message to the server\n\t */\n\tsubmit(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Submits a new signal to the server\n\t *\n\t * @privateRemarks\n\t * UnknownShouldBe<string> can be string if {@link IDocumentServiceFactory} becomes internal.\n\t */\n\tsubmitSignal: (content: string, targetClientId?: string) => void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport enum LoaderCachingPolicy {\n\t/**\n\t * The loader should not implement any prefetching or caching policy.\n\t */\n\tNoCaching,\n\n\t/**\n\t * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n\t */\n\tPrefetch,\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentServicePolicies {\n\t/**\n\t * Do not connect to delta stream\n\t */\n\treadonly storageOnly?: boolean;\n\n\t/**\n\t * Summarizer uploads the protocol tree too when summarizing.\n\t */\n\treadonly summarizeProtocolTree?: boolean;\n\n\t/**\n\t * Whether the driver supports the new getSnapshot api which returns snapshot which\n\t * contains all contents along with the snapshot tree. Enable this by default when the\n\t * driver can fully support the api.\n\t */\n\treadonly supportGetSnapshotApi?: boolean;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentService extends IEventProvider<IDocumentServiceEvents> {\n\tresolvedUrl: IResolvedUrl;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\tpolicies?: IDocumentServicePolicies;\n\n\t/**\n\t * Access to storage associated with the document\n\t */\n\tconnectToStorage(): Promise<IDocumentStorageService>;\n\n\t/**\n\t * Access to delta storage associated with the document\n\t */\n\tconnectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n\t/**\n\t * Subscribes to the document delta stream\n\t */\n\tconnectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n\t/**\n\t * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n\t * Useful for storage to commit any pending state if any (including any local caching).\n\t * Please note that it does not remove the need for caller to close all active delta connections,\n\t * as storage may not be tracking such objects.\n\t * @param error - tells if container (and storage) are closed due to critical error.\n\t * Error might be due to disconnect between client & server knowledge about file, like file being overwritten\n\t * in storage, but client having stale local cache.\n\t * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdispose(error?: any): void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentServiceFactory {\n\t/**\n\t * Creates the document service after extracting different endpoints URLs from a resolved URL.\n\t *\n\t * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t *\n\t * @returns An instance of {@link IDocumentService}.\n\t */\n\tcreateDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n\n\t/**\n\t * Creates a new document with the provided options. Returns the document service.\n\t *\n\t * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n\t * should be posted later, before connecting to ordering service.\n\t * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t */\n\tcreateContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n * @legacy\n * @alpha\n */\nexport interface ISummaryContext {\n\t/**\n\t * Parent summary proposed handle (from summary op)\n\t */\n\treadonly proposalHandle: string | undefined;\n\n\t/**\n\t * Parent summary acked handle (from summary ack)\n\t */\n\treadonly ackHandle: string | undefined;\n\n\treadonly referenceSequenceNumber: number;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport enum FetchSource {\n\tdefault = \"default\",\n\tnoCache = \"noCache\",\n}\n\n/**\n * A \"Full\" container Snapshot, including ISnapshotTree, blobs and outstanding ops (and other metadata)\n *\n * @legacy\n * @alpha\n */\nexport interface ISnapshot {\n\tsnapshotTree: ISnapshotTree;\n\tblobContents: Map<string, ArrayBuffer>;\n\tops: ISequencedDocumentMessage[];\n\n\t/**\n\t * Sequence number of the snapshot\n\t */\n\tsequenceNumber: number | undefined;\n\n\t/**\n\t * Sequence number for the latest op/snapshot for the file in ODSP\n\t */\n\tlatestSequenceNumber: number | undefined;\n\n\tsnapshotFormatV: 1;\n}\n\n/**\n * Snapshot fetch options which are used to communicate different things to the driver\n * when fetching the snapshot.\n * @legacy\n * @alpha\n */\nexport interface ISnapshotFetchOptions {\n\t/**\n\t * Indicates scenario in which the snapshot is fetched. It is a free form string mostly\n\t * used for telemetry purposes.\n\t */\n\tscenarioName?: string;\n\t/**\n\t * Tell driver to cache the fetched snapshot. Driver is supposed to cache the fetched snapshot if this is\n\t * set to true. If undefined, then it is upto the driver, to cache it or not.\n\t */\n\tcacheSnapshot?: boolean;\n\n\t/**\n\t * Version of the snapshot to be fetched. Certain storage services just keep 1 snapshot for the\n\t * container, so specifying version is not necessary for storage services.\n\t */\n\tversionId?: string;\n\n\t/**\n\t * List of loading groupId of datastores for which the snapshot needs to be fetched. If not provided, content with\n\t * default/missing groupIDs will be requested from the service. It is upto the service, to include snapshot for\n\t * content with groupIds or not. Don't provide anything here for fetching content for initial container boot.\n\t */\n\tloadingGroupIds?: string[];\n\n\t/**\n\t * Specify if you want default behavior of the driver to fetch the snapshot like lets say simultaneously fetch from\n\t * network and cache or specify FetchSource.noCache to just fetch from network.\n\t */\n\tfetchSource?: FetchSource;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+UH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC9B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACT,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B;AAgID;;;GAGG;AACH,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACpB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDisposable,\n\tIErrorEvent,\n\tIEvent,\n\tIEventProvider,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\n\nimport type { IAnyDriverError } from \"./driverError.js\";\nimport type {\n\tConnectionMode,\n\tIClient,\n\tIClientConfiguration,\n\tICreateBlobResponse,\n\tIDocumentMessage,\n\tINack,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tITokenClaims,\n\tIVersion,\n} from \"./protocol/index.js\";\nimport type { IResolvedUrl } from \"./urlResolver.js\";\n\n/**\n * @internal\n */\nexport interface IDeltasFetchResult {\n\t/**\n\t * Sequential set of messages starting from 'from' sequence number.\n\t * May be partial result, i.e. not fulfill original request in full.\n\t */\n\tmessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * If true, storage only partially fulfilled request, but has more ops\n\t * If false, the request was fulfilled. If less ops were returned then\n\t * requested, then storage does not have more ops in this range.\n\t */\n\tpartialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @internal\n */\nexport interface IDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the inclusive sequence number range\n\t * @param tenantId - Id of the tenant.\n\t * @param id - document id.\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tget(\n\t\ttenantId: string,\n\t\tid: string,\n\t\tfrom: number, // inclusive\n\t\tto: number, // exclusive\n\t\tfetchReason?: string,\n\t): Promise<IDeltasFetchResult>;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type IStreamResult<T> = { done: true } | { done: false; value: T };\n\n/**\n * Read interface for the Queue\n * @legacy\n * @alpha\n */\nexport interface IStream<T> {\n\tread(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the exclusive sequence number range\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param abortSignal - signal that aborts operation\n\t * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t\tfetchReason?: string,\n\t): IStream<ISequencedDocumentMessage[]>;\n}\n\n// DO NOT INCREASE THIS TYPE'S VALUE\n// If a driver started using a larger value,\n// internal assumptions of the Runtime's GC feature will be violated\n// DO NOT INCREASE THIS TYPE'S VALUE\n/**\n * @legacy\n * @alpha\n */\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\n/**\n * Policies describing attributes or characteristics of the driver's storage service,\n * to direct how other components interact with the driver\n * @legacy\n * @alpha\n */\nexport interface IDocumentStorageServicePolicies {\n\t/**\n\t * Should the Loader implement any sort of pre-fetching or caching mechanism?\n\t */\n\treadonly caching?: LoaderCachingPolicy;\n\n\t/**\n\t * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used\n\t * in applications where Garbage Collection is enabled. Otherwise data loss may occur.\n\t *\n\t * This policy pertains to requests for the latest snapshot from the service.\n\t * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.\n\t * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n\t */\n\treadonly maximumCacheDurationMs?: FiveDaysMs;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n * @legacy\n * @alpha\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies | undefined;\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from\n\t * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.\n\t * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the\n\t * driver when fetching the snapshot.\n\t */\n\tgetSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\n/**\n * Events emitted by {@link IDocumentService}.\n * @legacy\n * @alpha\n */\nexport interface IDocumentServiceEvents extends IEvent {\n\t/**\n\t * This event is used to communicate any metadata related to the container. We might have received metadata from the service.\n\t * Read more info on this event from here `IContainer.containerMetadata`.\n\t */\n\t(event: \"metadataUpdate\", listener: (metadata: Record<string, string>) => void);\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n\t(event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n\t/**\n\t * @param reason - The reason for the disconnection.\n\t * Note: this parameter will become optional in a future release to support clean disconnections.\n\t * Signature will change from `(reason: IAnyDriverError) => void` to `(reason?: IAnyDriverError) => void`.\n\t * Update your listener implementations to handle cases where `reason` is undefined.\n\t */\n\t(event: \"disconnect\", listener: (reason: IAnyDriverError) => void);\n\t(event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n\t(event: \"signal\", listener: (message: ISignalMessage | ISignalMessage[]) => void);\n\t(event: \"pong\", listener: (latency: number) => void);\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(event: \"error\", listener: (error: any) => void);\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentDeltaConnection\n\textends IDisposable,\n\t\tIEventProvider<IDocumentDeltaConnectionEvents> {\n\t/**\n\t * ClientID for the connection\n\t */\n\tclientId: string;\n\n\t/**\n\t * Claims for the client\n\t */\n\tclaims: ITokenClaims;\n\n\t/**\n\t * Mode of the client\n\t */\n\tmode: ConnectionMode;\n\n\t/**\n\t * Whether the connection was made to a new or existing document\n\t */\n\texisting: boolean;\n\n\t/**\n\t * Protocol version being used with the service\n\t */\n\tversion: string;\n\n\t/**\n\t * Messages sent during the connection\n\t */\n\tinitialMessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * Signals sent during the connection\n\t */\n\tinitialSignals: ISignalMessage[];\n\n\t/**\n\t * Prior clients already connected.\n\t */\n\tinitialClients: ISignalClient[];\n\n\t/**\n\t * Configuration details provided by the service\n\t */\n\tserviceConfiguration: IClientConfiguration;\n\n\t/**\n\t * Last known sequence number to ordering service at the time of connection\n\t * It may lap actual last sequence number (quite a bit, if container is very active).\n\t * But it's best information for client to figure out how far it is behind, at least\n\t * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n\t * that is likely to be more up-to-date.\n\t */\n\tcheckpointSequenceNumber?: number;\n\n\t/**\n\t * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n\t * it could contain info like build version, environment, region etc. These properties can be logged by client\n\t * to better understand server environment etc. and use it in case error occurs.\n\t * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n\t */\n\trelayServiceAgent?: string;\n\n\t/**\n\t * Submit a new message to the server\n\t */\n\tsubmit(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Submits a new signal to the server\n\t *\n\t * @privateRemarks\n\t * UnknownShouldBe<string> can be string if {@link IDocumentServiceFactory} becomes internal.\n\t */\n\tsubmitSignal: (content: string, targetClientId?: string) => void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport enum LoaderCachingPolicy {\n\t/**\n\t * The loader should not implement any prefetching or caching policy.\n\t */\n\tNoCaching,\n\n\t/**\n\t * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n\t */\n\tPrefetch,\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentServicePolicies {\n\t/**\n\t * Do not connect to delta stream\n\t */\n\treadonly storageOnly?: boolean;\n\n\t/**\n\t * Summarizer uploads the protocol tree too when summarizing.\n\t */\n\treadonly summarizeProtocolTree?: boolean;\n\n\t/**\n\t * Whether the driver supports the new getSnapshot api which returns snapshot which\n\t * contains all contents along with the snapshot tree. Enable this by default when the\n\t * driver can fully support the api.\n\t */\n\treadonly supportGetSnapshotApi?: boolean;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentService extends IEventProvider<IDocumentServiceEvents> {\n\tresolvedUrl: IResolvedUrl;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\tpolicies?: IDocumentServicePolicies;\n\n\t/**\n\t * Access to storage associated with the document\n\t */\n\tconnectToStorage(): Promise<IDocumentStorageService>;\n\n\t/**\n\t * Access to delta storage associated with the document\n\t */\n\tconnectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n\t/**\n\t * Subscribes to the document delta stream\n\t */\n\tconnectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n\t/**\n\t * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n\t * Useful for storage to commit any pending state if any (including any local caching).\n\t * Please note that it does not remove the need for caller to close all active delta connections,\n\t * as storage may not be tracking such objects.\n\t * @param error - tells if container (and storage) are closed due to critical error.\n\t * Error might be due to disconnect between client & server knowledge about file, like file being overwritten\n\t * in storage, but client having stale local cache.\n\t * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdispose(error?: any): void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDocumentServiceFactory {\n\t/**\n\t * Creates the document service after extracting different endpoints URLs from a resolved URL.\n\t *\n\t * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t *\n\t * @returns An instance of {@link IDocumentService}.\n\t */\n\tcreateDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n\n\t/**\n\t * Creates a new document with the provided options. Returns the document service.\n\t *\n\t * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n\t * should be posted later, before connecting to ordering service.\n\t * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t */\n\tcreateContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n * @legacy\n * @alpha\n */\nexport interface ISummaryContext {\n\t/**\n\t * Parent summary proposed handle (from summary op)\n\t */\n\treadonly proposalHandle: string | undefined;\n\n\t/**\n\t * Parent summary acked handle (from summary ack)\n\t */\n\treadonly ackHandle: string | undefined;\n\n\treadonly referenceSequenceNumber: number;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport enum FetchSource {\n\tdefault = \"default\",\n\tnoCache = \"noCache\",\n}\n\n/**\n * A \"Full\" container Snapshot, including ISnapshotTree, blobs and outstanding ops (and other metadata)\n *\n * @legacy\n * @alpha\n */\nexport interface ISnapshot {\n\tsnapshotTree: ISnapshotTree;\n\tblobContents: Map<string, ArrayBuffer>;\n\tops: ISequencedDocumentMessage[];\n\n\t/**\n\t * Sequence number of the snapshot\n\t */\n\tsequenceNumber: number | undefined;\n\n\t/**\n\t * Sequence number for the latest op/snapshot for the file in ODSP\n\t */\n\tlatestSequenceNumber: number | undefined;\n\n\tsnapshotFormatV: 1;\n}\n\n/**\n * Snapshot fetch options which are used to communicate different things to the driver\n * when fetching the snapshot.\n * @legacy\n * @alpha\n */\nexport interface ISnapshotFetchOptions {\n\t/**\n\t * Indicates scenario in which the snapshot is fetched. It is a free form string mostly\n\t * used for telemetry purposes.\n\t */\n\tscenarioName?: string;\n\t/**\n\t * Tell driver to cache the fetched snapshot. Driver is supposed to cache the fetched snapshot if this is\n\t * set to true. If undefined, then it is upto the driver, to cache it or not.\n\t */\n\tcacheSnapshot?: boolean;\n\n\t/**\n\t * Version of the snapshot to be fetched. Certain storage services just keep 1 snapshot for the\n\t * container, so specifying version is not necessary for storage services.\n\t */\n\tversionId?: string;\n\n\t/**\n\t * List of loading groupId of datastores for which the snapshot needs to be fetched. If not provided, content with\n\t * default/missing groupIDs will be requested from the service. It is upto the service, to include snapshot for\n\t * content with groupIds or not. Don't provide anything here for fetching content for initial container boot.\n\t */\n\tloadingGroupIds?: string[];\n\n\t/**\n\t * Specify if you want default behavior of the driver to fetch the snapshot like lets say simultaneously fetch from\n\t * network and cache or specify FetchSource.noCache to just fetch from network.\n\t */\n\tfetchSource?: FetchSource;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-definitions",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.43.0",
|
|
4
4
|
"description": "Fluid driver definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"main": "lib/index.js",
|
|
48
48
|
"types": "lib/public.d.ts",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@fluidframework/core-interfaces": "~2.
|
|
50
|
+
"@fluidframework/core-interfaces": "~2.43.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
54
54
|
"@biomejs/biome": "~1.9.3",
|
|
55
|
-
"@fluid-tools/build-cli": "^0.
|
|
55
|
+
"@fluid-tools/build-cli": "^0.56.0",
|
|
56
56
|
"@fluidframework/build-common": "^2.0.3",
|
|
57
|
-
"@fluidframework/build-tools": "^0.
|
|
58
|
-
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.
|
|
57
|
+
"@fluidframework/build-tools": "^0.56.0",
|
|
58
|
+
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.42.0",
|
|
59
59
|
"@fluidframework/eslint-config-fluid": "^5.7.4",
|
|
60
60
|
"@microsoft/api-extractor": "7.52.8",
|
|
61
61
|
"concurrently": "^8.2.1",
|
package/src/storage.ts
CHANGED
|
@@ -238,6 +238,12 @@ export interface IDocumentServiceEvents extends IEvent {
|
|
|
238
238
|
*/
|
|
239
239
|
export interface IDocumentDeltaConnectionEvents extends IErrorEvent {
|
|
240
240
|
(event: "nack", listener: (documentId: string, message: INack[]) => void);
|
|
241
|
+
/**
|
|
242
|
+
* @param reason - The reason for the disconnection.
|
|
243
|
+
* Note: this parameter will become optional in a future release to support clean disconnections.
|
|
244
|
+
* Signature will change from `(reason: IAnyDriverError) => void` to `(reason?: IAnyDriverError) => void`.
|
|
245
|
+
* Update your listener implementations to handle cases where `reason` is undefined.
|
|
246
|
+
*/
|
|
241
247
|
(event: "disconnect", listener: (reason: IAnyDriverError) => void);
|
|
242
248
|
(event: "op", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);
|
|
243
249
|
(event: "signal", listener: (message: ISignalMessage | ISignalMessage[]) => void);
|