@fluidframework/driver-definitions 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.217212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +0 -4
- package/api-report/driver-definitions.api.md +33 -33
- package/dist/driver-definitions-alpha.d.ts +51 -158
- package/dist/driver-definitions-beta.d.ts +73 -621
- package/dist/driver-definitions-public.d.ts +73 -621
- package/dist/driver-definitions-untrimmed.d.ts +71 -0
- package/dist/driverError.d.ts +23 -0
- package/dist/driverError.d.ts.map +1 -1
- package/dist/driverError.js +2 -0
- package/dist/driverError.js.map +1 -1
- package/dist/storage.d.ts +36 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +6 -0
- package/dist/storage.js.map +1 -1
- package/dist/urlResolver.d.ts +12 -0
- package/dist/urlResolver.d.ts.map +1 -1
- package/dist/urlResolver.js +1 -0
- package/dist/urlResolver.js.map +1 -1
- package/lib/driver-definitions-alpha.d.ts +51 -158
- package/lib/driver-definitions-beta.d.ts +73 -621
- package/lib/driver-definitions-public.d.ts +73 -621
- package/lib/driver-definitions-untrimmed.d.ts +71 -0
- package/lib/driverError.d.ts +23 -0
- package/lib/driverError.d.ts.map +1 -1
- package/lib/driverError.js +2 -0
- package/lib/driverError.js.map +1 -1
- package/lib/storage.d.ts +36 -0
- package/lib/storage.d.ts.map +1 -1
- package/lib/storage.js +6 -0
- package/lib/storage.js.map +1 -1
- package/lib/urlResolver.d.ts +12 -0
- package/lib/urlResolver.d.ts.map +1 -1
- package/lib/urlResolver.js +1 -0
- package/lib/urlResolver.js.map +1 -1
- package/package.json +4 -3
- package/src/driverError.ts +23 -0
- package/src/storage.ts +36 -0
- package/src/urlResolver.ts +12 -0
package/dist/storage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAuRH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC9B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACT,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B;AA2GD,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACpB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDisposable,\n\tIEventProvider,\n\tIErrorEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tConnectionMode,\n\tIClient,\n\tIClientConfiguration,\n\tICreateBlobResponse,\n\tIDocumentMessage,\n\tINack,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tITokenClaims,\n\tIVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAnyDriverError } from \"./driverError\";\nimport { IResolvedUrl } from \"./urlResolver\";\n\nexport interface IDeltasFetchResult {\n\t/**\n\t * Sequential set of messages starting from 'from' sequence number.\n\t * May be partial result, i.e. not fulfill original request in full.\n\t */\n\tmessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * If true, storage only partially fulfilled request, but has more ops\n\t * If false, the request was fulfilled. If less ops were returned then\n\t * requested, then storage does not have more ops in this range.\n\t */\n\tpartialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the inclusive sequence number range\n\t * @param tenantId - Id of the tenant.\n\t * @param id - document id.\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tget(\n\t\ttenantId: string,\n\t\tid: string,\n\t\tfrom: number, // inclusive\n\t\tto: number, // exclusive\n\t\tfetchReason?: string,\n\t): Promise<IDeltasFetchResult>;\n}\n\nexport type IStreamResult<T> = { done: true } | { done: false; value: T };\n\n/**\n * Read interface for the Queue\n */\nexport interface IStream<T> {\n\tread(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDocumentDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the exclusive sequence number range\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param abortSignal - signal that aborts operation\n\t * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t\tfetchReason?: string,\n\t): IStream<ISequencedDocumentMessage[]>;\n}\n\n// DO NOT INCREASE THIS TYPE'S VALUE\n// If a driver started using a larger value,\n// internal assumptions of the Runtime's GC feature will be violated\n// DO NOT INCREASE THIS TYPE'S VALUE\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\n/**\n * Policies describing attributes or characteristics of the driver's storage service,\n * to direct how other components interact with the driver\n */\nexport interface IDocumentStorageServicePolicies {\n\t/**\n\t * Should the Loader implement any sort of pre-fetching or caching mechanism?\n\t */\n\treadonly caching?: LoaderCachingPolicy;\n\n\t/**\n\t * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used\n\t * in applications where Garbage Collection is enabled. Otherwise data loss may occur.\n\t *\n\t * This policy pertains to requests for the latest snapshot from the service.\n\t * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.\n\t * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n\t */\n\treadonly maximumCacheDurationMs?: FiveDaysMs;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n\trepositoryUrl: string;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies;\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n\t(event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n\t(event: \"disconnect\", listener: (reason: IAnyDriverError) => void);\n\t(event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n\t(event: \"signal\", listener: (message: ISignalMessage | ISignalMessage[]) => void);\n\t(event: \"pong\", listener: (latency: number) => void);\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(event: \"error\", listener: (error: any) => void);\n}\n\nexport interface IDocumentDeltaConnection\n\textends IDisposable,\n\t\tIEventProvider<IDocumentDeltaConnectionEvents> {\n\t/**\n\t * ClientID for the connection\n\t */\n\tclientId: string;\n\n\t/**\n\t * Claims for the client\n\t */\n\tclaims: ITokenClaims;\n\n\t/**\n\t * Mode of the client\n\t */\n\tmode: ConnectionMode;\n\n\t/**\n\t * Whether the connection was made to a new or existing document\n\t */\n\texisting: boolean;\n\n\t/**\n\t * Protocol version being used with the service\n\t */\n\tversion: string;\n\n\t/**\n\t * Messages sent during the connection\n\t */\n\tinitialMessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * Signals sent during the connection\n\t */\n\tinitialSignals: ISignalMessage[];\n\n\t/**\n\t * Prior clients already connected.\n\t */\n\tinitialClients: ISignalClient[];\n\n\t/**\n\t * Configuration details provided by the service\n\t */\n\tserviceConfiguration: IClientConfiguration;\n\n\t/**\n\t * Last known sequence number to ordering service at the time of connection\n\t * It may lap actual last sequence number (quite a bit, if container is very active).\n\t * But it's best information for client to figure out how far it is behind, at least\n\t * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n\t * that is likely to be more up-to-date.\n\t */\n\tcheckpointSequenceNumber?: number;\n\n\t/**\n\t * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n\t * it could contain info like build version, environment, region etc. These properties can be logged by client\n\t * to better understand server environment etc. and use it in case error occurs.\n\t * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n\t */\n\trelayServiceAgent?: string;\n\n\t/**\n\t * Submit a new message to the server\n\t */\n\tsubmit(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Submits a new signal to the server\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsubmitSignal(content: any, targetClientId?: string): void;\n}\n\nexport enum LoaderCachingPolicy {\n\t/**\n\t * The loader should not implement any prefetching or caching policy.\n\t */\n\tNoCaching,\n\n\t/**\n\t * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n\t */\n\tPrefetch,\n}\n\nexport interface IDocumentServicePolicies {\n\t/**\n\t * Do not connect to delta stream\n\t */\n\treadonly storageOnly?: boolean;\n\n\t/**\n\t * Summarizer uploads the protocol tree too when summarizing.\n\t */\n\treadonly summarizeProtocolTree?: boolean;\n}\n\nexport interface IDocumentService {\n\tresolvedUrl: IResolvedUrl;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\tpolicies?: IDocumentServicePolicies;\n\n\t/**\n\t * Access to storage associated with the document\n\t */\n\tconnectToStorage(): Promise<IDocumentStorageService>;\n\n\t/**\n\t * Access to delta storage associated with the document\n\t */\n\tconnectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n\t/**\n\t * Subscribes to the document delta stream\n\t */\n\tconnectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n\t/**\n\t * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n\t * Useful for storage to commit any pending state if any (including any local caching).\n\t * Please note that it does not remove the need for caller to close all active delta connections,\n\t * as storage may not be tracking such objects.\n\t * @param error - tells if container (and storage) are closed due to critical error.\n\t * Error might be due to disconnect between client & server knowledge about file, like file being overwritten\n\t * in storage, but client having stale local cache.\n\t * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdispose(error?: any): void;\n}\n\nexport interface IDocumentServiceFactory {\n\t/**\n\t * Creates the document service after extracting different endpoints URLs from a resolved URL.\n\t *\n\t * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t *\n\t * @returns An instance of {@link IDocumentService}.\n\t */\n\tcreateDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n\n\t/**\n\t * Creates a new document with the provided options. Returns the document service.\n\t *\n\t * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n\t * should be posted later, before connecting to ordering service.\n\t * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t */\n\tcreateContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n */\nexport interface ISummaryContext {\n\t/**\n\t * Parent summary proposed handle (from summary op)\n\t */\n\treadonly proposalHandle: string | undefined;\n\n\t/**\n\t * Parent summary acked handle (from summary ack)\n\t */\n\treadonly ackHandle: string | undefined;\n\n\treadonly referenceSequenceNumber: number;\n}\n\nexport enum FetchSource {\n\tdefault = \"default\",\n\tnoCache = \"noCache\",\n}\n"]}
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2SH;;GAEG;AACH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC9B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACT,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B;AAqHD;;GAEG;AACH,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACpB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDisposable,\n\tIEventProvider,\n\tIErrorEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tConnectionMode,\n\tIClient,\n\tIClientConfiguration,\n\tICreateBlobResponse,\n\tIDocumentMessage,\n\tINack,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tITokenClaims,\n\tIVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAnyDriverError } from \"./driverError\";\nimport { IResolvedUrl } from \"./urlResolver\";\n\n/**\n * @internal\n */\nexport interface IDeltasFetchResult {\n\t/**\n\t * Sequential set of messages starting from 'from' sequence number.\n\t * May be partial result, i.e. not fulfill original request in full.\n\t */\n\tmessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * If true, storage only partially fulfilled request, but has more ops\n\t * If false, the request was fulfilled. If less ops were returned then\n\t * requested, then storage does not have more ops in this range.\n\t */\n\tpartialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @internal\n */\nexport interface IDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the inclusive sequence number range\n\t * @param tenantId - Id of the tenant.\n\t * @param id - document id.\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tget(\n\t\ttenantId: string,\n\t\tid: string,\n\t\tfrom: number, // inclusive\n\t\tto: number, // exclusive\n\t\tfetchReason?: string,\n\t): Promise<IDeltasFetchResult>;\n}\n\n/**\n * @alpha\n */\nexport type IStreamResult<T> = { done: true } | { done: false; value: T };\n\n/**\n * Read interface for the Queue\n * @alpha\n */\nexport interface IStream<T> {\n\tread(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n * @alpha\n */\nexport interface IDocumentDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the exclusive sequence number range\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param abortSignal - signal that aborts operation\n\t * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n\t * @param fetchReason - Reason for fetching the messages, for logging.\n\t * Example, gap between seq number of Op on wire and known seq number.\n\t * It can be logged by spo which could help in debugging sessions if any issue occurs.\n\t */\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t\tfetchReason?: string,\n\t): IStream<ISequencedDocumentMessage[]>;\n}\n\n// DO NOT INCREASE THIS TYPE'S VALUE\n// If a driver started using a larger value,\n// internal assumptions of the Runtime's GC feature will be violated\n// DO NOT INCREASE THIS TYPE'S VALUE\n/**\n * @alpha\n */\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\n/**\n * Policies describing attributes or characteristics of the driver's storage service,\n * to direct how other components interact with the driver\n * @alpha\n */\nexport interface IDocumentStorageServicePolicies {\n\t/**\n\t * Should the Loader implement any sort of pre-fetching or caching mechanism?\n\t */\n\treadonly caching?: LoaderCachingPolicy;\n\n\t/**\n\t * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used\n\t * in applications where Garbage Collection is enabled. Otherwise data loss may occur.\n\t *\n\t * This policy pertains to requests for the latest snapshot from the service.\n\t * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.\n\t * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n\t */\n\treadonly maximumCacheDurationMs?: FiveDaysMs;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n * @alpha\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n\trepositoryUrl: string;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies;\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\n/**\n * @alpha\n */\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n\t(event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n\t(event: \"disconnect\", listener: (reason: IAnyDriverError) => void);\n\t(event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n\t(event: \"signal\", listener: (message: ISignalMessage | ISignalMessage[]) => void);\n\t(event: \"pong\", listener: (latency: number) => void);\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(event: \"error\", listener: (error: any) => void);\n}\n\n/**\n * @alpha\n */\nexport interface IDocumentDeltaConnection\n\textends IDisposable,\n\t\tIEventProvider<IDocumentDeltaConnectionEvents> {\n\t/**\n\t * ClientID for the connection\n\t */\n\tclientId: string;\n\n\t/**\n\t * Claims for the client\n\t */\n\tclaims: ITokenClaims;\n\n\t/**\n\t * Mode of the client\n\t */\n\tmode: ConnectionMode;\n\n\t/**\n\t * Whether the connection was made to a new or existing document\n\t */\n\texisting: boolean;\n\n\t/**\n\t * Protocol version being used with the service\n\t */\n\tversion: string;\n\n\t/**\n\t * Messages sent during the connection\n\t */\n\tinitialMessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * Signals sent during the connection\n\t */\n\tinitialSignals: ISignalMessage[];\n\n\t/**\n\t * Prior clients already connected.\n\t */\n\tinitialClients: ISignalClient[];\n\n\t/**\n\t * Configuration details provided by the service\n\t */\n\tserviceConfiguration: IClientConfiguration;\n\n\t/**\n\t * Last known sequence number to ordering service at the time of connection\n\t * It may lap actual last sequence number (quite a bit, if container is very active).\n\t * But it's best information for client to figure out how far it is behind, at least\n\t * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n\t * that is likely to be more up-to-date.\n\t */\n\tcheckpointSequenceNumber?: number;\n\n\t/**\n\t * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n\t * it could contain info like build version, environment, region etc. These properties can be logged by client\n\t * to better understand server environment etc. and use it in case error occurs.\n\t * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n\t */\n\trelayServiceAgent?: string;\n\n\t/**\n\t * Submit a new message to the server\n\t */\n\tsubmit(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Submits a new signal to the server\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsubmitSignal(content: any, targetClientId?: string): void;\n}\n\n/**\n * @alpha\n */\nexport enum LoaderCachingPolicy {\n\t/**\n\t * The loader should not implement any prefetching or caching policy.\n\t */\n\tNoCaching,\n\n\t/**\n\t * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n\t */\n\tPrefetch,\n}\n\n/**\n * @alpha\n */\nexport interface IDocumentServicePolicies {\n\t/**\n\t * Do not connect to delta stream\n\t */\n\treadonly storageOnly?: boolean;\n\n\t/**\n\t * Summarizer uploads the protocol tree too when summarizing.\n\t */\n\treadonly summarizeProtocolTree?: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface IDocumentService {\n\tresolvedUrl: IResolvedUrl;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\tpolicies?: IDocumentServicePolicies;\n\n\t/**\n\t * Access to storage associated with the document\n\t */\n\tconnectToStorage(): Promise<IDocumentStorageService>;\n\n\t/**\n\t * Access to delta storage associated with the document\n\t */\n\tconnectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n\t/**\n\t * Subscribes to the document delta stream\n\t */\n\tconnectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n\t/**\n\t * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n\t * Useful for storage to commit any pending state if any (including any local caching).\n\t * Please note that it does not remove the need for caller to close all active delta connections,\n\t * as storage may not be tracking such objects.\n\t * @param error - tells if container (and storage) are closed due to critical error.\n\t * Error might be due to disconnect between client & server knowledge about file, like file being overwritten\n\t * in storage, but client having stale local cache.\n\t * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdispose(error?: any): void;\n}\n\n/**\n * @alpha\n */\nexport interface IDocumentServiceFactory {\n\t/**\n\t * Creates the document service after extracting different endpoints URLs from a resolved URL.\n\t *\n\t * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t *\n\t * @returns An instance of {@link IDocumentService}.\n\t */\n\tcreateDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n\n\t/**\n\t * Creates a new document with the provided options. Returns the document service.\n\t *\n\t * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n\t * should be posted later, before connecting to ordering service.\n\t * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t */\n\tcreateContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n * @alpha\n */\nexport interface ISummaryContext {\n\t/**\n\t * Parent summary proposed handle (from summary op)\n\t */\n\treadonly proposalHandle: string | undefined;\n\n\t/**\n\t * Parent summary acked handle (from summary ack)\n\t */\n\treadonly ackHandle: string | undefined;\n\n\treadonly referenceSequenceNumber: number;\n}\n\n/**\n * @alpha\n */\nexport enum FetchSource {\n\tdefault = \"default\",\n\tnoCache = \"noCache\",\n}\n"]}
|
package/dist/urlResolver.d.ts
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IRequest } from "@fluidframework/core-interfaces";
|
|
6
|
+
/**
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
6
9
|
export interface IResolvedUrl {
|
|
7
10
|
type: "fluid";
|
|
8
11
|
/**
|
|
@@ -19,6 +22,7 @@ export interface IResolvedUrl {
|
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* Container package info handed off to resolver.
|
|
25
|
+
* @alpha
|
|
22
26
|
*/
|
|
23
27
|
export interface IContainerPackageInfo {
|
|
24
28
|
/**
|
|
@@ -26,6 +30,9 @@ export interface IContainerPackageInfo {
|
|
|
26
30
|
*/
|
|
27
31
|
name: string;
|
|
28
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* @alpha
|
|
35
|
+
*/
|
|
29
36
|
export interface IUrlResolver {
|
|
30
37
|
resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
|
|
31
38
|
/**
|
|
@@ -40,6 +47,7 @@ export interface IUrlResolver {
|
|
|
40
47
|
/**
|
|
41
48
|
* Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL
|
|
42
49
|
* for driver compatibility and preload information.
|
|
50
|
+
* @internal
|
|
43
51
|
*/
|
|
44
52
|
export interface DriverPreCheckInfo {
|
|
45
53
|
/**
|
|
@@ -54,11 +62,15 @@ export interface DriverPreCheckInfo {
|
|
|
54
62
|
}
|
|
55
63
|
/**
|
|
56
64
|
* Additional key in the loader request header
|
|
65
|
+
* @internal
|
|
57
66
|
*/
|
|
58
67
|
export declare enum DriverHeader {
|
|
59
68
|
summarizingClient = "fluid-client-summarizer",
|
|
60
69
|
createNew = "createNew"
|
|
61
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
62
74
|
export interface IDriverHeader {
|
|
63
75
|
[DriverHeader.summarizingClient]: boolean;
|
|
64
76
|
[DriverHeader.createNew]: any;
|
|
@@ -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,MAAM,WAAW,YAAY;IAC5B,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,CAAA;KAAE,CAAC;IACnC,SAAS,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtC;AAED
|
|
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;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,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,CAAA;KAAE,CAAC;IACnC,SAAS,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAI5B,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAE9D;;;;;;OAMG;IACH,cAAc,CACb,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE,qBAAqB,GACvC,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;GAGG;AACH,oBAAY,YAAY;IAEvB,iBAAiB,4BAA4B;IAE7C,SAAS,cAAc;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAG1C,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC;CAC9B;AAED,OAAO,QAAQ,iCAAiC,CAAC;IAEhD,UAAiB,cAAe,SAAQ,OAAO,CAAC,aAAa,CAAC;KAAG;CACjE"}
|
package/dist/urlResolver.js
CHANGED
package/dist/urlResolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":";;;AAwEA;;;GAGG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACvB,qDAAqD;IACrD,6DAA6C,CAAA;IAC7C,iDAAiD;IACjD,uCAAuB,CAAA;AACxB,CAAC,EALW,YAAY,4BAAZ,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\n/**\n * @alpha\n */\nexport interface IResolvedUrl {\n\ttype: \"fluid\";\n\t/**\n\t * The id of the container this resolved url is for.\n\t */\n\tid: string;\n\turl: string;\n\ttokens: { [name: string]: string };\n\tendpoints: { [name: string]: string };\n}\n\n/**\n * Container package info handed off to resolver.\n * @alpha\n */\nexport interface IContainerPackageInfo {\n\t/**\n\t * Container package name.\n\t */\n\tname: string;\n}\n\n/**\n * @alpha\n */\nexport interface IUrlResolver {\n\t// Like DNS should be able to cache resolution requests. Then possibly just have a token provider go and do stuff?\n\t// the expiration of it could be relative to the lifetime of the token? Requests after need to refresh?\n\t// or do we split the token access from this?\n\tresolve(request: IRequest): Promise<IResolvedUrl | undefined>;\n\n\t/**\n\t * Creates a url for the created container with any data store path given in the relative url.\n\t * @param resolvedUrl - resolved url for the container.\n\t * @param relativeUrl - relative url containing data store path; '/' represents root path.\n\t * @param packageInfoSource - optional, represents container package information to be included in url.\n\t * @returns absolute url combining container url with dta store path and optional additional information.\n\t */\n\tgetAbsoluteUrl(\n\t\tresolvedUrl: IResolvedUrl,\n\t\trelativeUrl: string,\n\t\tpackageInfoSource?: IContainerPackageInfo,\n\t): 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 * @internal\n */\nexport interface DriverPreCheckInfo {\n\t/**\n\t * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.\n\t */\n\tcodeDetailsHint?: string;\n\n\t/**\n\t * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for\n\t * improved performance.\n\t */\n\tcriticalBootDomains?: string[];\n}\n\n/**\n * Additional key in the loader request header\n * @internal\n */\nexport enum DriverHeader {\n\t// Key to indicate whether the request for summarizer\n\tsummarizingClient = \"fluid-client-summarizer\",\n\t// createNew information, specific to each driver\n\tcreateNew = \"createNew\",\n}\n\n/**\n * @internal\n */\nexport interface IDriverHeader {\n\t[DriverHeader.summarizingClient]: boolean;\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[DriverHeader.createNew]: any;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n\t// eslint-disable-next-line @typescript-eslint/no-empty-interface\n\texport interface IRequestHeader extends Partial<IDriverHeader> {}\n}\n"]}
|
|
@@ -18,13 +18,14 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
|
18
18
|
import { ITokenClaims } from '@fluidframework/protocol-definitions';
|
|
19
19
|
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
/* Excluded from this release type: DriverError */
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Driver Error types
|
|
25
25
|
* Lists types that are likely to be used by all drivers
|
|
26
26
|
*
|
|
27
27
|
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
28
|
+
* @alpha
|
|
28
29
|
*/
|
|
29
30
|
export declare enum DriverErrorType {
|
|
30
31
|
/**
|
|
@@ -110,114 +111,23 @@ export declare enum DriverErrorType {
|
|
|
110
111
|
outOfStorageError = "outOfStorageError"
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
|
|
114
|
-
* Different error types the Driver may report out to the Host.
|
|
115
|
-
*/
|
|
116
|
-
export declare const DriverErrorTypes: {
|
|
117
|
-
/**
|
|
118
|
-
* Some non-categorized (below) networking error
|
|
119
|
-
* Include errors like fatal server error (usually 500).
|
|
120
|
-
*/
|
|
121
|
-
readonly genericNetworkError: "genericNetworkError";
|
|
122
|
-
/**
|
|
123
|
-
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
124
|
-
*/
|
|
125
|
-
readonly authorizationError: "authorizationError";
|
|
126
|
-
/**
|
|
127
|
-
* File not found, or file deleted during session
|
|
128
|
-
*/
|
|
129
|
-
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
130
|
-
/**
|
|
131
|
-
* We can not reach server due to computer being offline.
|
|
132
|
-
*/
|
|
133
|
-
readonly offlineError: "offlineError";
|
|
134
|
-
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
135
|
-
/**
|
|
136
|
-
* User does not have write permissions to a file, but is changing content of a file.
|
|
137
|
-
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
138
|
-
*/
|
|
139
|
-
readonly writeError: "writeError";
|
|
140
|
-
/**
|
|
141
|
-
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
142
|
-
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
143
|
-
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
144
|
-
* CSP violation, etc.
|
|
145
|
-
*/
|
|
146
|
-
readonly fetchFailure: "fetchFailure";
|
|
147
|
-
/**
|
|
148
|
-
* This error occurs when token provider fails to fetch orderer token
|
|
149
|
-
*/
|
|
150
|
-
readonly fetchTokenError: "fetchTokenError";
|
|
151
|
-
/**
|
|
152
|
-
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
153
|
-
*/
|
|
154
|
-
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
155
|
-
/**
|
|
156
|
-
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
157
|
-
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
158
|
-
* and storage / driver / loader detects such mismatch.
|
|
159
|
-
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
160
|
-
*/
|
|
161
|
-
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
162
|
-
/**
|
|
163
|
-
* The document is read-only and delta stream connection is forbidden.
|
|
164
|
-
*/
|
|
165
|
-
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
166
|
-
/**
|
|
167
|
-
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
168
|
-
* location, then this error is thrown to let the client know about the new location info.
|
|
169
|
-
*/
|
|
170
|
-
readonly locationRedirection: "locationRedirection";
|
|
171
|
-
/**
|
|
172
|
-
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
173
|
-
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
174
|
-
* "fluidInvalidSchema"
|
|
175
|
-
*/
|
|
176
|
-
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
177
|
-
/**
|
|
178
|
-
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
179
|
-
*/
|
|
180
|
-
readonly fileIsLocked: "fileIsLocked";
|
|
181
|
-
/**
|
|
182
|
-
* Storage is out of space
|
|
183
|
-
*/
|
|
184
|
-
readonly outOfStorageError: "outOfStorageError";
|
|
185
|
-
readonly genericError: "genericError";
|
|
186
|
-
readonly throttlingError: "throttlingError";
|
|
187
|
-
readonly usageError: "usageError";
|
|
188
|
-
};
|
|
114
|
+
/* Excluded from this release type: DriverErrorTypes */
|
|
189
115
|
|
|
190
|
-
|
|
116
|
+
/* Excluded from this release type: DriverHeader */
|
|
191
117
|
|
|
192
|
-
|
|
193
|
-
* Additional key in the loader request header
|
|
194
|
-
*/
|
|
195
|
-
export declare enum DriverHeader {
|
|
196
|
-
summarizingClient = "fluid-client-summarizer",
|
|
197
|
-
createNew = "createNew"
|
|
198
|
-
}
|
|
118
|
+
/* Excluded from this release type: DriverPreCheckInfo */
|
|
199
119
|
|
|
200
120
|
/**
|
|
201
|
-
*
|
|
202
|
-
* for driver compatibility and preload information.
|
|
121
|
+
* @alpha
|
|
203
122
|
*/
|
|
204
|
-
export declare interface DriverPreCheckInfo {
|
|
205
|
-
/**
|
|
206
|
-
* A code details hint that can potentially be used to prefetch container code prior to having a snapshot.
|
|
207
|
-
*/
|
|
208
|
-
codeDetailsHint?: string;
|
|
209
|
-
/**
|
|
210
|
-
* Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for
|
|
211
|
-
* improved performance.
|
|
212
|
-
*/
|
|
213
|
-
criticalBootDomains?: string[];
|
|
214
|
-
}
|
|
215
|
-
|
|
216
123
|
export declare enum FetchSource {
|
|
217
124
|
default = "default",
|
|
218
125
|
noCache = "noCache"
|
|
219
126
|
}
|
|
220
127
|
|
|
128
|
+
/**
|
|
129
|
+
* @alpha
|
|
130
|
+
*/
|
|
221
131
|
export declare type FiveDaysMs = 432000000;
|
|
222
132
|
|
|
223
133
|
/**
|
|
@@ -228,19 +138,17 @@ export declare type FiveDaysMs = 432000000;
|
|
|
228
138
|
* "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
|
|
229
139
|
* It will be either DriverErrorType or the specific driver's specialized error type enum,
|
|
230
140
|
* but we can't reference a specific driver's error type enum in this code.
|
|
141
|
+
* @alpha
|
|
231
142
|
*/
|
|
232
143
|
export declare interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
233
144
|
readonly errorType: string;
|
|
234
145
|
}
|
|
235
146
|
|
|
236
|
-
|
|
237
|
-
readonly errorType: DriverErrorType.authorizationError;
|
|
238
|
-
readonly claims?: string;
|
|
239
|
-
readonly tenantId?: string;
|
|
240
|
-
}
|
|
147
|
+
/* Excluded from this release type: IAuthorizationError */
|
|
241
148
|
|
|
242
149
|
/**
|
|
243
150
|
* Container package info handed off to resolver.
|
|
151
|
+
* @alpha
|
|
244
152
|
*/
|
|
245
153
|
export declare interface IContainerPackageInfo {
|
|
246
154
|
/**
|
|
@@ -249,39 +157,13 @@ export declare interface IContainerPackageInfo {
|
|
|
249
157
|
name: string;
|
|
250
158
|
}
|
|
251
159
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
* May be partial result, i.e. not fulfill original request in full.
|
|
256
|
-
*/
|
|
257
|
-
messages: ISequencedDocumentMessage[];
|
|
258
|
-
/**
|
|
259
|
-
* If true, storage only partially fulfilled request, but has more ops
|
|
260
|
-
* If false, the request was fulfilled. If less ops were returned then
|
|
261
|
-
* requested, then storage does not have more ops in this range.
|
|
262
|
-
*/
|
|
263
|
-
partialResult: boolean;
|
|
264
|
-
}
|
|
160
|
+
/* Excluded from this release type: IDeltasFetchResult */
|
|
161
|
+
|
|
162
|
+
/* Excluded from this release type: IDeltaStorageService */
|
|
265
163
|
|
|
266
164
|
/**
|
|
267
|
-
*
|
|
165
|
+
* @alpha
|
|
268
166
|
*/
|
|
269
|
-
export declare interface IDeltaStorageService {
|
|
270
|
-
/**
|
|
271
|
-
* Retrieves all the delta operations within the inclusive sequence number range
|
|
272
|
-
* @param tenantId - Id of the tenant.
|
|
273
|
-
* @param id - document id.
|
|
274
|
-
* @param from - first op to retrieve (inclusive)
|
|
275
|
-
* @param to - first op not to retrieve (exclusive end)
|
|
276
|
-
* @param fetchReason - Reason for fetching the messages, for logging.
|
|
277
|
-
* Example, gap between seq number of Op on wire and known seq number.
|
|
278
|
-
* It can be logged by spo which could help in debugging sessions if any issue occurs.
|
|
279
|
-
*/
|
|
280
|
-
get(tenantId: string, id: string, from: number, // inclusive
|
|
281
|
-
to: number, // exclusive
|
|
282
|
-
fetchReason?: string): Promise<IDeltasFetchResult>;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
167
|
export declare interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {
|
|
286
168
|
/**
|
|
287
169
|
* ClientID for the connection
|
|
@@ -344,6 +226,9 @@ export declare interface IDocumentDeltaConnection extends IDisposable, IEventPro
|
|
|
344
226
|
submitSignal(content: any, targetClientId?: string): void;
|
|
345
227
|
}
|
|
346
228
|
|
|
229
|
+
/**
|
|
230
|
+
* @alpha
|
|
231
|
+
*/
|
|
347
232
|
export declare interface IDocumentDeltaConnectionEvents extends IErrorEvent {
|
|
348
233
|
(event: "nack", listener: (documentId: string, message: INack[]) => void): any;
|
|
349
234
|
(event: "disconnect", listener: (reason: IAnyDriverError) => void): any;
|
|
@@ -355,6 +240,7 @@ export declare interface IDocumentDeltaConnectionEvents extends IErrorEvent {
|
|
|
355
240
|
|
|
356
241
|
/**
|
|
357
242
|
* Interface to provide access to stored deltas for a shared object
|
|
243
|
+
* @alpha
|
|
358
244
|
*/
|
|
359
245
|
export declare interface IDocumentDeltaStorageService {
|
|
360
246
|
/**
|
|
@@ -370,6 +256,9 @@ export declare interface IDocumentDeltaStorageService {
|
|
|
370
256
|
fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean, fetchReason?: string): IStream<ISequencedDocumentMessage[]>;
|
|
371
257
|
}
|
|
372
258
|
|
|
259
|
+
/**
|
|
260
|
+
* @alpha
|
|
261
|
+
*/
|
|
373
262
|
export declare interface IDocumentService {
|
|
374
263
|
resolvedUrl: IResolvedUrl;
|
|
375
264
|
/**
|
|
@@ -401,6 +290,9 @@ export declare interface IDocumentService {
|
|
|
401
290
|
dispose(error?: any): void;
|
|
402
291
|
}
|
|
403
292
|
|
|
293
|
+
/**
|
|
294
|
+
* @alpha
|
|
295
|
+
*/
|
|
404
296
|
export declare interface IDocumentServiceFactory {
|
|
405
297
|
/**
|
|
406
298
|
* Creates the document service after extracting different endpoints URLs from a resolved URL.
|
|
@@ -428,6 +320,9 @@ export declare interface IDocumentServiceFactory {
|
|
|
428
320
|
createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
429
321
|
}
|
|
430
322
|
|
|
323
|
+
/**
|
|
324
|
+
* @alpha
|
|
325
|
+
*/
|
|
431
326
|
export declare interface IDocumentServicePolicies {
|
|
432
327
|
/**
|
|
433
328
|
* Do not connect to delta stream
|
|
@@ -441,6 +336,7 @@ export declare interface IDocumentServicePolicies {
|
|
|
441
336
|
|
|
442
337
|
/**
|
|
443
338
|
* Interface to provide access to snapshots saved for a shared object
|
|
339
|
+
* @alpha
|
|
444
340
|
*/
|
|
445
341
|
export declare interface IDocumentStorageService extends Partial<IDisposable> {
|
|
446
342
|
repositoryUrl: string;
|
|
@@ -492,6 +388,7 @@ export declare interface IDocumentStorageService extends Partial<IDisposable> {
|
|
|
492
388
|
/**
|
|
493
389
|
* Policies describing attributes or characteristics of the driver's storage service,
|
|
494
390
|
* to direct how other components interact with the driver
|
|
391
|
+
* @alpha
|
|
495
392
|
*/
|
|
496
393
|
export declare interface IDocumentStorageServicePolicies {
|
|
497
394
|
/**
|
|
@@ -509,17 +406,11 @@ export declare interface IDocumentStorageServicePolicies {
|
|
|
509
406
|
readonly maximumCacheDurationMs?: FiveDaysMs;
|
|
510
407
|
}
|
|
511
408
|
|
|
512
|
-
|
|
513
|
-
* Having this uber interface without types that have their own interfaces
|
|
514
|
-
* allows compiler to differentiate interfaces based on error type
|
|
515
|
-
*/
|
|
516
|
-
export declare interface IDriverBasicError extends IDriverErrorBase {
|
|
517
|
-
readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.fetchTokenError | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError | DriverErrorType.fileIsLocked | DriverErrorType.outOfStorageError;
|
|
518
|
-
readonly statusCode?: number;
|
|
519
|
-
}
|
|
409
|
+
/* Excluded from this release type: IDriverBasicError */
|
|
520
410
|
|
|
521
411
|
/**
|
|
522
412
|
* Base interface for all errors and warnings
|
|
413
|
+
* @alpha
|
|
523
414
|
*/
|
|
524
415
|
export declare interface IDriverErrorBase {
|
|
525
416
|
/**
|
|
@@ -547,21 +438,15 @@ export declare interface IDriverErrorBase {
|
|
|
547
438
|
endpointReached?: boolean;
|
|
548
439
|
}
|
|
549
440
|
|
|
550
|
-
|
|
551
|
-
[DriverHeader.summarizingClient]: boolean;
|
|
552
|
-
[DriverHeader.createNew]: any;
|
|
553
|
-
}
|
|
441
|
+
/* Excluded from this release type: IDriverHeader */
|
|
554
442
|
|
|
555
|
-
|
|
556
|
-
readonly errorType: DriverErrorType.genericNetworkError;
|
|
557
|
-
readonly statusCode?: number;
|
|
558
|
-
}
|
|
443
|
+
/* Excluded from this release type: IGenericNetworkError */
|
|
559
444
|
|
|
560
|
-
|
|
561
|
-
readonly errorType: DriverErrorType.locationRedirection;
|
|
562
|
-
readonly redirectUrl: IResolvedUrl;
|
|
563
|
-
}
|
|
445
|
+
/* Excluded from this release type: ILocationRedirectionError */
|
|
564
446
|
|
|
447
|
+
/**
|
|
448
|
+
* @alpha
|
|
449
|
+
*/
|
|
565
450
|
export declare interface IResolvedUrl {
|
|
566
451
|
type: "fluid";
|
|
567
452
|
/**
|
|
@@ -579,11 +464,15 @@ export declare interface IResolvedUrl {
|
|
|
579
464
|
|
|
580
465
|
/**
|
|
581
466
|
* Read interface for the Queue
|
|
467
|
+
* @alpha
|
|
582
468
|
*/
|
|
583
469
|
export declare interface IStream<T> {
|
|
584
470
|
read(): Promise<IStreamResult<T>>;
|
|
585
471
|
}
|
|
586
472
|
|
|
473
|
+
/**
|
|
474
|
+
* @alpha
|
|
475
|
+
*/
|
|
587
476
|
export declare type IStreamResult<T> = {
|
|
588
477
|
done: true;
|
|
589
478
|
} | {
|
|
@@ -594,6 +483,7 @@ export declare type IStreamResult<T> = {
|
|
|
594
483
|
/**
|
|
595
484
|
* Context for uploading a summary to storage.
|
|
596
485
|
* Indicates the previously acked summary.
|
|
486
|
+
* @alpha
|
|
597
487
|
*/
|
|
598
488
|
export declare interface ISummaryContext {
|
|
599
489
|
/**
|
|
@@ -607,11 +497,11 @@ export declare interface ISummaryContext {
|
|
|
607
497
|
readonly referenceSequenceNumber: number;
|
|
608
498
|
}
|
|
609
499
|
|
|
610
|
-
|
|
611
|
-
readonly errorType: DriverErrorType.throttlingError;
|
|
612
|
-
readonly retryAfterSeconds: number;
|
|
613
|
-
}
|
|
500
|
+
/* Excluded from this release type: IThrottlingWarning */
|
|
614
501
|
|
|
502
|
+
/**
|
|
503
|
+
* @alpha
|
|
504
|
+
*/
|
|
615
505
|
export declare interface IUrlResolver {
|
|
616
506
|
resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
|
|
617
507
|
/**
|
|
@@ -624,6 +514,9 @@ export declare interface IUrlResolver {
|
|
|
624
514
|
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
|
|
625
515
|
}
|
|
626
516
|
|
|
517
|
+
/**
|
|
518
|
+
* @alpha
|
|
519
|
+
*/
|
|
627
520
|
export declare enum LoaderCachingPolicy {
|
|
628
521
|
/**
|
|
629
522
|
* The loader should not implement any prefetching or caching policy.
|