@fluidframework/driver-definitions 2.0.0-internal.2.2.0 → 2.0.0-internal.2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/driverError.d.ts +9 -3
- package/dist/driverError.d.ts.map +1 -1
- package/dist/driverError.js.map +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js.map +1 -1
- package/dist/urlResolver.d.ts.map +1 -1
- package/dist/urlResolver.js.map +1 -1
- package/lib/driverError.d.ts +9 -3
- package/lib/driverError.d.ts.map +1 -1
- package/lib/driverError.js.map +1 -1
- package/lib/storage.d.ts.map +1 -1
- package/lib/storage.js.map +1 -1
- package/lib/test/types/maximumCacheDurationPolicy.spec.js.map +1 -1
- package/lib/urlResolver.d.ts.map +1 -1
- package/lib/urlResolver.js.map +1 -1
- package/package.json +7 -7
- package/src/driverError.ts +12 -3
- package/src/storage.ts +11 -1
- package/src/urlResolver.ts +2 -0
package/dist/driverError.d.ts
CHANGED
|
@@ -94,11 +94,17 @@ export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
|
94
94
|
* Base interface for all errors and warnings
|
|
95
95
|
*/
|
|
96
96
|
export interface IDriverErrorBase {
|
|
97
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Classification of what type of error this is, used programmatically by consumers to interpret the error
|
|
99
|
+
*/
|
|
98
100
|
readonly errorType: DriverErrorType;
|
|
99
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Free-form error message
|
|
103
|
+
*/
|
|
100
104
|
readonly message: string;
|
|
101
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* True indicates the caller may retry the failed action. False indicates it's a fatal error
|
|
107
|
+
*/
|
|
102
108
|
canRetry: boolean;
|
|
103
109
|
/**
|
|
104
110
|
* Best guess as to network conditions (online/offline) when the error arose.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,oBAAY,eAAe;IACvB;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;OAEG;IACH,+BAA+B,oCAAoC;IAEnE;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,YAAY,iBAAiB;IAK7B,gCAAgC,qCAAqC;IAErE;;;OAGG;IACH,UAAU,eAAe;IAEzB;;;;;OAKG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,uBAAuB,4BAA4B;IAEnD;;;;;OAKG;IACH,wBAAwB,6BAA6B;IAErD;;OAEG;IACH,8BAA8B,mCAAmC;IAEjE;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;;;OAIG;IACH,kBAAkB,uBAAuB;IACzC;;;MAGE;IACF,UAAU,eAAe;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC;IACxE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B
|
|
1
|
+
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,oBAAY,eAAe;IACvB;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;OAEG;IACH,+BAA+B,oCAAoC;IAEnE;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,YAAY,iBAAiB;IAK7B,gCAAgC,q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gBAAgB;IAC/D,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC,mBAAmB,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,QAAQ,CAAC,SAAS,EAClB,eAAe,CAAC,YAAY,GAC1B,eAAe,CAAC,+BAA+B,GAC/C,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,gCAAgC,GAChD,eAAe,CAAC,UAAU,GAC1B,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,uBAAuB,GACvC,eAAe,CAAC,wBAAwB,GACxC,eAAe,CAAC,kBAAkB,GAClC,eAAe,CAAC,UAAU,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,oBAAY,WAAW,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,yBAAyB,GACzB,iBAAiB,CAAC"}
|
package/dist/driverError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACH,IAAY,eAsFX;AAtFD,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;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IACzC;;;MAGE;IACF,4CAAyB,CAAA;AAC7B,CAAC,EAtFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAsF1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"./urlResolver\";\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 * The location of file/container can change on server. So if the file location moves and we try to access the old\n * location, then this error is thrown to let the client know about the new location info.\n */\n locationRedirection = \"locationRedirection\",\n\n /**\n * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n * server won't be able to open it and will return this error. The innerMostErrorCode will be\n * \"fluidInvalidSchema\"\n */\n fluidInvalidSchema = \"fluidInvalidSchema\",\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * ! Should match the value of ContainerErrorType.usageError\n */\n usageError = \"usageError\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n readonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n
|
|
1
|
+
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACH,IAAY,eAsFX;AAtFD,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;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IACzC;;;MAGE;IACF,4CAAyB,CAAA;AAC7B,CAAC,EAtFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAsF1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"./urlResolver\";\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 * The location of file/container can change on server. So if the file location moves and we try to access the old\n * location, then this error is thrown to let the client know about the new location info.\n */\n locationRedirection = \"locationRedirection\",\n\n /**\n * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n * server won't be able to open it and will return this error. The innerMostErrorCode will be\n * \"fluidInvalidSchema\"\n */\n fluidInvalidSchema = \"fluidInvalidSchema\",\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * ! Should match the value of ContainerErrorType.usageError\n */\n usageError = \"usageError\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n readonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n /**\n * Classification of what type of error this is, used programmatically by consumers to interpret the error\n */\n readonly errorType: DriverErrorType;\n\n /**\n * Free-form error message\n */\n readonly message: string;\n\n /**\n * True indicates the caller may retry the failed action. False indicates it's a fatal error\n */\n canRetry: boolean;\n\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\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.locationRedirection;\n readonly redirectUrl: IResolvedUrl;\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 | DriverErrorType.fluidInvalidSchema\n | DriverErrorType.usageError;\n readonly statusCode?: number;\n}\n\nexport type DriverError =\n | IThrottlingWarning\n | IGenericNetworkError\n | IAuthorizationError\n | ILocationRedirectionError\n | IDriverBasicError;\n"]}
|
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,sCAAsC,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,WAA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C,uBAAuB,EAAE,MAAM,CAAC;CAC5C;AAED,oBAAY,WAAW;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;CACtB"}
|
package/dist/storage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiQH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAU9B;AA0GD,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACvB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","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 { IAnyDriverError } from \"./driverError\";\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 */\nexport 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\n// DO NOT INCREASE THIS TYPE'S VALUE - If a driver started using a larger value, GC would likely start closing sessions\nexport type FiveDaysMs = 432000000; /* 5 days in milliseconds */\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\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 */\n readonly minBlobSize?: number;\n\n /**\n * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n * Otherwise, the driver will not use snapshots that were added to the cache more than 5 days ago (per client clock)\n * The value MUST be 5 days if defined. This fixed upper bound is necessary for the Garbage Collection feature\n * in the Runtime layer to reliably compute when an object will never be referenced again and can be deleted.\n */\n readonly maximumCacheDurationMs?: FiveDaysMs;\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 * @param version - Version of the snapshot to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n */\n getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n * @param versionId - Version id of the requested version.\n * @param count - Number of the versions to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n * from storage.\n */\n getVersions(\n versionId: string | null,\n count: number,\n scenarioName?: string,\n fetchSource?: FetchSource,\n ): 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: IAnyDriverError) => 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\nexport enum FetchSource {\n default = \"default\",\n noCache = \"noCache\",\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyQH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAU9B;AA4GD,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACvB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","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 { IAnyDriverError } from \"./driverError\";\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 */\nexport 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\n// DO NOT INCREASE THIS TYPE'S VALUE - If a driver started using a larger value, GC would likely start closing sessions\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\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 */\n readonly minBlobSize?: number;\n\n /**\n * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n * Otherwise, the driver will not use snapshots that were added to the cache more than 5 days ago (per client clock)\n * The value MUST be 5 days if defined. This fixed upper bound is necessary for the Garbage Collection feature\n * in the Runtime layer to reliably compute when an object will never be referenced again and can be deleted.\n */\n readonly maximumCacheDurationMs?: FiveDaysMs;\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 * @param version - Version of the snapshot to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n */\n // TODO: use `undefined` instead.\n // eslint-disable-next-line @rushstack/no-new-null\n getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n * @param versionId - Version id of the requested version.\n * @param count - Number of the versions to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n * from storage.\n */\n getVersions(\n // TODO: use `undefined` instead.\n // eslint-disable-next-line @rushstack/no-new-null\n versionId: string | null,\n count: number,\n scenarioName?: string,\n fetchSource?: FetchSource,\n ): 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: IAnyDriverError) => 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 // TODO: Use something other than `any`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 // TODO: Use something other than `any`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 // TODO: Use something other than `any`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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\nexport enum FetchSource {\n default = \"default\",\n noCache = \"noCache\",\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,oBAAY,YAAY,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE/D,MAAM,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AAC;IAG1C,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC;CACjC;AAED,OAAO,QAAQ,iCAAiC,CAAC;IAE7C,UAAiB,cAAe,SAAQ,OAAO,CAAC,aAAa,CAAC;KAAI;CACrE"}
|
package/dist/urlResolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":";;;AA4EA;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,qDAAqD;IACrD,6DAA6C,CAAA;IAC7C,iDAAiD;IACjD,uCAAuB,CAAA;AAC3B,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest } from \"@fluidframework/core-interfaces\";\n\nexport type IResolvedUrl = IWebResolvedUrl | IFluidResolvedUrl;\n\nexport interface IResolvedUrlBase {\n type: string;\n}\n\nexport interface IWebResolvedUrl extends IResolvedUrlBase {\n type: \"web\";\n data: string;\n}\n\nexport interface IFluidResolvedUrl extends IResolvedUrlBase {\n type: \"fluid\";\n /**\n * The id of the container this resolved url is for.\n */\n id: string;\n url: string;\n tokens: { [name: string]: string; };\n endpoints: { [name: string]: string; };\n}\n\n/**\n * Container package info handed off to resolver.\n */\nexport interface IContainerPackageInfo {\n /**\n * Container package name.\n */\n name: string;\n}\n\nexport interface IUrlResolver {\n\n // Like DNS should be able to cache resolution requests. Then possibly just have a token provider go and do stuff?\n // the expiration of it could be relative to the lifetime of the token? Requests after need to refresh?\n // or do we split the token access from this?\n resolve(request: IRequest): Promise<IResolvedUrl | undefined>;\n\n /**\n * Creates a url for the created container with any data store path given in the relative url.\n * @param resolvedUrl - resolved url for the container.\n * @param relativeUrl - relative url containing data store path; '/' represents root path.\n * @param packageInfoSource - optional, represents container package information to be included in url.\n * @returns absolute url combining container url with dta store path and optional additional information.\n */\n getAbsoluteUrl(\n resolvedUrl: IResolvedUrl,\n relativeUrl: string,\n packageInfoSource?: IContainerPackageInfo,\n ): Promise<string>;\n}\n\n/**\n* Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL\n* for driver compatibility and preload information.\n*/\nexport interface DriverPreCheckInfo {\n /**\n * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.\n */\n codeDetailsHint?: string;\n\n /**\n * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for\n * improved performance.\n */\n criticalBootDomains?: string[];\n }\n\n/**\n * Additional key in the loader request header\n */\nexport enum DriverHeader {\n // Key to indicate whether the request for summarizer\n summarizingClient = \"fluid-client-summarizer\",\n // createNew information, specific to each driver\n createNew = \"createNew\",\n}\n\nexport interface IDriverHeader {\n [DriverHeader.summarizingClient]: boolean;\n [DriverHeader.createNew]: any;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface IRequestHeader extends Partial<IDriverHeader> { }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":";;;AA4EA;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,qDAAqD;IACrD,6DAA6C,CAAA;IAC7C,iDAAiD;IACjD,uCAAuB,CAAA;AAC3B,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest } from \"@fluidframework/core-interfaces\";\n\nexport type IResolvedUrl = IWebResolvedUrl | IFluidResolvedUrl;\n\nexport interface IResolvedUrlBase {\n type: string;\n}\n\nexport interface IWebResolvedUrl extends IResolvedUrlBase {\n type: \"web\";\n data: string;\n}\n\nexport interface IFluidResolvedUrl extends IResolvedUrlBase {\n type: \"fluid\";\n /**\n * The id of the container this resolved url is for.\n */\n id: string;\n url: string;\n tokens: { [name: string]: string; };\n endpoints: { [name: string]: string; };\n}\n\n/**\n * Container package info handed off to resolver.\n */\nexport interface IContainerPackageInfo {\n /**\n * Container package name.\n */\n name: string;\n}\n\nexport interface IUrlResolver {\n\n // Like DNS should be able to cache resolution requests. Then possibly just have a token provider go and do stuff?\n // the expiration of it could be relative to the lifetime of the token? Requests after need to refresh?\n // or do we split the token access from this?\n resolve(request: IRequest): Promise<IResolvedUrl | undefined>;\n\n /**\n * Creates a url for the created container with any data store path given in the relative url.\n * @param resolvedUrl - resolved url for the container.\n * @param relativeUrl - relative url containing data store path; '/' represents root path.\n * @param packageInfoSource - optional, represents container package information to be included in url.\n * @returns absolute url combining container url with dta store path and optional additional information.\n */\n getAbsoluteUrl(\n resolvedUrl: IResolvedUrl,\n relativeUrl: string,\n packageInfoSource?: IContainerPackageInfo,\n ): Promise<string>;\n}\n\n/**\n* Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL\n* for driver compatibility and preload information.\n*/\nexport interface DriverPreCheckInfo {\n /**\n * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.\n */\n codeDetailsHint?: string;\n\n /**\n * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for\n * improved performance.\n */\n criticalBootDomains?: string[];\n }\n\n/**\n * Additional key in the loader request header\n */\nexport enum DriverHeader {\n // Key to indicate whether the request for summarizer\n summarizingClient = \"fluid-client-summarizer\",\n // createNew information, specific to each driver\n createNew = \"createNew\",\n}\n\nexport interface IDriverHeader {\n [DriverHeader.summarizingClient]: boolean;\n // TODO: Use something other than `any`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [DriverHeader.createNew]: any;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface IRequestHeader extends Partial<IDriverHeader> { }\n}\n"]}
|
package/lib/driverError.d.ts
CHANGED
|
@@ -94,11 +94,17 @@ export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
|
94
94
|
* Base interface for all errors and warnings
|
|
95
95
|
*/
|
|
96
96
|
export interface IDriverErrorBase {
|
|
97
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Classification of what type of error this is, used programmatically by consumers to interpret the error
|
|
99
|
+
*/
|
|
98
100
|
readonly errorType: DriverErrorType;
|
|
99
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Free-form error message
|
|
103
|
+
*/
|
|
100
104
|
readonly message: string;
|
|
101
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* True indicates the caller may retry the failed action. False indicates it's a fatal error
|
|
107
|
+
*/
|
|
102
108
|
canRetry: boolean;
|
|
103
109
|
/**
|
|
104
110
|
* Best guess as to network conditions (online/offline) when the error arose.
|
package/lib/driverError.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,oBAAY,eAAe;IACvB;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;OAEG;IACH,+BAA+B,oCAAoC;IAEnE;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,YAAY,iBAAiB;IAK7B,gCAAgC,qCAAqC;IAErE;;;OAGG;IACH,UAAU,eAAe;IAEzB;;;;;OAKG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,uBAAuB,4BAA4B;IAEnD;;;;;OAKG;IACH,wBAAwB,6BAA6B;IAErD;;OAEG;IACH,8BAA8B,mCAAmC;IAEjE;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;;;OAIG;IACH,kBAAkB,uBAAuB;IACzC;;;MAGE;I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verError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAsFX;AAtFD,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;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IACzC;;;MAGE;IACF,4CAAyB,CAAA;AAC7B,CAAC,EAtFW,eAAe,KAAf,eAAe,QAsF1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"./urlResolver\";\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 * The location of file/container can change on server. So if the file location moves and we try to access the old\n * location, then this error is thrown to let the client know about the new location info.\n */\n locationRedirection = \"locationRedirection\",\n\n /**\n * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n * server won't be able to open it and will return this error. The innerMostErrorCode will be\n * \"fluidInvalidSchema\"\n */\n fluidInvalidSchema = \"fluidInvalidSchema\",\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * ! Should match the value of ContainerErrorType.usageError\n */\n usageError = \"usageError\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n readonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n
|
|
1
|
+
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAsFX;AAtFD,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;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IACzC;;;MAGE;IACF,4CAAyB,CAAA;AAC7B,CAAC,EAtFW,eAAe,KAAf,eAAe,QAsF1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"./urlResolver\";\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 * The location of file/container can change on server. So if the file location moves and we try to access the old\n * location, then this error is thrown to let the client know about the new location info.\n */\n locationRedirection = \"locationRedirection\",\n\n /**\n * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n * server won't be able to open it and will return this error. The innerMostErrorCode will be\n * \"fluidInvalidSchema\"\n */\n fluidInvalidSchema = \"fluidInvalidSchema\",\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * ! Should match the value of ContainerErrorType.usageError\n */\n usageError = \"usageError\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n readonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n /**\n * Classification of what type of error this is, used programmatically by consumers to interpret the error\n */\n readonly errorType: DriverErrorType;\n\n /**\n * Free-form error message\n */\n readonly message: string;\n\n /**\n * True indicates the caller may retry the failed action. False indicates it's a fatal error\n */\n canRetry: boolean;\n\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\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.locationRedirection;\n readonly redirectUrl: IResolvedUrl;\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 | DriverErrorType.fluidInvalidSchema\n | DriverErrorType.usageError;\n readonly statusCode?: number;\n}\n\nexport type DriverError =\n | IThrottlingWarning\n | IGenericNetworkError\n | IAuthorizationError\n | ILocationRedirectionError\n | IDriverBasicError;\n"]}
|
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,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,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;AACH,MAAM,WAAW,OAAO,CAAC,CAAC;IACtB,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,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ACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;OAUG;IACH,qBAAqB,CACjB,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC7B,OAAO,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;AAED,oBAAY,WAAW;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;CACtB"}
|
package/lib/storage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiQH,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B;AA0GD,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACvB,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 { 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 { IAnyDriverError } from \"./driverError\";\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 */\nexport 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\n// DO NOT INCREASE THIS TYPE'S VALUE - If a driver started using a larger value, GC would likely start closing sessions\nexport type FiveDaysMs = 432000000; /* 5 days in milliseconds */\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\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 */\n readonly minBlobSize?: number;\n\n /**\n * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n * Otherwise, the driver will not use snapshots that were added to the cache more than 5 days ago (per client clock)\n * The value MUST be 5 days if defined. This fixed upper bound is necessary for the Garbage Collection feature\n * in the Runtime layer to reliably compute when an object will never be referenced again and can be deleted.\n */\n readonly maximumCacheDurationMs?: FiveDaysMs;\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 * @param version - Version of the snapshot to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n */\n getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n * @param versionId - Version id of the requested version.\n * @param count - Number of the versions to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n * from storage.\n */\n getVersions(\n versionId: string | null,\n count: number,\n scenarioName?: string,\n fetchSource?: FetchSource,\n ): 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: IAnyDriverError) => 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\nexport enum FetchSource {\n default = \"default\",\n noCache = \"noCache\",\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyQH,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B;AA4GD,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACvB,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 { 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 { IAnyDriverError } from \"./driverError\";\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 */\nexport 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\n// DO NOT INCREASE THIS TYPE'S VALUE - If a driver started using a larger value, GC would likely start closing sessions\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\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 */\n readonly minBlobSize?: number;\n\n /**\n * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n * Otherwise, the driver will not use snapshots that were added to the cache more than 5 days ago (per client clock)\n * The value MUST be 5 days if defined. This fixed upper bound is necessary for the Garbage Collection feature\n * in the Runtime layer to reliably compute when an object will never be referenced again and can be deleted.\n */\n readonly maximumCacheDurationMs?: FiveDaysMs;\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 * @param version - Version of the snapshot to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n */\n // TODO: use `undefined` instead.\n // eslint-disable-next-line @rushstack/no-new-null\n getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n * @param versionId - Version id of the requested version.\n * @param count - Number of the versions to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n * from storage.\n */\n getVersions(\n // TODO: use `undefined` instead.\n // eslint-disable-next-line @rushstack/no-new-null\n versionId: string | null,\n count: number,\n scenarioName?: string,\n fetchSource?: FetchSource,\n ): 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: IAnyDriverError) => 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 // TODO: Use something other than `any`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 // TODO: Use something other than `any`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 // TODO: Use something other than `any`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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\nexport enum FetchSource {\n default = \"default\",\n noCache = \"noCache\",\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maximumCacheDurationPolicy.spec.js","sourceRoot":"","sources":["../../../src/test/types/maximumCacheDurationPolicy.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,QAAQ,sBAAsB,EAAE;IAC5B,sCAAsC;IACtC,KAAK,SAAS,CAAC;IACf,KAAK,
|
|
1
|
+
{"version":3,"file":"maximumCacheDurationPolicy.spec.js","sourceRoot":"","sources":["../../../src/test/types/maximumCacheDurationPolicy.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,QAAQ,sBAAsB,EAAE;IAC5B,sCAAsC;IACtC,KAAK,SAAS,CAAC;IACf,KAAK,SAAW;QACZ,MAAM;IACV;QACI,WAAW,CAAC,sBAAsB,CAAC,CAAC;CAC3C","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentStorageServicePolicies } from \"../../storage\";\n\n/**\n * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING\n *\n * If you find this code doesn't compile, PLEASE STOP AND READ THIS!\n *\n * The maximumCacheDurationMs policy represents an important interop mechanism between the driver layer\n * and the runtime layer. The driver layer owns using the snapshot cache. Meanwhile the runtime layer\n * runs Garbage Collection, which requires that the max age of snapshots is constrained in order to reliably\n * compute when an object cannot possibly be referenced anymore and should be deleted.\n * To protect against data loss, the runtime will close the container if it finds the value of\n * maximumCacheDurationMs has changed (specifically, grown) in the lifetime of a file.\n *\n * So changing the type restrictions on this policy will likely lead to locking users out of existing documents.\n *\n * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING\n */\n\ndeclare function assertNever(x: never): void;\ndeclare const maximumCacheDurationMs: IDocumentStorageServicePolicies[\"maximumCacheDurationMs\"];\nswitch (maximumCacheDurationMs) {\n // These are the only two valid values\n case undefined:\n case 432_000_000:\n break;\n default:\n assertNever(maximumCacheDurationMs);\n}\n"]}
|
package/lib/urlResolver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,oBAAY,YAAY,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACrD,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE,CAAC;IACpC,SAAS,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAKzB,OAAO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;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAKzB,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAE9D;;;;;;OAMG;IACH,cAAc,CACV,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE,qBAAqB,GAC1C,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAED;;;EAGE;AACF,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAEH;;GAEG;AACH,oBAAY,YAAY;IAEpB,iBAAiB,4BAA4B;IAE7C,SAAS,cAAc;CAC1B;AAED,MAAM,WAAW,aAAa;IAC1B,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAG1C,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC;CACjC;AAED,OAAO,QAAQ,iCAAiC,CAAC;IAE7C,UAAiB,cAAe,SAAQ,OAAO,CAAC,aAAa,CAAC;KAAI;CACrE"}
|
package/lib/urlResolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AA4EA;;GAEG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,qDAAqD;IACrD,6DAA6C,CAAA;IAC7C,iDAAiD;IACjD,uCAAuB,CAAA;AAC3B,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest } from \"@fluidframework/core-interfaces\";\n\nexport type IResolvedUrl = IWebResolvedUrl | IFluidResolvedUrl;\n\nexport interface IResolvedUrlBase {\n type: string;\n}\n\nexport interface IWebResolvedUrl extends IResolvedUrlBase {\n type: \"web\";\n data: string;\n}\n\nexport interface IFluidResolvedUrl extends IResolvedUrlBase {\n type: \"fluid\";\n /**\n * The id of the container this resolved url is for.\n */\n id: string;\n url: string;\n tokens: { [name: string]: string; };\n endpoints: { [name: string]: string; };\n}\n\n/**\n * Container package info handed off to resolver.\n */\nexport interface IContainerPackageInfo {\n /**\n * Container package name.\n */\n name: string;\n}\n\nexport interface IUrlResolver {\n\n // Like DNS should be able to cache resolution requests. Then possibly just have a token provider go and do stuff?\n // the expiration of it could be relative to the lifetime of the token? Requests after need to refresh?\n // or do we split the token access from this?\n resolve(request: IRequest): Promise<IResolvedUrl | undefined>;\n\n /**\n * Creates a url for the created container with any data store path given in the relative url.\n * @param resolvedUrl - resolved url for the container.\n * @param relativeUrl - relative url containing data store path; '/' represents root path.\n * @param packageInfoSource - optional, represents container package information to be included in url.\n * @returns absolute url combining container url with dta store path and optional additional information.\n */\n getAbsoluteUrl(\n resolvedUrl: IResolvedUrl,\n relativeUrl: string,\n packageInfoSource?: IContainerPackageInfo,\n ): Promise<string>;\n}\n\n/**\n* Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL\n* for driver compatibility and preload information.\n*/\nexport interface DriverPreCheckInfo {\n /**\n * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.\n */\n codeDetailsHint?: string;\n\n /**\n * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for\n * improved performance.\n */\n criticalBootDomains?: string[];\n }\n\n/**\n * Additional key in the loader request header\n */\nexport enum DriverHeader {\n // Key to indicate whether the request for summarizer\n summarizingClient = \"fluid-client-summarizer\",\n // createNew information, specific to each driver\n createNew = \"createNew\",\n}\n\nexport interface IDriverHeader {\n [DriverHeader.summarizingClient]: boolean;\n [DriverHeader.createNew]: any;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface IRequestHeader extends Partial<IDriverHeader> { }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AA4EA;;GAEG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,qDAAqD;IACrD,6DAA6C,CAAA;IAC7C,iDAAiD;IACjD,uCAAuB,CAAA;AAC3B,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest } from \"@fluidframework/core-interfaces\";\n\nexport type IResolvedUrl = IWebResolvedUrl | IFluidResolvedUrl;\n\nexport interface IResolvedUrlBase {\n type: string;\n}\n\nexport interface IWebResolvedUrl extends IResolvedUrlBase {\n type: \"web\";\n data: string;\n}\n\nexport interface IFluidResolvedUrl extends IResolvedUrlBase {\n type: \"fluid\";\n /**\n * The id of the container this resolved url is for.\n */\n id: string;\n url: string;\n tokens: { [name: string]: string; };\n endpoints: { [name: string]: string; };\n}\n\n/**\n * Container package info handed off to resolver.\n */\nexport interface IContainerPackageInfo {\n /**\n * Container package name.\n */\n name: string;\n}\n\nexport interface IUrlResolver {\n\n // Like DNS should be able to cache resolution requests. Then possibly just have a token provider go and do stuff?\n // the expiration of it could be relative to the lifetime of the token? Requests after need to refresh?\n // or do we split the token access from this?\n resolve(request: IRequest): Promise<IResolvedUrl | undefined>;\n\n /**\n * Creates a url for the created container with any data store path given in the relative url.\n * @param resolvedUrl - resolved url for the container.\n * @param relativeUrl - relative url containing data store path; '/' represents root path.\n * @param packageInfoSource - optional, represents container package information to be included in url.\n * @returns absolute url combining container url with dta store path and optional additional information.\n */\n getAbsoluteUrl(\n resolvedUrl: IResolvedUrl,\n relativeUrl: string,\n packageInfoSource?: IContainerPackageInfo,\n ): Promise<string>;\n}\n\n/**\n* Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL\n* for driver compatibility and preload information.\n*/\nexport interface DriverPreCheckInfo {\n /**\n * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.\n */\n codeDetailsHint?: string;\n\n /**\n * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for\n * improved performance.\n */\n criticalBootDomains?: string[];\n }\n\n/**\n * Additional key in the loader request header\n */\nexport enum DriverHeader {\n // Key to indicate whether the request for summarizer\n summarizingClient = \"fluid-client-summarizer\",\n // createNew information, specific to each driver\n createNew = \"createNew\",\n}\n\nexport interface IDriverHeader {\n [DriverHeader.summarizingClient]: boolean;\n // TODO: Use something other than `any`.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [DriverHeader.createNew]: any;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface IRequestHeader extends Partial<IDriverHeader> { }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-definitions",
|
|
3
|
-
"version": "2.0.0-internal.2.
|
|
3
|
+
"version": "2.0.0-internal.2.3.0",
|
|
4
4
|
"description": "Fluid driver definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
43
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.
|
|
43
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
44
44
|
"@fluidframework/protocol-definitions": "^1.1.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@fluid-tools/build-cli": "^0.7.0",
|
|
48
48
|
"@fluidframework/build-common": "^1.1.0",
|
|
49
49
|
"@fluidframework/build-tools": "^0.7.0",
|
|
50
|
-
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.0.0-internal.2.
|
|
51
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
50
|
+
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.0.0-internal.2.2.0",
|
|
51
|
+
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
52
52
|
"@microsoft/api-extractor": "^7.22.2",
|
|
53
53
|
"@rushstack/eslint-config": "^2.5.1",
|
|
54
54
|
"concurrently": "^6.2.0",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"typescript": "~4.5.5"
|
|
60
60
|
},
|
|
61
61
|
"typeValidation": {
|
|
62
|
-
"version": "2.0.0-internal.2.
|
|
63
|
-
"baselineRange": ">=2.0.0-internal.2.
|
|
64
|
-
"baselineVersion": "2.0.0-internal.2.
|
|
62
|
+
"version": "2.0.0-internal.2.3.0",
|
|
63
|
+
"baselineRange": ">=2.0.0-internal.2.2.0 <2.0.0-internal.2.3.0",
|
|
64
|
+
"baselineVersion": "2.0.0-internal.2.2.0",
|
|
65
65
|
"broken": {}
|
|
66
66
|
}
|
|
67
67
|
}
|
package/src/driverError.ts
CHANGED
|
@@ -114,12 +114,21 @@ export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
|
114
114
|
* Base interface for all errors and warnings
|
|
115
115
|
*/
|
|
116
116
|
export interface IDriverErrorBase {
|
|
117
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Classification of what type of error this is, used programmatically by consumers to interpret the error
|
|
119
|
+
*/
|
|
118
120
|
readonly errorType: DriverErrorType;
|
|
119
|
-
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Free-form error message
|
|
124
|
+
*/
|
|
120
125
|
readonly message: string;
|
|
121
|
-
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* True indicates the caller may retry the failed action. False indicates it's a fatal error
|
|
129
|
+
*/
|
|
122
130
|
canRetry: boolean;
|
|
131
|
+
|
|
123
132
|
/**
|
|
124
133
|
* Best guess as to network conditions (online/offline) when the error arose.
|
|
125
134
|
* See OnlineStatus enum in driver-utils package for expected values.
|
package/src/storage.ts
CHANGED
|
@@ -93,7 +93,7 @@ export interface IDocumentDeltaStorageService {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// DO NOT INCREASE THIS TYPE'S VALUE - If a driver started using a larger value, GC would likely start closing sessions
|
|
96
|
-
export type FiveDaysMs =
|
|
96
|
+
export type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */
|
|
97
97
|
|
|
98
98
|
export interface IDocumentStorageServicePolicies {
|
|
99
99
|
readonly caching?: LoaderCachingPolicy;
|
|
@@ -130,6 +130,8 @@ export interface IDocumentStorageService extends Partial<IDisposable> {
|
|
|
130
130
|
* @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
|
|
131
131
|
* in debugging purposes to see why this call was made.
|
|
132
132
|
*/
|
|
133
|
+
// TODO: use `undefined` instead.
|
|
134
|
+
// eslint-disable-next-line @rushstack/no-new-null
|
|
133
135
|
getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
|
|
134
136
|
|
|
135
137
|
/**
|
|
@@ -144,6 +146,8 @@ export interface IDocumentStorageService extends Partial<IDisposable> {
|
|
|
144
146
|
* from storage.
|
|
145
147
|
*/
|
|
146
148
|
getVersions(
|
|
149
|
+
// TODO: use `undefined` instead.
|
|
150
|
+
// eslint-disable-next-line @rushstack/no-new-null
|
|
147
151
|
versionId: string | null,
|
|
148
152
|
count: number,
|
|
149
153
|
scenarioName?: string,
|
|
@@ -181,6 +185,8 @@ export interface IDocumentDeltaConnectionEvents extends IErrorEvent {
|
|
|
181
185
|
(event: "op", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);
|
|
182
186
|
(event: "signal", listener: (message: ISignalMessage) => void);
|
|
183
187
|
(event: "pong", listener: (latency: number) => void);
|
|
188
|
+
// TODO: Use something other than `any`.
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
184
190
|
(event: "error", listener: (error: any) => void);
|
|
185
191
|
}
|
|
186
192
|
|
|
@@ -255,6 +261,8 @@ export interface IDocumentDeltaConnection extends IDisposable, IEventProvider<ID
|
|
|
255
261
|
/**
|
|
256
262
|
* Submit a new signal to the server
|
|
257
263
|
*/
|
|
264
|
+
// TODO: Use something other than `any`.
|
|
265
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
258
266
|
submitSignal(message: any): void;
|
|
259
267
|
}
|
|
260
268
|
|
|
@@ -311,6 +319,8 @@ export interface IDocumentService {
|
|
|
311
319
|
* in storage, but client having stale local cache.
|
|
312
320
|
* If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.
|
|
313
321
|
*/
|
|
322
|
+
// TODO: Use something other than `any`.
|
|
323
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
314
324
|
dispose(error?: any): void;
|
|
315
325
|
}
|
|
316
326
|
|
package/src/urlResolver.ts
CHANGED
|
@@ -86,6 +86,8 @@ export enum DriverHeader {
|
|
|
86
86
|
|
|
87
87
|
export interface IDriverHeader {
|
|
88
88
|
[DriverHeader.summarizingClient]: boolean;
|
|
89
|
+
// TODO: Use something other than `any`.
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
91
|
[DriverHeader.createNew]: any;
|
|
90
92
|
}
|
|
91
93
|
|