@fluidframework/driver-utils 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/api-report/driver-utils.api.md +18 -18
- package/dist/adapters/compression/documentServiceCompressionAdapter.d.ts +1 -1
- package/dist/adapters/compression/documentServiceCompressionAdapter.d.ts.map +1 -1
- package/dist/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.js +1 -1
- package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +2 -2
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +7 -7
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
- package/dist/adapters/predefinedAdapters.d.ts +1 -1
- package/dist/adapters/predefinedAdapters.d.ts.map +1 -1
- package/dist/adapters/predefinedAdapters.js +2 -2
- package/dist/adapters/predefinedAdapters.js.map +1 -1
- package/dist/blob.d.ts +1 -1
- package/dist/blob.d.ts.map +1 -1
- package/dist/blob.js.map +1 -1
- package/dist/buildSnapshotTree.d.ts.map +1 -1
- package/dist/buildSnapshotTree.js +3 -3
- package/dist/buildSnapshotTree.js.map +1 -1
- package/dist/documentServiceFactoryProxy.d.ts +1 -1
- package/dist/documentServiceFactoryProxy.d.ts.map +1 -1
- package/dist/documentServiceFactoryProxy.js.map +1 -1
- package/dist/documentServiceProxy.d.ts +1 -1
- package/dist/documentServiceProxy.d.ts.map +1 -1
- package/dist/documentServiceProxy.js.map +1 -1
- package/dist/documentStorageServiceProxy.d.ts +1 -1
- package/dist/documentStorageServiceProxy.d.ts.map +1 -1
- package/dist/documentStorageServiceProxy.js +2 -2
- package/dist/documentStorageServiceProxy.js.map +1 -1
- package/dist/error.d.ts +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +2 -2
- package/dist/error.js.map +1 -1
- package/dist/insecureUrlResolver.d.ts +1 -1
- package/dist/insecureUrlResolver.d.ts.map +1 -1
- package/dist/insecureUrlResolver.js +5 -5
- package/dist/insecureUrlResolver.js.map +1 -1
- package/dist/legacy.d.ts +18 -0
- package/dist/messageRecognition.d.ts.map +1 -1
- package/dist/messageRecognition.js +2 -2
- package/dist/messageRecognition.js.map +1 -1
- package/dist/network.d.ts +3 -2
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +8 -8
- package/dist/network.js.map +1 -1
- package/dist/networkUtils.d.ts +1 -1
- package/dist/networkUtils.d.ts.map +1 -1
- package/dist/networkUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/parallelRequests.d.ts +6 -2
- package/dist/parallelRequests.d.ts.map +1 -1
- package/dist/parallelRequests.js +31 -31
- package/dist/parallelRequests.js.map +1 -1
- package/dist/prefetchDocumentStorageService.d.ts +1 -1
- package/dist/prefetchDocumentStorageService.d.ts.map +1 -1
- package/dist/prefetchDocumentStorageService.js +4 -4
- package/dist/prefetchDocumentStorageService.js.map +1 -1
- package/dist/public.d.ts +15 -0
- package/dist/rateLimiter.js +2 -2
- package/dist/rateLimiter.js.map +1 -1
- package/dist/readAndParse.d.ts +1 -1
- package/dist/readAndParse.d.ts.map +1 -1
- package/dist/readAndParse.js.map +1 -1
- package/dist/runWithRetry.d.ts.map +1 -1
- package/dist/runWithRetry.js +4 -4
- package/dist/runWithRetry.js.map +1 -1
- package/dist/storageUtils.d.ts +1 -1
- package/dist/storageUtils.d.ts.map +1 -1
- package/dist/storageUtils.js.map +1 -1
- package/dist/summaryForCreateNew.d.ts +1 -1
- package/dist/summaryForCreateNew.d.ts.map +1 -1
- package/dist/summaryForCreateNew.js.map +1 -1
- package/dist/treeConversions.d.ts.map +1 -1
- package/dist/treeConversions.js +2 -2
- package/dist/treeConversions.js.map +1 -1
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/adapters/compression/documentServiceCompressionAdapter.d.ts +1 -1
- package/lib/adapters/compression/documentServiceCompressionAdapter.d.ts.map +1 -1
- package/lib/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.js +1 -1
- package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +2 -2
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +2 -2
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
- package/lib/adapters/predefinedAdapters.d.ts +1 -1
- package/lib/adapters/predefinedAdapters.d.ts.map +1 -1
- package/lib/adapters/predefinedAdapters.js +2 -2
- package/lib/adapters/predefinedAdapters.js.map +1 -1
- package/lib/blob.d.ts +1 -1
- package/lib/blob.d.ts.map +1 -1
- package/lib/blob.js.map +1 -1
- package/lib/buildSnapshotTree.d.ts.map +1 -1
- package/lib/buildSnapshotTree.js +2 -2
- package/lib/buildSnapshotTree.js.map +1 -1
- package/lib/documentServiceFactoryProxy.d.ts +1 -1
- package/lib/documentServiceFactoryProxy.d.ts.map +1 -1
- package/lib/documentServiceFactoryProxy.js.map +1 -1
- package/lib/documentServiceProxy.d.ts +1 -1
- package/lib/documentServiceProxy.d.ts.map +1 -1
- package/lib/documentServiceProxy.js.map +1 -1
- package/lib/documentStorageServiceProxy.d.ts +1 -1
- package/lib/documentStorageServiceProxy.d.ts.map +1 -1
- package/lib/documentStorageServiceProxy.js +1 -1
- package/lib/documentStorageServiceProxy.js.map +1 -1
- package/lib/error.d.ts +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +1 -1
- package/lib/error.js.map +1 -1
- package/lib/insecureUrlResolver.d.ts +1 -1
- package/lib/insecureUrlResolver.d.ts.map +1 -1
- package/lib/insecureUrlResolver.js +2 -2
- package/lib/insecureUrlResolver.js.map +1 -1
- package/lib/legacy.d.ts +18 -0
- package/lib/messageRecognition.d.ts.map +1 -1
- package/lib/messageRecognition.js.map +1 -1
- package/lib/network.d.ts +3 -2
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js +2 -2
- package/lib/network.js.map +1 -1
- package/lib/networkUtils.d.ts +1 -1
- package/lib/networkUtils.d.ts.map +1 -1
- package/lib/networkUtils.js +1 -1
- package/lib/networkUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/parallelRequests.d.ts +6 -2
- package/lib/parallelRequests.d.ts.map +1 -1
- package/lib/parallelRequests.js +3 -3
- package/lib/parallelRequests.js.map +1 -1
- package/lib/prefetchDocumentStorageService.d.ts +1 -1
- package/lib/prefetchDocumentStorageService.d.ts.map +1 -1
- package/lib/prefetchDocumentStorageService.js +1 -1
- package/lib/prefetchDocumentStorageService.js.map +1 -1
- package/lib/public.d.ts +15 -0
- package/lib/rateLimiter.js +1 -1
- package/lib/rateLimiter.js.map +1 -1
- package/lib/readAndParse.d.ts +1 -1
- package/lib/readAndParse.d.ts.map +1 -1
- package/lib/readAndParse.js.map +1 -1
- package/lib/runWithRetry.d.ts.map +1 -1
- package/lib/runWithRetry.js +3 -3
- package/lib/runWithRetry.js.map +1 -1
- package/lib/storageUtils.d.ts +1 -1
- package/lib/storageUtils.d.ts.map +1 -1
- package/lib/storageUtils.js.map +1 -1
- package/lib/summaryForCreateNew.d.ts +1 -1
- package/lib/summaryForCreateNew.d.ts.map +1 -1
- package/lib/summaryForCreateNew.js.map +1 -1
- package/lib/treeConversions.d.ts.map +1 -1
- package/lib/treeConversions.js +1 -1
- package/lib/treeConversions.js.map +1 -1
- package/package.json +29 -50
- package/src/adapters/compression/documentServiceCompressionAdapter.ts +7 -2
- package/src/adapters/compression/documentServiceFactoryCompressionAdapter.ts +4 -2
- package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +7 -3
- package/src/adapters/predefinedAdapters.ts +4 -3
- package/src/blob.ts +1 -1
- package/src/buildSnapshotTree.ts +2 -2
- package/src/documentServiceFactoryProxy.ts +1 -1
- package/src/documentServiceProxy.ts +1 -1
- package/src/documentStorageServiceProxy.ts +2 -2
- package/src/error.ts +1 -1
- package/src/insecureUrlResolver.ts +6 -2
- package/src/messageRecognition.ts +1 -0
- package/src/network.ts +5 -6
- package/src/networkUtils.ts +3 -2
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +11 -4
- package/src/prefetchDocumentStorageService.ts +3 -1
- package/src/rateLimiter.ts +1 -1
- package/src/readAndParse.ts +1 -1
- package/src/runWithRetry.ts +5 -3
- package/src/storageUtils.ts +1 -1
- package/src/summaryForCreateNew.ts +3 -3
- package/src/treeConversions.ts +2 -1
- package/api-extractor-cjs.json +0 -8
- package/dist/driver-utils-alpha.d.ts +0 -167
- package/dist/driver-utils-beta.d.ts +0 -186
- package/dist/driver-utils-public.d.ts +0 -186
- package/dist/driver-utils-untrimmed.d.ts +0 -603
- package/lib/driver-utils-alpha.d.ts +0 -167
- package/lib/driver-utils-beta.d.ts +0 -186
- package/lib/driver-utils-public.d.ts +0 -186
- package/lib/driver-utils-untrimmed.d.ts +0 -603
- package/lib/test/insecureUrlResolverTest.spec.js +0 -101
- package/lib/test/insecureUrlResolverTest.spec.js.map +0 -1
- package/lib/test/parallelRequests.spec.js +0 -186
- package/lib/test/parallelRequests.spec.js.map +0 -1
- package/lib/test/rateLimiter.spec.js +0 -85
- package/lib/test/rateLimiter.spec.js.map +0 -1
- package/lib/test/runWithRetry.spec.js +0 -180
- package/lib/test/runWithRetry.spec.js.map +0 -1
- package/lib/test/summaryCompressionData.js +0 -170
- package/lib/test/summaryCompressionData.js.map +0 -1
- package/lib/test/summaryCompresssionTester.spec.js +0 -429
- package/lib/test/summaryCompresssionTester.spec.js.map +0 -1
- package/lib/test/types/validateDriverUtilsPrevious.generated.js +0 -108
- package/lib/test/types/validateDriverUtilsPrevious.generated.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -1,603 +0,0 @@
|
|
|
1
|
-
import { FetchSource } from '@fluidframework/driver-definitions';
|
|
2
|
-
import { IAttachment } from '@fluidframework/protocol-definitions';
|
|
3
|
-
import { IAuthorizationError } from '@fluidframework/driver-definitions';
|
|
4
|
-
import { IBlob } from '@fluidframework/protocol-definitions';
|
|
5
|
-
import { ICommittedProposal } from '@fluidframework/protocol-definitions';
|
|
6
|
-
import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
|
|
7
|
-
import { IDeltasFetchResult } from '@fluidframework/driver-definitions';
|
|
8
|
-
import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
|
|
9
|
-
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
10
|
-
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
11
|
-
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
12
|
-
import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
|
|
13
|
-
import { IDriverErrorBase } from '@fluidframework/driver-definitions';
|
|
14
|
-
import { IFluidErrorBase } from '@fluidframework/telemetry-utils';
|
|
15
|
-
import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
|
|
16
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
17
|
-
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
18
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
19
|
-
import { ISnapshot } from '@fluidframework/driver-definitions';
|
|
20
|
-
import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
|
|
21
|
-
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
22
|
-
import { IStream } from '@fluidframework/driver-definitions';
|
|
23
|
-
import { IStreamResult } from '@fluidframework/driver-definitions';
|
|
24
|
-
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
25
|
-
import { ISummaryHandle } from '@fluidframework/protocol-definitions';
|
|
26
|
-
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
27
|
-
import { ITelemetryBaseProperties } from '@fluidframework/core-interfaces';
|
|
28
|
-
import { ITelemetryErrorEventExt } from '@fluidframework/telemetry-utils';
|
|
29
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
30
|
-
import { IThrottlingWarning } from '@fluidframework/driver-definitions';
|
|
31
|
-
import { ITree } from '@fluidframework/protocol-definitions';
|
|
32
|
-
import { ITreeEntry } from '@fluidframework/protocol-definitions';
|
|
33
|
-
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
34
|
-
import { IVersion } from '@fluidframework/protocol-definitions';
|
|
35
|
-
import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
|
|
36
|
-
import { LoggingError } from '@fluidframework/telemetry-utils';
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* This method optionally applies compression to the given document service factory. The compression
|
|
40
|
-
* must be enabled by setting the config to true or by passing a compression config object.
|
|
41
|
-
* @param documentServiceFactory - The document service factory to apply compression to.
|
|
42
|
-
* @param config - The compression configuration.
|
|
43
|
-
* @returns The document service factory possibly with compression applied.
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
46
|
-
export declare function applyStorageCompression(documentServiceFactory: IDocumentServiceFactory, config?: ICompressionStorageConfig | boolean): IDocumentServiceFactory;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Basic implementation of an attachment ITreeEntry
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
export declare class AttachmentTreeEntry {
|
|
53
|
-
readonly path: string;
|
|
54
|
-
readonly id: string;
|
|
55
|
-
readonly mode = FileMode.File;
|
|
56
|
-
readonly type = TreeEntry.Attachment;
|
|
57
|
-
readonly value: IAttachment;
|
|
58
|
-
/**
|
|
59
|
-
* Creates an attachment ITreeEntry
|
|
60
|
-
* @param path - path of entry
|
|
61
|
-
* @param id - id of external blob attachment
|
|
62
|
-
*/
|
|
63
|
-
constructor(path: string, id: string);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @internal
|
|
68
|
-
*/
|
|
69
|
-
export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
|
|
70
|
-
readonly claims: string | undefined;
|
|
71
|
-
readonly tenantId: string | undefined;
|
|
72
|
-
readonly errorType: "authorizationError";
|
|
73
|
-
readonly canRetry = false;
|
|
74
|
-
constructor(message: string, claims: string | undefined, tenantId: string | undefined, props: DriverErrorTelemetryProps);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @internal
|
|
79
|
-
*/
|
|
80
|
-
export declare const blobHeadersBlobName = ".metadata.blobHeaders";
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Basic implementation of a blob ITreeEntry
|
|
84
|
-
* @internal
|
|
85
|
-
*/
|
|
86
|
-
export declare class BlobTreeEntry {
|
|
87
|
-
readonly path: string;
|
|
88
|
-
readonly mode = FileMode.File;
|
|
89
|
-
readonly type = TreeEntry.Blob;
|
|
90
|
-
readonly value: IBlob;
|
|
91
|
-
/**
|
|
92
|
-
* Creates a blob ITreeEntry
|
|
93
|
-
* @param path - path of entry
|
|
94
|
-
* @param contents - blob contents
|
|
95
|
-
* @param encoding - encoding of contents; defaults to utf-8
|
|
96
|
-
*/
|
|
97
|
-
constructor(path: string, contents: string, encoding?: "utf-8" | "base64");
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Build a tree hierarchy base on an array of ITreeEntry
|
|
102
|
-
*
|
|
103
|
-
* @param entries - an array of ITreeEntry to flatten
|
|
104
|
-
* @param blobMap - a map of blob's sha1 to content that gets filled with content from entries
|
|
105
|
-
* NOTE: blobMap's validity is contingent on the returned promise's resolution
|
|
106
|
-
* @returns the hierarchical tree
|
|
107
|
-
* @internal
|
|
108
|
-
*/
|
|
109
|
-
export declare function buildSnapshotTree(entries: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>): ISnapshotTree;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Calculates time to wait for after an error based on the error and wait time for previous iteration.
|
|
113
|
-
* In case endpoint(service or socket) is not reachable, then we maybe offline or may have got some
|
|
114
|
-
* transient error not related to endpoint, in that case we want to try at faster pace and hence the
|
|
115
|
-
* max wait is lesser 8s as compared to when endpoint is reachable in which case it is 60s.
|
|
116
|
-
* @param delayMs - wait time for previous iteration
|
|
117
|
-
* @param error - error based on which we decide wait time.
|
|
118
|
-
* @returns Wait time to wait for.
|
|
119
|
-
* @internal
|
|
120
|
-
*/
|
|
121
|
-
export declare function calculateMaxWaitTime(delayMs: number, error: unknown): number;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
|
|
125
|
-
* @internal
|
|
126
|
-
*/
|
|
127
|
-
export declare function canBeCoalescedByService(message: ISequencedDocumentMessage | IDocumentMessage): boolean;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.
|
|
131
|
-
* I.e. asserts or unexpected exceptions in our code result in container failure.
|
|
132
|
-
* @param error - The error to inspect for ability to retry
|
|
133
|
-
* @internal
|
|
134
|
-
*/
|
|
135
|
-
export declare const canRetryOnError: (error: any) => boolean;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Defines the current layout of an .app + .protocol summary tree
|
|
139
|
-
* this is used internally for create new, and single commit summary
|
|
140
|
-
* @internal
|
|
141
|
-
*/
|
|
142
|
-
export declare interface CombinedAppAndProtocolSummary extends ISummaryTree {
|
|
143
|
-
tree: {
|
|
144
|
-
[".app"]: ISummaryTree;
|
|
145
|
-
[".protocol"]: ISummaryTree;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Converts ISummaryTree to ITree format.
|
|
151
|
-
* @param summaryTree - summary tree in ISummaryTree format
|
|
152
|
-
* @internal
|
|
153
|
-
*/
|
|
154
|
-
export declare function convertSummaryTreeToSnapshotITree(summaryTree: ISummaryTree): ITree;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @internal
|
|
158
|
-
*/
|
|
159
|
-
export declare function createGenericNetworkError(message: string, retryInfo: {
|
|
160
|
-
canRetry: boolean;
|
|
161
|
-
retryAfterMs?: number;
|
|
162
|
-
}, props: DriverErrorTelemetryProps): ThrottlingError | GenericNetworkError;
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @internal
|
|
166
|
-
*/
|
|
167
|
-
export declare const createWriteError: (message: string, props: DriverErrorTelemetryProps) => NonRetryableError<"writeError">;
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* @internal
|
|
171
|
-
*/
|
|
172
|
-
export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
173
|
-
static readonly errorType: "deltaStreamConnectionForbidden";
|
|
174
|
-
readonly errorType: "deltaStreamConnectionForbidden";
|
|
175
|
-
readonly canRetry = false;
|
|
176
|
-
readonly storageOnlyReason: string | undefined;
|
|
177
|
-
constructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* @internal
|
|
182
|
-
*/
|
|
183
|
-
export declare class DocumentStorageServiceProxy implements IDocumentStorageService {
|
|
184
|
-
protected readonly internalStorageService: IDocumentStorageService;
|
|
185
|
-
private _policies;
|
|
186
|
-
set policies(policies: IDocumentStorageServicePolicies | undefined);
|
|
187
|
-
get policies(): IDocumentStorageServicePolicies | undefined;
|
|
188
|
-
constructor(internalStorageService: IDocumentStorageService);
|
|
189
|
-
getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
|
|
190
|
-
getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
|
|
191
|
-
getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
|
|
192
|
-
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
193
|
-
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
|
|
194
|
-
createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
|
|
195
|
-
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Telemetry props with driver-specific required properties
|
|
200
|
-
* @internal
|
|
201
|
-
*/
|
|
202
|
-
export declare type DriverErrorTelemetryProps = ITelemetryBaseProperties & {
|
|
203
|
-
driverVersion: string | undefined;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* @internal
|
|
208
|
-
*/
|
|
209
|
-
export declare const emptyMessageStream: IStream<ISequencedDocumentMessage[]>;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* FluidInvalidSchema error class.
|
|
213
|
-
* @internal
|
|
214
|
-
*/
|
|
215
|
-
export declare class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
216
|
-
readonly errorType: "fluidInvalidSchema";
|
|
217
|
-
readonly canRetry = false;
|
|
218
|
-
constructor(message: string, props: DriverErrorTelemetryProps);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Generic network error class.
|
|
223
|
-
* @internal
|
|
224
|
-
*/
|
|
225
|
-
export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
226
|
-
readonly canRetry: boolean;
|
|
227
|
-
/**
|
|
228
|
-
* {@inheritDoc @fluidframework/telemetry-utils#IFluidErrorBase.errorType}
|
|
229
|
-
*/
|
|
230
|
-
readonly errorType: "genericNetworkError";
|
|
231
|
-
constructor(message: string, canRetry: boolean, props: DriverErrorTelemetryProps);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Extract the attributes from the protocol summary.
|
|
236
|
-
* @param protocolSummary - protocol summary from which the values are to be extracted.
|
|
237
|
-
* @internal
|
|
238
|
-
*/
|
|
239
|
-
export declare function getDocAttributesFromProtocolSummary(protocolSummary: ISummaryTree): IDocumentAttributes;
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Extract quorum values from the protocol summary.
|
|
243
|
-
* @param protocolSummary - protocol summary from which the values are to be extracted.
|
|
244
|
-
* @internal
|
|
245
|
-
*/
|
|
246
|
-
export declare function getQuorumValuesFromProtocolSummary(protocolSummary: ISummaryTree): [string, ICommittedProposal][];
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Check retryAfterSeconds property on error and convert to ms
|
|
250
|
-
* @internal
|
|
251
|
-
*/
|
|
252
|
-
export declare const getRetryDelayFromError: (error: any) => number | undefined;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Check retryAfterSeconds property on error
|
|
256
|
-
* @internal
|
|
257
|
-
*/
|
|
258
|
-
export declare const getRetryDelaySecondsFromError: (error: any) => number | undefined;
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* @public
|
|
262
|
-
*/
|
|
263
|
-
export declare interface ICompressionStorageConfig {
|
|
264
|
-
algorithm: SummaryCompressionAlgorithm;
|
|
265
|
-
minSizeToCompress: number;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* As the name implies this is not secure and should not be used in production. It simply makes the example easier
|
|
270
|
-
* to get up and running.
|
|
271
|
-
*
|
|
272
|
-
* In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form
|
|
273
|
-
* http://localhost:8080/<documentId>/<path>.
|
|
274
|
-
*
|
|
275
|
-
* We then need to map that to a Fluid based URL. These are of the form
|
|
276
|
-
* https://orderingUrl/<tenantId>/<documentId>/<path>.
|
|
277
|
-
*
|
|
278
|
-
* The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional
|
|
279
|
-
* part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service
|
|
280
|
-
* works or a router inside of a single page app framework.
|
|
281
|
-
* @internal
|
|
282
|
-
*/
|
|
283
|
-
export declare class InsecureUrlResolver implements IUrlResolver {
|
|
284
|
-
private readonly hostUrl;
|
|
285
|
-
private readonly ordererUrl;
|
|
286
|
-
private readonly storageUrl;
|
|
287
|
-
private readonly deltaStreamUrl;
|
|
288
|
-
private readonly tenantId;
|
|
289
|
-
private readonly bearer;
|
|
290
|
-
private readonly isForNodeTest;
|
|
291
|
-
private readonly cache;
|
|
292
|
-
constructor(hostUrl: string, ordererUrl: string, storageUrl: string, deltaStreamUrl: string, tenantId: string, bearer: string, isForNodeTest?: boolean);
|
|
293
|
-
resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
|
|
294
|
-
private resolveHelper;
|
|
295
|
-
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
|
|
296
|
-
createCreateNewRequest(fileName?: string): IRequest;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Interface describing an object passed to various network APIs.
|
|
301
|
-
* It allows caller to control cancellation, as well as learn about any delays.
|
|
302
|
-
* @internal
|
|
303
|
-
*/
|
|
304
|
-
export declare interface IProgress {
|
|
305
|
-
/**
|
|
306
|
-
* Abort signal used to cancel operation.
|
|
307
|
-
*
|
|
308
|
-
* @remarks Note that most of the layers do not use this signal yet. We need to change that over time.
|
|
309
|
-
* Please consult with API documentation / implementation.
|
|
310
|
-
* Note that number of layers may not check this signal while holding this request in a queue,
|
|
311
|
-
* so it may take a while it takes effect. This can be improved in the future.
|
|
312
|
-
*
|
|
313
|
-
* The layers in question are:
|
|
314
|
-
*
|
|
315
|
-
* - driver (RateLimiter)
|
|
316
|
-
*
|
|
317
|
-
* - runWithRetry
|
|
318
|
-
*/
|
|
319
|
-
cancel?: AbortSignal;
|
|
320
|
-
/**
|
|
321
|
-
* Called whenever api returns cancellable error and the call is going to be retried.
|
|
322
|
-
* Any exception thrown from this call back result in cancellation of operation
|
|
323
|
-
* and propagation of thrown exception.
|
|
324
|
-
* @param delayInMs - delay before next retry. This value will depend on internal back-off logic,
|
|
325
|
-
* as well as information provided by service (like 429 error asking to wait for some time before retry)
|
|
326
|
-
* @param error - error object returned from the call.
|
|
327
|
-
*/
|
|
328
|
-
onRetry?(delayInMs: number, error: any): void;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Validates the current layout of an .app + .protocol summary tree
|
|
333
|
-
* this is used internally for create new, and single commit summary
|
|
334
|
-
* @internal
|
|
335
|
-
*/
|
|
336
|
-
export declare function isCombinedAppAndProtocolSummary(summary: ISummaryTree | undefined, ...optionalRootTrees: string[]): summary is CombinedAppAndProtocolSummary;
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Utility API to check if the type of snapshot contents is `ISnapshot`.
|
|
340
|
-
* @internal
|
|
341
|
-
* @param obj - obj whose type needs to be identified.
|
|
342
|
-
*/
|
|
343
|
-
export declare function isInstanceOfISnapshot(obj: ISnapshotTree | ISnapshot | undefined): obj is ISnapshot;
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* It tells if we have local connection only - we might not have connection to web.
|
|
347
|
-
* No solution for node.js (other than resolve dns names / ping specific sites)
|
|
348
|
-
* Can also use window.addEventListener("online" / "offline")
|
|
349
|
-
* @internal
|
|
350
|
-
*/
|
|
351
|
-
export declare function isOnline(): OnlineStatus;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Tells if message was sent by container runtime
|
|
355
|
-
* @privateRemarks ADO #1385: To be moved to container-definitions
|
|
356
|
-
* @returns whether the message is a runtime message
|
|
357
|
-
* @internal
|
|
358
|
-
*/
|
|
359
|
-
export declare function isRuntimeMessage(message: {
|
|
360
|
-
type: string;
|
|
361
|
-
}): boolean;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* @internal
|
|
365
|
-
*/
|
|
366
|
-
export declare class LocationRedirectionError extends LoggingError implements ILocationRedirectionError, IFluidErrorBase {
|
|
367
|
-
readonly redirectUrl: IResolvedUrl;
|
|
368
|
-
readonly errorType: "locationRedirection";
|
|
369
|
-
readonly canRetry = false;
|
|
370
|
-
constructor(message: string, redirectUrl: IResolvedUrl, props: DriverErrorTelemetryProps);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* @internal
|
|
375
|
-
*/
|
|
376
|
-
export declare function logNetworkFailure(logger: ITelemetryLoggerExt, event: ITelemetryErrorEventExt, error?: any): void;
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* @privateRemarks ADO #1385: staging code changes across layers.
|
|
380
|
-
* Eventually to be replaced by MessageType.accept
|
|
381
|
-
* @internal
|
|
382
|
-
*/
|
|
383
|
-
export declare enum MessageType2 {
|
|
384
|
-
Accept = "accept"
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* @internal
|
|
389
|
-
*/
|
|
390
|
-
export declare class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {
|
|
391
|
-
readonly errorType: T;
|
|
392
|
-
readonly canRetry: boolean;
|
|
393
|
-
constructor(message: string, errorType: T, canRetry: boolean, props: DriverErrorTelemetryProps);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* @internal
|
|
398
|
-
*/
|
|
399
|
-
export declare class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {
|
|
400
|
-
readonly errorType: T;
|
|
401
|
-
constructor(message: string, errorType: T, props: DriverErrorTelemetryProps);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* @internal
|
|
406
|
-
*/
|
|
407
|
-
export declare enum OnlineStatus {
|
|
408
|
-
Offline = 0,
|
|
409
|
-
Online = 1,
|
|
410
|
-
Unknown = 2
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Helper class to organize parallel fetching of data
|
|
415
|
-
* It can be used to concurrently do many requests, while consuming
|
|
416
|
-
* data in the right order. Take a look at UT for examples.
|
|
417
|
-
* @param concurrency - level of concurrency
|
|
418
|
-
* @param from - starting point of fetching data (inclusive)
|
|
419
|
-
* @param to - ending point of fetching data. exclusive, or undefined if unknown
|
|
420
|
-
* @param payloadSize - batch size
|
|
421
|
-
* @param logger - logger to use
|
|
422
|
-
* @param requestCallback - callback to request batches
|
|
423
|
-
* @returns Queue that can be used to retrieve data
|
|
424
|
-
* @internal
|
|
425
|
-
*/
|
|
426
|
-
export declare class ParallelRequests<T> {
|
|
427
|
-
private to;
|
|
428
|
-
private readonly payloadSize;
|
|
429
|
-
private readonly logger;
|
|
430
|
-
private readonly requestCallback;
|
|
431
|
-
private readonly responseCallback;
|
|
432
|
-
private latestRequested;
|
|
433
|
-
private nextToDeliver;
|
|
434
|
-
private readonly results;
|
|
435
|
-
private workingState;
|
|
436
|
-
private requestsInFlight;
|
|
437
|
-
private readonly endEvent;
|
|
438
|
-
private requests;
|
|
439
|
-
private readonly knewTo;
|
|
440
|
-
private get working();
|
|
441
|
-
get canceled(): boolean;
|
|
442
|
-
constructor(from: number, to: number | undefined, payloadSize: number, logger: ITelemetryLoggerExt, requestCallback: (request: number, from: number, to: number, strongTo: boolean, props: ITelemetryBaseProperties) => Promise<{
|
|
443
|
-
partial: boolean;
|
|
444
|
-
cancel: boolean;
|
|
445
|
-
payload: T[];
|
|
446
|
-
}>, responseCallback: (payload: T[]) => void);
|
|
447
|
-
cancel(): void;
|
|
448
|
-
run(concurrency: number): Promise<void>;
|
|
449
|
-
private done;
|
|
450
|
-
private fail;
|
|
451
|
-
private dispatch;
|
|
452
|
-
private getNextChunk;
|
|
453
|
-
private addRequest;
|
|
454
|
-
private addRequestCore;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* @internal
|
|
459
|
-
*/
|
|
460
|
-
export declare class PrefetchDocumentStorageService extends DocumentStorageServiceProxy {
|
|
461
|
-
private readonly prefetchCache;
|
|
462
|
-
private prefetchEnabled;
|
|
463
|
-
get policies(): {
|
|
464
|
-
caching: LoaderCachingPolicy;
|
|
465
|
-
maximumCacheDurationMs?: 432000000 | undefined;
|
|
466
|
-
} | undefined;
|
|
467
|
-
getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
|
|
468
|
-
readBlob(blobId: string): Promise<ArrayBufferLike>;
|
|
469
|
-
stopPrefetch(): void;
|
|
470
|
-
private cachedRead;
|
|
471
|
-
private prefetchTree;
|
|
472
|
-
private prefetchTreeCore;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Helper queue class to allow async push / pull
|
|
477
|
-
* It's essentially a pipe allowing multiple writers, and single reader
|
|
478
|
-
* @internal
|
|
479
|
-
*/
|
|
480
|
-
export declare class Queue<T> implements IStream<T> {
|
|
481
|
-
private readonly queue;
|
|
482
|
-
private deferred;
|
|
483
|
-
private done;
|
|
484
|
-
pushValue(value: T): void;
|
|
485
|
-
pushError(error: any): void;
|
|
486
|
-
pushDone(): void;
|
|
487
|
-
protected pushCore(value: Promise<IStreamResult<T>>): void;
|
|
488
|
-
read(): Promise<IStreamResult<T>>;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* @alpha
|
|
493
|
-
*/
|
|
494
|
-
export declare class RateLimiter {
|
|
495
|
-
private maxRequests;
|
|
496
|
-
private readonly tasks;
|
|
497
|
-
constructor(maxRequests: number);
|
|
498
|
-
get waitQueueLength(): number;
|
|
499
|
-
protected readonly release: () => void;
|
|
500
|
-
protected acquire(): Promise<void>;
|
|
501
|
-
schedule<T>(work: () => Promise<T>): Promise<T>;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Read a blob from {@link @fluidframework/driver-definitions#IDocumentStorageService} and
|
|
506
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse | JSON.parse}
|
|
507
|
-
* it into object of type `T`.
|
|
508
|
-
*
|
|
509
|
-
* @param storage - The `DocumentStorageService` to read from.
|
|
510
|
-
* @param id - The ID of the blob to read and parse.
|
|
511
|
-
*
|
|
512
|
-
* @typeParam T - Output type matching JSON format of inpyt blob data.
|
|
513
|
-
*
|
|
514
|
-
* @returns The object that we decoded and parsed via `JSON.parse`.
|
|
515
|
-
* @internal
|
|
516
|
-
*/
|
|
517
|
-
export declare function readAndParse<T>(storage: Pick<IDocumentStorageService, "readBlob">, id: string): Promise<T>;
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* Request ops from storage
|
|
521
|
-
* @param get - Getter callback to get individual batches
|
|
522
|
-
* @param concurrency - Number of concurrent requests to make
|
|
523
|
-
* @param fromTotal - starting sequence number to fetch (inclusive)
|
|
524
|
-
* @param toTotal - max (exclusive) sequence number to fetch
|
|
525
|
-
* @param payloadSize - Payload size
|
|
526
|
-
* @param logger - Logger to log progress and errors
|
|
527
|
-
* @param signal - Cancelation signal
|
|
528
|
-
* @param scenarioName - Reason for fetching ops
|
|
529
|
-
* @returns Messages fetched
|
|
530
|
-
* @internal
|
|
531
|
-
*/
|
|
532
|
-
export declare function requestOps(get: (from: number, to: number, telemetryProps: ITelemetryBaseProperties) => Promise<IDeltasFetchResult>, concurrency: number, fromTotal: number, toTotal: number | undefined, payloadSize: number, logger: ITelemetryLoggerExt, signal?: AbortSignal, scenarioName?: string): IStream<ISequencedDocumentMessage[]>;
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* @internal
|
|
536
|
-
*/
|
|
537
|
-
export declare class RetryableError<T extends string> extends NetworkErrorBasic<T> {
|
|
538
|
-
readonly errorType: T;
|
|
539
|
-
constructor(message: string, errorType: T, props: DriverErrorTelemetryProps);
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* @internal
|
|
544
|
-
*/
|
|
545
|
-
export declare function runWithRetry<T>(api: (cancel?: AbortSignal) => Promise<T>, fetchCallName: string, logger: ITelemetryLoggerExt, progress: IProgress): Promise<T>;
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* @internal
|
|
549
|
-
*/
|
|
550
|
-
export declare function streamFromMessages(messagesArg: Promise<ISequencedDocumentMessage[]>): IStream<ISequencedDocumentMessage[]>;
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* @internal
|
|
554
|
-
*/
|
|
555
|
-
export declare function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* @public
|
|
559
|
-
*/
|
|
560
|
-
export declare enum SummaryCompressionAlgorithm {
|
|
561
|
-
None = 0,
|
|
562
|
-
LZ4 = 1
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
* Throttling error class - used to communicate all throttling errors
|
|
567
|
-
* @internal
|
|
568
|
-
*/
|
|
569
|
-
export declare class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
|
|
570
|
-
readonly retryAfterSeconds: number;
|
|
571
|
-
readonly errorType: "throttlingError";
|
|
572
|
-
readonly canRetry = true;
|
|
573
|
-
constructor(message: string, retryAfterSeconds: number, props: DriverErrorTelemetryProps);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* Basic implementation of a tree ITreeEntry
|
|
578
|
-
* @internal
|
|
579
|
-
*/
|
|
580
|
-
export declare class TreeTreeEntry {
|
|
581
|
-
readonly path: string;
|
|
582
|
-
readonly value: ITree;
|
|
583
|
-
readonly mode = FileMode.Directory;
|
|
584
|
-
readonly type = TreeEntry.Tree;
|
|
585
|
-
/**
|
|
586
|
-
* Creates a tree ITreeEntry
|
|
587
|
-
* @param path - path of entry
|
|
588
|
-
* @param value - subtree
|
|
589
|
-
*/
|
|
590
|
-
constructor(path: string, value: ITree);
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
595
|
-
* @internal
|
|
596
|
-
*/
|
|
597
|
-
export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
598
|
-
readonly errorType: "usageError";
|
|
599
|
-
readonly canRetry = false;
|
|
600
|
-
constructor(message: string);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
export { }
|