@fluidframework/driver-definitions 0.47.1000-69949 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-extractor.json +1 -9
- package/dist/driverError.d.ts +4 -4
- package/dist/driverError.js +4 -4
- package/dist/driverError.js.map +1 -1
- package/dist/storage.d.ts +15 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js.map +1 -1
- package/lib/driverError.d.ts +4 -4
- package/lib/driverError.js +4 -4
- package/lib/driverError.js.map +1 -1
- package/lib/storage.d.ts +15 -1
- package/lib/storage.d.ts.map +1 -1
- package/lib/storage.js.map +1 -1
- package/package.json +8 -20
- package/src/driverError.ts +4 -4
- package/src/storage.ts +15 -1
- package/api-report/driver-definitions.api.md +0 -285
package/api-extractor.json
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "@fluidframework/build-common/api-extractor-common-report.json"
|
|
4
|
-
"apiReport": {
|
|
5
|
-
"enabled": true,
|
|
6
|
-
"reportFolder": "<projectFolder>/api-report/"
|
|
7
|
-
},
|
|
8
|
-
"docModel": {
|
|
9
|
-
"enabled": true,
|
|
10
|
-
"apiJsonFilePath": "<projectFolder>/_api-extractor-temp/doc-models/<unscopedPackageName>.api.json"
|
|
11
|
-
}
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-common-report.json"
|
|
12
4
|
}
|
package/dist/driverError.d.ts
CHANGED
|
@@ -39,10 +39,10 @@ export declare enum DriverErrorType {
|
|
|
39
39
|
*/
|
|
40
40
|
writeError = "writeError",
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
43
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
44
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
45
|
+
* CSP violation, etc.
|
|
46
46
|
*/
|
|
47
47
|
fetchFailure = "fetchFailure",
|
|
48
48
|
/**
|
package/dist/driverError.js
CHANGED
|
@@ -46,10 +46,10 @@ var DriverErrorType;
|
|
|
46
46
|
*/
|
|
47
47
|
DriverErrorType["writeError"] = "writeError";
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
49
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
50
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
51
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
52
|
+
* CSP violation, etc.
|
|
53
53
|
*/
|
|
54
54
|
DriverErrorType["fetchFailure"] = "fetchFailure";
|
|
55
55
|
/**
|
package/dist/driverError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;GAGG;AACH,IAAY,eAoEX;AApED,WAAY,eAAe;IACvB;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACF,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;AACtE,CAAC,EApEW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAoE1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n */\nexport enum DriverErrorType {\n /**\n * A fatal error with no specific interpretation covered by other DriverErrorType values\n */\n genericError = \"genericError\",\n\n /**\n * Some non-categorized (below) networking error\n * Include errors like fatal server error (usually 500).\n */\n genericNetworkError = \"genericNetworkError\",\n\n /**\n * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n */\n authorizationError = \"authorizationError\",\n\n /**\n * File not found, or file deleted during session\n */\n fileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * We can not reach server due to computer being offline.\n */\n offlineError = \"offlineError\",\n\n /*\n * Unsupported client protocol\n */\n unsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n /**\n * User does not have write permissions to a file, but is changing content of a file.\n * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n */\n writeError = \"writeError\",\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;GAGG;AACH,IAAY,eAoEX;AApED,WAAY,eAAe;IACvB;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACF,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;AACtE,CAAC,EApEW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAoE1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n */\nexport enum DriverErrorType {\n /**\n * A fatal error with no specific interpretation covered by other DriverErrorType values\n */\n genericError = \"genericError\",\n\n /**\n * Some non-categorized (below) networking error\n * Include errors like fatal server error (usually 500).\n */\n genericNetworkError = \"genericNetworkError\",\n\n /**\n * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n */\n authorizationError = \"authorizationError\",\n\n /**\n * File not found, or file deleted during session\n */\n fileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * We can not reach server due to computer being offline.\n */\n offlineError = \"offlineError\",\n\n /*\n * Unsupported client protocol\n */\n unsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n /**\n * User does not have write permissions to a file, but is changing content of a file.\n * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n */\n writeError = \"writeError\",\n\n /**\n * A generic fetch failure that indicates we were not able to get a response from the server.\n * This may be due to the client being offline (though, if we are able to detect offline state it will be\n * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n * CSP violation, etc.\n */\n fetchFailure = \"fetchFailure\",\n\n /**\n * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n */\n incorrectServerResponse = \"incorrectServerResponse\",\n\n /**\n * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n * and storage / driver / loader detects such mismatch.\n * When it's hit, client needs to forget all the knowlege about this file and start over.\n */\n fileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n /**\n * The document is read-only and delta stream connection is forbidden.\n */\n deltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n /** Classification of what type of error this is, used programmatically by consumers to interpret the error */\n readonly errorType: DriverErrorType;\n /** Free-form error message */\n readonly message: string;\n /** True indicates the caller may retry the failed action. False indicates it's a fatal error */\n canRetry: boolean;\n /**\n * Best guess as to network conditions (online/offline) when the error arose.\n * See OnlineStatus enum in driver-utils package for expected values.\n */\n online?: string;\n}\n\nexport interface IThrottlingWarning extends IDriverErrorBase {\n readonly errorType: DriverErrorType.throttlingError;\n readonly retryAfterSeconds: number;\n}\n\nexport interface IGenericNetworkError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.genericNetworkError;\n readonly statusCode?: number;\n}\n\nexport interface IAuthorizationError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.authorizationError;\n readonly claims?: string;\n readonly tenantId?: string;\n}\n\n/**\n * Having this uber interface without types that have their own interfaces\n * allows compiler to differentiate interfaces based on error type\n */\nexport interface IDriverBasicError extends IDriverErrorBase {\n readonly errorType:\n DriverErrorType.genericError\n | DriverErrorType.fileNotFoundOrAccessDeniedError\n | DriverErrorType.offlineError\n | DriverErrorType.unsupportedClientProtocolVersion\n | DriverErrorType.writeError\n | DriverErrorType.fetchFailure\n | DriverErrorType.incorrectServerResponse\n | DriverErrorType.fileOverwrittenInStorage;\n readonly statusCode?: number;\n}\n\nexport type DriverError =\n | IThrottlingWarning\n | IGenericNetworkError\n | IAuthorizationError\n | IDriverBasicError;\n"]}
|
package/dist/storage.d.ts
CHANGED
|
@@ -231,13 +231,27 @@ export interface IDocumentServiceFactory {
|
|
|
231
231
|
*/
|
|
232
232
|
protocolName: string;
|
|
233
233
|
/**
|
|
234
|
-
*
|
|
234
|
+
* Creates the document service after extracting different endpoints URLs from a resolved URL.
|
|
235
|
+
*
|
|
236
|
+
* @param resolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.
|
|
237
|
+
* @param logger - Optional telemetry logger to which telemetry events will be forwarded.
|
|
238
|
+
* @param clientIsSummarizer - Whether or not the client is the
|
|
239
|
+
* {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
|
|
240
|
+
* `undefined` =\> false
|
|
241
|
+
*
|
|
242
|
+
* @returns An instance of {@link IDocumentService}.
|
|
235
243
|
*/
|
|
236
244
|
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
237
245
|
/**
|
|
238
246
|
* Creates a new document with the provided options. Returns the document service.
|
|
247
|
+
*
|
|
239
248
|
* @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary
|
|
240
249
|
* should be posted later, before connecting to ordering service.
|
|
250
|
+
* @param createNewResolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.
|
|
251
|
+
* @param logger - Optional telemetry logger to which telemetry events will be forwarded.
|
|
252
|
+
* @param clientIsSummarizer - Whether or not the client is the
|
|
253
|
+
* {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
|
|
254
|
+
* `undefined` =\> false
|
|
241
255
|
*/
|
|
242
256
|
createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
243
257
|
}
|
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,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,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,EACX,MAAM,sCAAs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AAO,CAAC,gBAAgB,CAAC,CAAC;IAE7B;;;;;;;;;;OAUG;IACH,eAAe,CACX,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAEvC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC5C"}
|
package/dist/storage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwOH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAU9B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IErrorEvent, ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClient,\n IClientConfiguration,\n ICreateBlobResponse,\n IDocumentMessage,\n INack,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ISnapshotTree,\n ISummaryHandle,\n ISummaryTree,\n ITokenClaims,\n IVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"./urlResolver\";\n\nexport interface IDeltasFetchResult {\n /**\n * Sequential set of messages starting from 'from' sequence number.\n * May be partial result, i.e. not fulfill original request in full.\n */\n messages: ISequencedDocumentMessage[];\n\n /**\n * If true, storage only partially fulfilled request, but has more ops\n * If false, the request was fulfilled. If less ops were returned then\n * requested, then storage does not have more ops in this range.\n */\n partialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDeltaStorageService {\n /**\n * Retrieves all the delta operations within the inclusive sequence number range\n * @param tenantId - Id of the tenant.\n * @param id - document id.\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n get(\n tenantId: string,\n id: string,\n from: number, // inclusive\n to: number, // exclusive\n fetchReason?: string,\n ): Promise<IDeltasFetchResult>;\n}\n\nexport type IStreamResult<T> = { done: true; } | { done: false; value: T; };\n\n/**\n * Read interface for the Queue\n */\n export interface IStream<T> {\n read(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDocumentDeltaStorageService {\n /**\n * Retrieves all the delta operations within the exclusive sequence number range\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param abortSignal - signal that aborts operation\n * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n fetchMessages(from: number,\n to: number | undefined,\n abortSignal?: AbortSignal,\n cachedOnly?: boolean,\n fetchReason?: string,\n ): IStream<ISequencedDocumentMessage[]>;\n}\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\n // If this policy is provided, it tells runtime on ideal size for blobs\n // Blobs that are smaller than that size should be aggregated into bigger blobs\n readonly minBlobSize?: number;\n\n /**\n * This policy tells the runtime that the driver will not use cached snapshots older than this value.\n */\n readonly maximumCacheDurationMs?: number;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n repositoryUrl: string;\n\n /**\n * Policies implemented/instructed by driver.\n */\n readonly policies?: IDocumentStorageServicePolicies;\n\n /**\n * Returns the snapshot tree.\n */\n getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n */\n getVersions(versionId: string | null, count: number): Promise<IVersion[]>;\n\n /**\n * Creates a blob out of the given buffer\n */\n createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n /**\n * Reads the object with the given ID, returns content in arrayBufferLike\n */\n readBlob(id: string): Promise<ArrayBufferLike>;\n\n /**\n * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n * referencing from the previously acked summary.\n * Returns the uploaded summary handle.\n */\n uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n /**\n * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n * server has deleted it this call may result in a broken promise.\n */\n downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n (event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n (event: \"disconnect\", listener: (reason: any) => void);\n (event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n (event: \"signal\", listener: (message: ISignalMessage) => void);\n (event: \"pong\", listener: (latency: number) => void);\n (event: \"error\", listener: (error: any) => void);\n}\n\nexport interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {\n /**\n * ClientID for the connection\n */\n clientId: string;\n\n /**\n * Claims for the client\n */\n claims: ITokenClaims;\n\n /**\n * Mode of the client\n */\n mode: ConnectionMode;\n\n /**\n * Whether the connection was made to a new or existing document\n */\n existing: boolean;\n\n /**\n * Protocol version being used with the service\n */\n version: string;\n\n /**\n * Messages sent during the connection\n */\n initialMessages: ISequencedDocumentMessage[];\n\n /**\n * Signals sent during the connection\n */\n initialSignals: ISignalMessage[];\n\n /**\n * Prior clients already connected.\n */\n initialClients: ISignalClient[];\n\n /**\n * Configuration details provided by the service\n */\n serviceConfiguration: IClientConfiguration;\n\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber?: number;\n\n /**\n * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n * it could contain info like build version, environment, region etc. These properties can be logged by client\n * to better understand server environment etc. and use it in case error occurs.\n * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n */\n relayServiceAgent?: string;\n\n /**\n * Submit a new message to the server\n */\n submit(messages: IDocumentMessage[]): void;\n\n /**\n * Submit a new signal to the server\n */\n submitSignal(message: any): void;\n}\n\nexport enum LoaderCachingPolicy {\n /**\n * The loader should not implement any prefetching or caching policy.\n */\n NoCaching,\n\n /**\n * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n */\n Prefetch,\n}\n\nexport interface IDocumentServicePolicies {\n /**\n * Do not connect to delta stream\n */\n readonly storageOnly?: boolean;\n}\n\nexport interface IDocumentService {\n\n resolvedUrl: IResolvedUrl;\n\n /**\n * Policies implemented/instructed by driver.\n */\n policies?: IDocumentServicePolicies;\n\n /**\n * Access to storage associated with the document...\n */\n connectToStorage(): Promise<IDocumentStorageService>;\n\n /**\n * Access to delta storage associated with the document\n */\n connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n /**\n * Subscribes to the document delta stream\n */\n connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n /**\n * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n * Useful for storage to commit any pending state if any (including any local caching).\n * Please note that it does not remove the need for caller to close all active delta connections,\n * as storage may not be tracking such objects.\n * @param error - tells if container (and storage) are closed due to critical error.\n * Error might be due to disconnect between client & server knowlege about file, like file being overwritten\n * in storage, but client having stale local cache.\n * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n */\n dispose(error?: any): void;\n}\n\nexport interface IDocumentServiceFactory {\n /**\n * Name of the protocol used by factory\n */\n protocolName: string;\n\n /**\n * Returns an instance of IDocumentService\n */\n createDocumentService(\n resolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n\n /**\n * Creates a new document with the provided options. Returns the document service.\n * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n * should be posted later, before connecting to ordering service.\n */\n createContainer(\n createNewSummary: ISummaryTree | undefined,\n createNewResolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n */\nexport interface ISummaryContext {\n /**\n * Parent summary proposed handle (from summary op)\n */\n readonly proposalHandle: string | undefined;\n\n /**\n * Parent summary acked handle (from summary ack)\n */\n readonly ackHandle: string | undefined;\n\n readonly referenceSequenceNumber: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwOH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAU9B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IErrorEvent, ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClient,\n IClientConfiguration,\n ICreateBlobResponse,\n IDocumentMessage,\n INack,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ISnapshotTree,\n ISummaryHandle,\n ISummaryTree,\n ITokenClaims,\n IVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"./urlResolver\";\n\nexport interface IDeltasFetchResult {\n /**\n * Sequential set of messages starting from 'from' sequence number.\n * May be partial result, i.e. not fulfill original request in full.\n */\n messages: ISequencedDocumentMessage[];\n\n /**\n * If true, storage only partially fulfilled request, but has more ops\n * If false, the request was fulfilled. If less ops were returned then\n * requested, then storage does not have more ops in this range.\n */\n partialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDeltaStorageService {\n /**\n * Retrieves all the delta operations within the inclusive sequence number range\n * @param tenantId - Id of the tenant.\n * @param id - document id.\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n get(\n tenantId: string,\n id: string,\n from: number, // inclusive\n to: number, // exclusive\n fetchReason?: string,\n ): Promise<IDeltasFetchResult>;\n}\n\nexport type IStreamResult<T> = { done: true; } | { done: false; value: T; };\n\n/**\n * Read interface for the Queue\n */\n export interface IStream<T> {\n read(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDocumentDeltaStorageService {\n /**\n * Retrieves all the delta operations within the exclusive sequence number range\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param abortSignal - signal that aborts operation\n * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n fetchMessages(from: number,\n to: number | undefined,\n abortSignal?: AbortSignal,\n cachedOnly?: boolean,\n fetchReason?: string,\n ): IStream<ISequencedDocumentMessage[]>;\n}\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\n // If this policy is provided, it tells runtime on ideal size for blobs\n // Blobs that are smaller than that size should be aggregated into bigger blobs\n readonly minBlobSize?: number;\n\n /**\n * This policy tells the runtime that the driver will not use cached snapshots older than this value.\n */\n readonly maximumCacheDurationMs?: number;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n repositoryUrl: string;\n\n /**\n * Policies implemented/instructed by driver.\n */\n readonly policies?: IDocumentStorageServicePolicies;\n\n /**\n * Returns the snapshot tree.\n */\n getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n */\n getVersions(versionId: string | null, count: number): Promise<IVersion[]>;\n\n /**\n * Creates a blob out of the given buffer\n */\n createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n /**\n * Reads the object with the given ID, returns content in arrayBufferLike\n */\n readBlob(id: string): Promise<ArrayBufferLike>;\n\n /**\n * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n * referencing from the previously acked summary.\n * Returns the uploaded summary handle.\n */\n uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n /**\n * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n * server has deleted it this call may result in a broken promise.\n */\n downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n (event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n (event: \"disconnect\", listener: (reason: any) => void);\n (event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n (event: \"signal\", listener: (message: ISignalMessage) => void);\n (event: \"pong\", listener: (latency: number) => void);\n (event: \"error\", listener: (error: any) => void);\n}\n\nexport interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {\n /**\n * ClientID for the connection\n */\n clientId: string;\n\n /**\n * Claims for the client\n */\n claims: ITokenClaims;\n\n /**\n * Mode of the client\n */\n mode: ConnectionMode;\n\n /**\n * Whether the connection was made to a new or existing document\n */\n existing: boolean;\n\n /**\n * Protocol version being used with the service\n */\n version: string;\n\n /**\n * Messages sent during the connection\n */\n initialMessages: ISequencedDocumentMessage[];\n\n /**\n * Signals sent during the connection\n */\n initialSignals: ISignalMessage[];\n\n /**\n * Prior clients already connected.\n */\n initialClients: ISignalClient[];\n\n /**\n * Configuration details provided by the service\n */\n serviceConfiguration: IClientConfiguration;\n\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber?: number;\n\n /**\n * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n * it could contain info like build version, environment, region etc. These properties can be logged by client\n * to better understand server environment etc. and use it in case error occurs.\n * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n */\n relayServiceAgent?: string;\n\n /**\n * Submit a new message to the server\n */\n submit(messages: IDocumentMessage[]): void;\n\n /**\n * Submit a new signal to the server\n */\n submitSignal(message: any): void;\n}\n\nexport enum LoaderCachingPolicy {\n /**\n * The loader should not implement any prefetching or caching policy.\n */\n NoCaching,\n\n /**\n * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n */\n Prefetch,\n}\n\nexport interface IDocumentServicePolicies {\n /**\n * Do not connect to delta stream\n */\n readonly storageOnly?: boolean;\n}\n\nexport interface IDocumentService {\n\n resolvedUrl: IResolvedUrl;\n\n /**\n * Policies implemented/instructed by driver.\n */\n policies?: IDocumentServicePolicies;\n\n /**\n * Access to storage associated with the document...\n */\n connectToStorage(): Promise<IDocumentStorageService>;\n\n /**\n * Access to delta storage associated with the document\n */\n connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n /**\n * Subscribes to the document delta stream\n */\n connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n /**\n * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n * Useful for storage to commit any pending state if any (including any local caching).\n * Please note that it does not remove the need for caller to close all active delta connections,\n * as storage may not be tracking such objects.\n * @param error - tells if container (and storage) are closed due to critical error.\n * Error might be due to disconnect between client & server knowlege about file, like file being overwritten\n * in storage, but client having stale local cache.\n * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n */\n dispose(error?: any): void;\n}\n\nexport interface IDocumentServiceFactory {\n /**\n * Name of the protocol used by factory\n */\n protocolName: string;\n\n /**\n * Creates the document service after extracting different endpoints URLs from a resolved URL.\n *\n * @param resolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.\n * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n * @param clientIsSummarizer - Whether or not the client is the\n * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n * `undefined` =\\> false\n *\n * @returns An instance of {@link IDocumentService}.\n */\n createDocumentService(\n resolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n\n /**\n * Creates a new document with the provided options. Returns the document service.\n *\n * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n * should be posted later, before connecting to ordering service.\n * @param createNewResolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.\n * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n * @param clientIsSummarizer - Whether or not the client is the\n * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n * `undefined` =\\> false\n */\n createContainer(\n createNewSummary: ISummaryTree | undefined,\n createNewResolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n */\nexport interface ISummaryContext {\n /**\n * Parent summary proposed handle (from summary op)\n */\n readonly proposalHandle: string | undefined;\n\n /**\n * Parent summary acked handle (from summary ack)\n */\n readonly ackHandle: string | undefined;\n\n readonly referenceSequenceNumber: number;\n}\n"]}
|
package/lib/driverError.d.ts
CHANGED
|
@@ -39,10 +39,10 @@ export declare enum DriverErrorType {
|
|
|
39
39
|
*/
|
|
40
40
|
writeError = "writeError",
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
43
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
44
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
45
|
+
* CSP violation, etc.
|
|
46
46
|
*/
|
|
47
47
|
fetchFailure = "fetchFailure",
|
|
48
48
|
/**
|
package/lib/driverError.js
CHANGED
|
@@ -43,10 +43,10 @@ export var DriverErrorType;
|
|
|
43
43
|
*/
|
|
44
44
|
DriverErrorType["writeError"] = "writeError";
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
46
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
47
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
48
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
49
|
+
* CSP violation, etc.
|
|
50
50
|
*/
|
|
51
51
|
DriverErrorType["fetchFailure"] = "fetchFailure";
|
|
52
52
|
/**
|
package/lib/driverError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAoEX;AApED,WAAY,eAAe;IACvB;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACF,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;AACtE,CAAC,EApEW,eAAe,KAAf,eAAe,QAoE1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n */\nexport enum DriverErrorType {\n /**\n * A fatal error with no specific interpretation covered by other DriverErrorType values\n */\n genericError = \"genericError\",\n\n /**\n * Some non-categorized (below) networking error\n * Include errors like fatal server error (usually 500).\n */\n genericNetworkError = \"genericNetworkError\",\n\n /**\n * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n */\n authorizationError = \"authorizationError\",\n\n /**\n * File not found, or file deleted during session\n */\n fileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * We can not reach server due to computer being offline.\n */\n offlineError = \"offlineError\",\n\n /*\n * Unsupported client protocol\n */\n unsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n /**\n * User does not have write permissions to a file, but is changing content of a file.\n * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n */\n writeError = \"writeError\",\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAoEX;AApED,WAAY,eAAe;IACvB;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACF,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;AACtE,CAAC,EApEW,eAAe,KAAf,eAAe,QAoE1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n */\nexport enum DriverErrorType {\n /**\n * A fatal error with no specific interpretation covered by other DriverErrorType values\n */\n genericError = \"genericError\",\n\n /**\n * Some non-categorized (below) networking error\n * Include errors like fatal server error (usually 500).\n */\n genericNetworkError = \"genericNetworkError\",\n\n /**\n * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n */\n authorizationError = \"authorizationError\",\n\n /**\n * File not found, or file deleted during session\n */\n fileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * We can not reach server due to computer being offline.\n */\n offlineError = \"offlineError\",\n\n /*\n * Unsupported client protocol\n */\n unsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n /**\n * User does not have write permissions to a file, but is changing content of a file.\n * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n */\n writeError = \"writeError\",\n\n /**\n * A generic fetch failure that indicates we were not able to get a response from the server.\n * This may be due to the client being offline (though, if we are able to detect offline state it will be\n * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n * CSP violation, etc.\n */\n fetchFailure = \"fetchFailure\",\n\n /**\n * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n */\n incorrectServerResponse = \"incorrectServerResponse\",\n\n /**\n * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n * and storage / driver / loader detects such mismatch.\n * When it's hit, client needs to forget all the knowlege about this file and start over.\n */\n fileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n /**\n * The document is read-only and delta stream connection is forbidden.\n */\n deltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n /** Classification of what type of error this is, used programmatically by consumers to interpret the error */\n readonly errorType: DriverErrorType;\n /** Free-form error message */\n readonly message: string;\n /** True indicates the caller may retry the failed action. False indicates it's a fatal error */\n canRetry: boolean;\n /**\n * Best guess as to network conditions (online/offline) when the error arose.\n * See OnlineStatus enum in driver-utils package for expected values.\n */\n online?: string;\n}\n\nexport interface IThrottlingWarning extends IDriverErrorBase {\n readonly errorType: DriverErrorType.throttlingError;\n readonly retryAfterSeconds: number;\n}\n\nexport interface IGenericNetworkError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.genericNetworkError;\n readonly statusCode?: number;\n}\n\nexport interface IAuthorizationError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.authorizationError;\n readonly claims?: string;\n readonly tenantId?: string;\n}\n\n/**\n * Having this uber interface without types that have their own interfaces\n * allows compiler to differentiate interfaces based on error type\n */\nexport interface IDriverBasicError extends IDriverErrorBase {\n readonly errorType:\n DriverErrorType.genericError\n | DriverErrorType.fileNotFoundOrAccessDeniedError\n | DriverErrorType.offlineError\n | DriverErrorType.unsupportedClientProtocolVersion\n | DriverErrorType.writeError\n | DriverErrorType.fetchFailure\n | DriverErrorType.incorrectServerResponse\n | DriverErrorType.fileOverwrittenInStorage;\n readonly statusCode?: number;\n}\n\nexport type DriverError =\n | IThrottlingWarning\n | IGenericNetworkError\n | IAuthorizationError\n | IDriverBasicError;\n"]}
|
package/lib/storage.d.ts
CHANGED
|
@@ -231,13 +231,27 @@ export interface IDocumentServiceFactory {
|
|
|
231
231
|
*/
|
|
232
232
|
protocolName: string;
|
|
233
233
|
/**
|
|
234
|
-
*
|
|
234
|
+
* Creates the document service after extracting different endpoints URLs from a resolved URL.
|
|
235
|
+
*
|
|
236
|
+
* @param resolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.
|
|
237
|
+
* @param logger - Optional telemetry logger to which telemetry events will be forwarded.
|
|
238
|
+
* @param clientIsSummarizer - Whether or not the client is the
|
|
239
|
+
* {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
|
|
240
|
+
* `undefined` =\> false
|
|
241
|
+
*
|
|
242
|
+
* @returns An instance of {@link IDocumentService}.
|
|
235
243
|
*/
|
|
236
244
|
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
237
245
|
/**
|
|
238
246
|
* Creates a new document with the provided options. Returns the document service.
|
|
247
|
+
*
|
|
239
248
|
* @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary
|
|
240
249
|
* should be posted later, before connecting to ordering service.
|
|
250
|
+
* @param createNewResolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.
|
|
251
|
+
* @param logger - Optional telemetry logger to which telemetry events will be forwarded.
|
|
252
|
+
* @param clientIsSummarizer - Whether or not the client is the
|
|
253
|
+
* {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
|
|
254
|
+
* `undefined` =\> false
|
|
241
255
|
*/
|
|
242
256
|
createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
243
257
|
}
|
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,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,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,EACX,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IAEtC;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;;;;;;;OASG;IACH,GAAG,CACC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EAAE,YAAY;IAC1B,EAAE,EAAE,MAAM,EAAE,YAAY;IACxB,WAAW,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAClC;AAED,oBAAY,aAAa,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,IAAI,CAAC;CAAE,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC;CAAE,CAAC;AAE5E;;GAEG;AACF,MAAM,WAAW,OAAO,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,CA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ACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IErrorEvent, ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClient,\n IClientConfiguration,\n ICreateBlobResponse,\n IDocumentMessage,\n INack,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ISnapshotTree,\n ISummaryHandle,\n ISummaryTree,\n ITokenClaims,\n IVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"./urlResolver\";\n\nexport interface IDeltasFetchResult {\n /**\n * Sequential set of messages starting from 'from' sequence number.\n * May be partial result, i.e. not fulfill original request in full.\n */\n messages: ISequencedDocumentMessage[];\n\n /**\n * If true, storage only partially fulfilled request, but has more ops\n * If false, the request was fulfilled. If less ops were returned then\n * requested, then storage does not have more ops in this range.\n */\n partialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDeltaStorageService {\n /**\n * Retrieves all the delta operations within the inclusive sequence number range\n * @param tenantId - Id of the tenant.\n * @param id - document id.\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n get(\n tenantId: string,\n id: string,\n from: number, // inclusive\n to: number, // exclusive\n fetchReason?: string,\n ): Promise<IDeltasFetchResult>;\n}\n\nexport type IStreamResult<T> = { done: true; } | { done: false; value: T; };\n\n/**\n * Read interface for the Queue\n */\n export interface IStream<T> {\n read(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDocumentDeltaStorageService {\n /**\n * Retrieves all the delta operations within the exclusive sequence number range\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param abortSignal - signal that aborts operation\n * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n fetchMessages(from: number,\n to: number | undefined,\n abortSignal?: AbortSignal,\n cachedOnly?: boolean,\n fetchReason?: string,\n ): IStream<ISequencedDocumentMessage[]>;\n}\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\n // If this policy is provided, it tells runtime on ideal size for blobs\n // Blobs that are smaller than that size should be aggregated into bigger blobs\n readonly minBlobSize?: number;\n\n /**\n * This policy tells the runtime that the driver will not use cached snapshots older than this value.\n */\n readonly maximumCacheDurationMs?: number;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n repositoryUrl: string;\n\n /**\n * Policies implemented/instructed by driver.\n */\n readonly policies?: IDocumentStorageServicePolicies;\n\n /**\n * Returns the snapshot tree.\n */\n getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n */\n getVersions(versionId: string | null, count: number): Promise<IVersion[]>;\n\n /**\n * Creates a blob out of the given buffer\n */\n createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n /**\n * Reads the object with the given ID, returns content in arrayBufferLike\n */\n readBlob(id: string): Promise<ArrayBufferLike>;\n\n /**\n * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n * referencing from the previously acked summary.\n * Returns the uploaded summary handle.\n */\n uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n /**\n * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n * server has deleted it this call may result in a broken promise.\n */\n downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n (event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n (event: \"disconnect\", listener: (reason: any) => void);\n (event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n (event: \"signal\", listener: (message: ISignalMessage) => void);\n (event: \"pong\", listener: (latency: number) => void);\n (event: \"error\", listener: (error: any) => void);\n}\n\nexport interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {\n /**\n * ClientID for the connection\n */\n clientId: string;\n\n /**\n * Claims for the client\n */\n claims: ITokenClaims;\n\n /**\n * Mode of the client\n */\n mode: ConnectionMode;\n\n /**\n * Whether the connection was made to a new or existing document\n */\n existing: boolean;\n\n /**\n * Protocol version being used with the service\n */\n version: string;\n\n /**\n * Messages sent during the connection\n */\n initialMessages: ISequencedDocumentMessage[];\n\n /**\n * Signals sent during the connection\n */\n initialSignals: ISignalMessage[];\n\n /**\n * Prior clients already connected.\n */\n initialClients: ISignalClient[];\n\n /**\n * Configuration details provided by the service\n */\n serviceConfiguration: IClientConfiguration;\n\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber?: number;\n\n /**\n * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n * it could contain info like build version, environment, region etc. These properties can be logged by client\n * to better understand server environment etc. and use it in case error occurs.\n * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n */\n relayServiceAgent?: string;\n\n /**\n * Submit a new message to the server\n */\n submit(messages: IDocumentMessage[]): void;\n\n /**\n * Submit a new signal to the server\n */\n submitSignal(message: any): void;\n}\n\nexport enum LoaderCachingPolicy {\n /**\n * The loader should not implement any prefetching or caching policy.\n */\n NoCaching,\n\n /**\n * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n */\n Prefetch,\n}\n\nexport interface IDocumentServicePolicies {\n /**\n * Do not connect to delta stream\n */\n readonly storageOnly?: boolean;\n}\n\nexport interface IDocumentService {\n\n resolvedUrl: IResolvedUrl;\n\n /**\n * Policies implemented/instructed by driver.\n */\n policies?: IDocumentServicePolicies;\n\n /**\n * Access to storage associated with the document...\n */\n connectToStorage(): Promise<IDocumentStorageService>;\n\n /**\n * Access to delta storage associated with the document\n */\n connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n /**\n * Subscribes to the document delta stream\n */\n connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n /**\n * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n * Useful for storage to commit any pending state if any (including any local caching).\n * Please note that it does not remove the need for caller to close all active delta connections,\n * as storage may not be tracking such objects.\n * @param error - tells if container (and storage) are closed due to critical error.\n * Error might be due to disconnect between client & server knowlege about file, like file being overwritten\n * in storage, but client having stale local cache.\n * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n */\n dispose(error?: any): void;\n}\n\nexport interface IDocumentServiceFactory {\n /**\n * Name of the protocol used by factory\n */\n protocolName: string;\n\n /**\n * Returns an instance of IDocumentService\n */\n createDocumentService(\n resolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n\n /**\n * Creates a new document with the provided options. Returns the document service.\n * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n * should be posted later, before connecting to ordering service.\n */\n createContainer(\n createNewSummary: ISummaryTree | undefined,\n createNewResolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n */\nexport interface ISummaryContext {\n /**\n * Parent summary proposed handle (from summary op)\n */\n readonly proposalHandle: string | undefined;\n\n /**\n * Parent summary acked handle (from summary ack)\n */\n readonly ackHandle: string | undefined;\n\n readonly referenceSequenceNumber: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwOH,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IErrorEvent, ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClient,\n IClientConfiguration,\n ICreateBlobResponse,\n IDocumentMessage,\n INack,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ISnapshotTree,\n ISummaryHandle,\n ISummaryTree,\n ITokenClaims,\n IVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IResolvedUrl } from \"./urlResolver\";\n\nexport interface IDeltasFetchResult {\n /**\n * Sequential set of messages starting from 'from' sequence number.\n * May be partial result, i.e. not fulfill original request in full.\n */\n messages: ISequencedDocumentMessage[];\n\n /**\n * If true, storage only partially fulfilled request, but has more ops\n * If false, the request was fulfilled. If less ops were returned then\n * requested, then storage does not have more ops in this range.\n */\n partialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDeltaStorageService {\n /**\n * Retrieves all the delta operations within the inclusive sequence number range\n * @param tenantId - Id of the tenant.\n * @param id - document id.\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n get(\n tenantId: string,\n id: string,\n from: number, // inclusive\n to: number, // exclusive\n fetchReason?: string,\n ): Promise<IDeltasFetchResult>;\n}\n\nexport type IStreamResult<T> = { done: true; } | { done: false; value: T; };\n\n/**\n * Read interface for the Queue\n */\n export interface IStream<T> {\n read(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDocumentDeltaStorageService {\n /**\n * Retrieves all the delta operations within the exclusive sequence number range\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param abortSignal - signal that aborts operation\n * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n fetchMessages(from: number,\n to: number | undefined,\n abortSignal?: AbortSignal,\n cachedOnly?: boolean,\n fetchReason?: string,\n ): IStream<ISequencedDocumentMessage[]>;\n}\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\n // If this policy is provided, it tells runtime on ideal size for blobs\n // Blobs that are smaller than that size should be aggregated into bigger blobs\n readonly minBlobSize?: number;\n\n /**\n * This policy tells the runtime that the driver will not use cached snapshots older than this value.\n */\n readonly maximumCacheDurationMs?: number;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n repositoryUrl: string;\n\n /**\n * Policies implemented/instructed by driver.\n */\n readonly policies?: IDocumentStorageServicePolicies;\n\n /**\n * Returns the snapshot tree.\n */\n getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n */\n getVersions(versionId: string | null, count: number): Promise<IVersion[]>;\n\n /**\n * Creates a blob out of the given buffer\n */\n createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n /**\n * Reads the object with the given ID, returns content in arrayBufferLike\n */\n readBlob(id: string): Promise<ArrayBufferLike>;\n\n /**\n * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n * referencing from the previously acked summary.\n * Returns the uploaded summary handle.\n */\n uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n /**\n * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n * server has deleted it this call may result in a broken promise.\n */\n downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n (event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n (event: \"disconnect\", listener: (reason: any) => void);\n (event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n (event: \"signal\", listener: (message: ISignalMessage) => void);\n (event: \"pong\", listener: (latency: number) => void);\n (event: \"error\", listener: (error: any) => void);\n}\n\nexport interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {\n /**\n * ClientID for the connection\n */\n clientId: string;\n\n /**\n * Claims for the client\n */\n claims: ITokenClaims;\n\n /**\n * Mode of the client\n */\n mode: ConnectionMode;\n\n /**\n * Whether the connection was made to a new or existing document\n */\n existing: boolean;\n\n /**\n * Protocol version being used with the service\n */\n version: string;\n\n /**\n * Messages sent during the connection\n */\n initialMessages: ISequencedDocumentMessage[];\n\n /**\n * Signals sent during the connection\n */\n initialSignals: ISignalMessage[];\n\n /**\n * Prior clients already connected.\n */\n initialClients: ISignalClient[];\n\n /**\n * Configuration details provided by the service\n */\n serviceConfiguration: IClientConfiguration;\n\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber?: number;\n\n /**\n * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n * it could contain info like build version, environment, region etc. These properties can be logged by client\n * to better understand server environment etc. and use it in case error occurs.\n * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n */\n relayServiceAgent?: string;\n\n /**\n * Submit a new message to the server\n */\n submit(messages: IDocumentMessage[]): void;\n\n /**\n * Submit a new signal to the server\n */\n submitSignal(message: any): void;\n}\n\nexport enum LoaderCachingPolicy {\n /**\n * The loader should not implement any prefetching or caching policy.\n */\n NoCaching,\n\n /**\n * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n */\n Prefetch,\n}\n\nexport interface IDocumentServicePolicies {\n /**\n * Do not connect to delta stream\n */\n readonly storageOnly?: boolean;\n}\n\nexport interface IDocumentService {\n\n resolvedUrl: IResolvedUrl;\n\n /**\n * Policies implemented/instructed by driver.\n */\n policies?: IDocumentServicePolicies;\n\n /**\n * Access to storage associated with the document...\n */\n connectToStorage(): Promise<IDocumentStorageService>;\n\n /**\n * Access to delta storage associated with the document\n */\n connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n /**\n * Subscribes to the document delta stream\n */\n connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n /**\n * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n * Useful for storage to commit any pending state if any (including any local caching).\n * Please note that it does not remove the need for caller to close all active delta connections,\n * as storage may not be tracking such objects.\n * @param error - tells if container (and storage) are closed due to critical error.\n * Error might be due to disconnect between client & server knowlege about file, like file being overwritten\n * in storage, but client having stale local cache.\n * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n */\n dispose(error?: any): void;\n}\n\nexport interface IDocumentServiceFactory {\n /**\n * Name of the protocol used by factory\n */\n protocolName: string;\n\n /**\n * Creates the document service after extracting different endpoints URLs from a resolved URL.\n *\n * @param resolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.\n * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n * @param clientIsSummarizer - Whether or not the client is the\n * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n * `undefined` =\\> false\n *\n * @returns An instance of {@link IDocumentService}.\n */\n createDocumentService(\n resolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n\n /**\n * Creates a new document with the provided options. Returns the document service.\n *\n * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n * should be posted later, before connecting to ordering service.\n * @param createNewResolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.\n * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n * @param clientIsSummarizer - Whether or not the client is the\n * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n * `undefined` =\\> false\n */\n createContainer(\n createNewSummary: ISummaryTree | undefined,\n createNewResolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n */\nexport interface ISummaryContext {\n /**\n * Parent summary proposed handle (from summary op)\n */\n readonly proposalHandle: string | undefined;\n\n /**\n * Parent summary acked handle (from summary ack)\n */\n readonly ackHandle: string | undefined;\n\n readonly referenceSequenceNumber: number;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-definitions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Fluid driver definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
19
19
|
"build:compile": "concurrently npm:typetests:gen npm:tsc npm:build:esnext",
|
|
20
|
-
"build:docs": "api-extractor run --local --typescript-compiler-folder
|
|
20
|
+
"build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
21
21
|
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
22
22
|
"build:full": "npm run build",
|
|
23
23
|
"build:full:compile": "npm run build:compile",
|
|
24
24
|
"ci:build": "npm run build:compile",
|
|
25
|
-
"ci:build:docs": "api-extractor run --typescript-compiler-folder
|
|
25
|
+
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
26
26
|
"ci:test": "echo No test for this package",
|
|
27
27
|
"ci:test:coverage": "echo No test for this package",
|
|
28
28
|
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
@@ -34,35 +34,23 @@
|
|
|
34
34
|
"tsc:watch": "tsc --watch",
|
|
35
35
|
"tsfmt": "tsfmt --verify",
|
|
36
36
|
"tsfmt:fix": "tsfmt --replace",
|
|
37
|
-
"typetests:gen": "fluid-type-validator -d ."
|
|
38
|
-
"typetests:prepare": "fluid-type-validator -d . -p"
|
|
37
|
+
"typetests:gen": "fluid-type-validator -g -d ."
|
|
39
38
|
},
|
|
40
39
|
"dependencies": {
|
|
41
40
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
42
|
-
"@fluidframework/core-interfaces": "^0.
|
|
43
|
-
"@fluidframework/protocol-definitions": "^0.1028.2000
|
|
41
|
+
"@fluidframework/core-interfaces": "^1.0.0",
|
|
42
|
+
"@fluidframework/protocol-definitions": "^0.1028.2000"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"@fluidframework/build-common": "^0.23.0",
|
|
47
|
-
"@fluidframework/build-tools": "^0.2.
|
|
46
|
+
"@fluidframework/build-tools": "^0.2.71273",
|
|
48
47
|
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@0.46.1000",
|
|
49
|
-
"@fluidframework/eslint-config-fluid": "^0.28.2000
|
|
48
|
+
"@fluidframework/eslint-config-fluid": "^0.28.2000",
|
|
50
49
|
"@microsoft/api-extractor": "^7.22.2",
|
|
51
50
|
"@rushstack/eslint-config": "^2.5.1",
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "~5.9.0",
|
|
53
|
-
"@typescript-eslint/parser": "~5.9.0",
|
|
54
51
|
"concurrently": "^6.2.0",
|
|
55
52
|
"copyfiles": "^2.1.0",
|
|
56
53
|
"eslint": "~8.6.0",
|
|
57
|
-
"eslint-plugin-editorconfig": "~3.2.0",
|
|
58
|
-
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
59
|
-
"eslint-plugin-import": "~2.25.4",
|
|
60
|
-
"eslint-plugin-jest": "~26.1.3",
|
|
61
|
-
"eslint-plugin-mocha": "~10.0.3",
|
|
62
|
-
"eslint-plugin-promise": "~6.0.0",
|
|
63
|
-
"eslint-plugin-react": "~7.28.0",
|
|
64
|
-
"eslint-plugin-tsdoc": "~0.2.14",
|
|
65
|
-
"eslint-plugin-unicorn": "~40.0.0",
|
|
66
54
|
"rimraf": "^2.6.2",
|
|
67
55
|
"typescript": "~4.5.5",
|
|
68
56
|
"typescript-formatter": "7.1.0"
|
package/src/driverError.ts
CHANGED
|
@@ -51,10 +51,10 @@ export enum DriverErrorType {
|
|
|
51
51
|
writeError = "writeError",
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
54
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
55
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
56
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
57
|
+
* CSP violation, etc.
|
|
58
58
|
*/
|
|
59
59
|
fetchFailure = "fetchFailure",
|
|
60
60
|
|
package/src/storage.ts
CHANGED
|
@@ -296,7 +296,15 @@ export interface IDocumentServiceFactory {
|
|
|
296
296
|
protocolName: string;
|
|
297
297
|
|
|
298
298
|
/**
|
|
299
|
-
*
|
|
299
|
+
* Creates the document service after extracting different endpoints URLs from a resolved URL.
|
|
300
|
+
*
|
|
301
|
+
* @param resolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.
|
|
302
|
+
* @param logger - Optional telemetry logger to which telemetry events will be forwarded.
|
|
303
|
+
* @param clientIsSummarizer - Whether or not the client is the
|
|
304
|
+
* {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
|
|
305
|
+
* `undefined` =\> false
|
|
306
|
+
*
|
|
307
|
+
* @returns An instance of {@link IDocumentService}.
|
|
300
308
|
*/
|
|
301
309
|
createDocumentService(
|
|
302
310
|
resolvedUrl: IResolvedUrl,
|
|
@@ -306,8 +314,14 @@ export interface IDocumentServiceFactory {
|
|
|
306
314
|
|
|
307
315
|
/**
|
|
308
316
|
* Creates a new document with the provided options. Returns the document service.
|
|
317
|
+
*
|
|
309
318
|
* @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary
|
|
310
319
|
* should be posted later, before connecting to ordering service.
|
|
320
|
+
* @param createNewResolvedUrl - Endpoint URL data. @see {@link IResolvedUrl}.
|
|
321
|
+
* @param logger - Optional telemetry logger to which telemetry events will be forwarded.
|
|
322
|
+
* @param clientIsSummarizer - Whether or not the client is the
|
|
323
|
+
* {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
|
|
324
|
+
* `undefined` =\> false
|
|
311
325
|
*/
|
|
312
326
|
createContainer(
|
|
313
327
|
createNewSummary: ISummaryTree | undefined,
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
## API Report File for "@fluidframework/driver-definitions"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { ConnectionMode } from '@fluidframework/protocol-definitions';
|
|
8
|
-
import { IClient } from '@fluidframework/protocol-definitions';
|
|
9
|
-
import { IClientConfiguration } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
|
|
11
|
-
import { IDisposable } from '@fluidframework/common-definitions';
|
|
12
|
-
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
13
|
-
import { IErrorEvent } from '@fluidframework/common-definitions';
|
|
14
|
-
import { IEventProvider } from '@fluidframework/common-definitions';
|
|
15
|
-
import { INack } from '@fluidframework/protocol-definitions';
|
|
16
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
17
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
18
|
-
import { ISignalClient } from '@fluidframework/protocol-definitions';
|
|
19
|
-
import { ISignalMessage } from '@fluidframework/protocol-definitions';
|
|
20
|
-
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
21
|
-
import { ISummaryHandle } from '@fluidframework/protocol-definitions';
|
|
22
|
-
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
23
|
-
import { ITelemetryBaseLogger } from '@fluidframework/common-definitions';
|
|
24
|
-
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
25
|
-
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
26
|
-
|
|
27
|
-
// @public (undocumented)
|
|
28
|
-
export type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | IDriverBasicError;
|
|
29
|
-
|
|
30
|
-
// @public
|
|
31
|
-
export enum DriverErrorType {
|
|
32
|
-
authorizationError = "authorizationError",
|
|
33
|
-
deltaStreamConnectionForbidden = "deltaStreamConnectionForbidden",
|
|
34
|
-
fetchFailure = "fetchFailure",
|
|
35
|
-
fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
|
|
36
|
-
fileOverwrittenInStorage = "fileOverwrittenInStorage",
|
|
37
|
-
genericError = "genericError",
|
|
38
|
-
genericNetworkError = "genericNetworkError",
|
|
39
|
-
incorrectServerResponse = "incorrectServerResponse",
|
|
40
|
-
offlineError = "offlineError",
|
|
41
|
-
throttlingError = "throttlingError",
|
|
42
|
-
// (undocumented)
|
|
43
|
-
unsupportedClientProtocolVersion = "unsupportedClientProtocolVersion",
|
|
44
|
-
writeError = "writeError"
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// @public
|
|
48
|
-
export enum DriverHeader {
|
|
49
|
-
// (undocumented)
|
|
50
|
-
createNew = "createNew",
|
|
51
|
-
// (undocumented)
|
|
52
|
-
summarizingClient = "fluid-client-summarizer"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// @public
|
|
56
|
-
export interface DriverPreCheckInfo {
|
|
57
|
-
codeDetailsHint?: string;
|
|
58
|
-
criticalBootDomains?: string[];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// @public (undocumented)
|
|
62
|
-
export interface IAuthorizationError extends IDriverErrorBase {
|
|
63
|
-
// (undocumented)
|
|
64
|
-
readonly claims?: string;
|
|
65
|
-
// (undocumented)
|
|
66
|
-
readonly errorType: DriverErrorType.authorizationError;
|
|
67
|
-
// (undocumented)
|
|
68
|
-
readonly tenantId?: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// @public
|
|
72
|
-
export interface IContainerPackageInfo {
|
|
73
|
-
name: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// @public (undocumented)
|
|
77
|
-
export interface IDeltasFetchResult {
|
|
78
|
-
messages: ISequencedDocumentMessage[];
|
|
79
|
-
partialResult: boolean;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// @public
|
|
83
|
-
export interface IDeltaStorageService {
|
|
84
|
-
get(tenantId: string, id: string, from: number, // inclusive
|
|
85
|
-
to: number, // exclusive
|
|
86
|
-
fetchReason?: string): Promise<IDeltasFetchResult>;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// @public (undocumented)
|
|
90
|
-
export interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {
|
|
91
|
-
checkpointSequenceNumber?: number;
|
|
92
|
-
claims: ITokenClaims;
|
|
93
|
-
clientId: string;
|
|
94
|
-
existing: boolean;
|
|
95
|
-
initialClients: ISignalClient[];
|
|
96
|
-
initialMessages: ISequencedDocumentMessage[];
|
|
97
|
-
initialSignals: ISignalMessage[];
|
|
98
|
-
mode: ConnectionMode;
|
|
99
|
-
relayServiceAgent?: string;
|
|
100
|
-
serviceConfiguration: IClientConfiguration;
|
|
101
|
-
submit(messages: IDocumentMessage[]): void;
|
|
102
|
-
submitSignal(message: any): void;
|
|
103
|
-
version: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// @public (undocumented)
|
|
107
|
-
export interface IDocumentDeltaConnectionEvents extends IErrorEvent {
|
|
108
|
-
// (undocumented)
|
|
109
|
-
(event: "nack", listener: (documentId: string, message: INack[]) => void): any;
|
|
110
|
-
// (undocumented)
|
|
111
|
-
(event: "disconnect", listener: (reason: any) => void): any;
|
|
112
|
-
// (undocumented)
|
|
113
|
-
(event: "op", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void): any;
|
|
114
|
-
// (undocumented)
|
|
115
|
-
(event: "signal", listener: (message: ISignalMessage) => void): any;
|
|
116
|
-
// (undocumented)
|
|
117
|
-
(event: "pong", listener: (latency: number) => void): any;
|
|
118
|
-
// (undocumented)
|
|
119
|
-
(event: "error", listener: (error: any) => void): any;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// @public
|
|
123
|
-
export interface IDocumentDeltaStorageService {
|
|
124
|
-
fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean, fetchReason?: string): IStream<ISequencedDocumentMessage[]>;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// @public (undocumented)
|
|
128
|
-
export interface IDocumentService {
|
|
129
|
-
connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
|
|
130
|
-
connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
|
|
131
|
-
connectToStorage(): Promise<IDocumentStorageService>;
|
|
132
|
-
dispose(error?: any): void;
|
|
133
|
-
policies?: IDocumentServicePolicies;
|
|
134
|
-
// (undocumented)
|
|
135
|
-
resolvedUrl: IResolvedUrl;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// @public (undocumented)
|
|
139
|
-
export interface IDocumentServiceFactory {
|
|
140
|
-
createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
141
|
-
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
142
|
-
protocolName: string;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// @public (undocumented)
|
|
146
|
-
export interface IDocumentServicePolicies {
|
|
147
|
-
readonly storageOnly?: boolean;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// @public
|
|
151
|
-
export interface IDocumentStorageService extends Partial<IDisposable> {
|
|
152
|
-
createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
|
|
153
|
-
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
|
|
154
|
-
getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
|
|
155
|
-
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
156
|
-
readonly policies?: IDocumentStorageServicePolicies;
|
|
157
|
-
readBlob(id: string): Promise<ArrayBufferLike>;
|
|
158
|
-
// (undocumented)
|
|
159
|
-
repositoryUrl: string;
|
|
160
|
-
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// @public (undocumented)
|
|
164
|
-
export interface IDocumentStorageServicePolicies {
|
|
165
|
-
// (undocumented)
|
|
166
|
-
readonly caching?: LoaderCachingPolicy;
|
|
167
|
-
readonly maximumCacheDurationMs?: number;
|
|
168
|
-
// (undocumented)
|
|
169
|
-
readonly minBlobSize?: number;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// @public
|
|
173
|
-
export interface IDriverBasicError extends IDriverErrorBase {
|
|
174
|
-
// (undocumented)
|
|
175
|
-
readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage;
|
|
176
|
-
// (undocumented)
|
|
177
|
-
readonly statusCode?: number;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// @public
|
|
181
|
-
export interface IDriverErrorBase {
|
|
182
|
-
canRetry: boolean;
|
|
183
|
-
readonly errorType: DriverErrorType;
|
|
184
|
-
readonly message: string;
|
|
185
|
-
online?: string;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// @public (undocumented)
|
|
189
|
-
export interface IDriverHeader {
|
|
190
|
-
// (undocumented)
|
|
191
|
-
[DriverHeader.summarizingClient]: boolean;
|
|
192
|
-
// (undocumented)
|
|
193
|
-
[DriverHeader.createNew]: any;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// @public (undocumented)
|
|
197
|
-
export interface IFluidResolvedUrl extends IResolvedUrlBase {
|
|
198
|
-
// (undocumented)
|
|
199
|
-
endpoints: {
|
|
200
|
-
[name: string]: string;
|
|
201
|
-
};
|
|
202
|
-
id: string;
|
|
203
|
-
// (undocumented)
|
|
204
|
-
tokens: {
|
|
205
|
-
[name: string]: string;
|
|
206
|
-
};
|
|
207
|
-
// (undocumented)
|
|
208
|
-
type: "fluid";
|
|
209
|
-
// (undocumented)
|
|
210
|
-
url: string;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// @public (undocumented)
|
|
214
|
-
export interface IGenericNetworkError extends IDriverErrorBase {
|
|
215
|
-
// (undocumented)
|
|
216
|
-
readonly errorType: DriverErrorType.genericNetworkError;
|
|
217
|
-
// (undocumented)
|
|
218
|
-
readonly statusCode?: number;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// @public (undocumented)
|
|
222
|
-
export type IResolvedUrl = IWebResolvedUrl | IFluidResolvedUrl;
|
|
223
|
-
|
|
224
|
-
// @public (undocumented)
|
|
225
|
-
export interface IResolvedUrlBase {
|
|
226
|
-
// (undocumented)
|
|
227
|
-
type: string;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// @public
|
|
231
|
-
export interface IStream<T> {
|
|
232
|
-
// (undocumented)
|
|
233
|
-
read(): Promise<IStreamResult<T>>;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// @public (undocumented)
|
|
237
|
-
export type IStreamResult<T> = {
|
|
238
|
-
done: true;
|
|
239
|
-
} | {
|
|
240
|
-
done: false;
|
|
241
|
-
value: T;
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
// @public
|
|
245
|
-
export interface ISummaryContext {
|
|
246
|
-
readonly ackHandle: string | undefined;
|
|
247
|
-
readonly proposalHandle: string | undefined;
|
|
248
|
-
// (undocumented)
|
|
249
|
-
readonly referenceSequenceNumber: number;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// @public (undocumented)
|
|
253
|
-
export interface IThrottlingWarning extends IDriverErrorBase {
|
|
254
|
-
// (undocumented)
|
|
255
|
-
readonly errorType: DriverErrorType.throttlingError;
|
|
256
|
-
// (undocumented)
|
|
257
|
-
readonly retryAfterSeconds: number;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
// @public (undocumented)
|
|
261
|
-
export interface IUrlResolver {
|
|
262
|
-
// (undocumented)
|
|
263
|
-
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
|
|
264
|
-
// (undocumented)
|
|
265
|
-
resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// @public (undocumented)
|
|
269
|
-
export interface IWebResolvedUrl extends IResolvedUrlBase {
|
|
270
|
-
// (undocumented)
|
|
271
|
-
data: string;
|
|
272
|
-
// (undocumented)
|
|
273
|
-
type: "web";
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// @public (undocumented)
|
|
277
|
-
export enum LoaderCachingPolicy {
|
|
278
|
-
NoCaching = 0,
|
|
279
|
-
Prefetch = 1
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
// (No @packageDocumentation comment for this package)
|
|
284
|
-
|
|
285
|
-
```
|