@fluidframework/driver-utils 2.0.0-rc.2.0.1 → 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.
Files changed (210) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-report/driver-utils.api.md +18 -18
  3. package/dist/adapters/compression/documentServiceCompressionAdapter.d.ts +1 -1
  4. package/dist/adapters/compression/documentServiceCompressionAdapter.d.ts.map +1 -1
  5. package/dist/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
  6. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
  7. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
  8. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.js +1 -1
  9. package/dist/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
  10. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +2 -2
  11. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
  12. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +7 -7
  13. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
  14. package/dist/adapters/predefinedAdapters.d.ts +1 -1
  15. package/dist/adapters/predefinedAdapters.d.ts.map +1 -1
  16. package/dist/adapters/predefinedAdapters.js +2 -2
  17. package/dist/adapters/predefinedAdapters.js.map +1 -1
  18. package/dist/blob.d.ts +1 -1
  19. package/dist/blob.d.ts.map +1 -1
  20. package/dist/blob.js.map +1 -1
  21. package/dist/buildSnapshotTree.d.ts.map +1 -1
  22. package/dist/buildSnapshotTree.js +3 -3
  23. package/dist/buildSnapshotTree.js.map +1 -1
  24. package/dist/documentServiceFactoryProxy.d.ts +1 -1
  25. package/dist/documentServiceFactoryProxy.d.ts.map +1 -1
  26. package/dist/documentServiceFactoryProxy.js.map +1 -1
  27. package/dist/documentServiceProxy.d.ts +1 -1
  28. package/dist/documentServiceProxy.d.ts.map +1 -1
  29. package/dist/documentServiceProxy.js.map +1 -1
  30. package/dist/documentStorageServiceProxy.d.ts +1 -1
  31. package/dist/documentStorageServiceProxy.d.ts.map +1 -1
  32. package/dist/documentStorageServiceProxy.js +2 -2
  33. package/dist/documentStorageServiceProxy.js.map +1 -1
  34. package/dist/error.d.ts +1 -1
  35. package/dist/error.d.ts.map +1 -1
  36. package/dist/error.js +2 -2
  37. package/dist/error.js.map +1 -1
  38. package/dist/insecureUrlResolver.d.ts +1 -1
  39. package/dist/insecureUrlResolver.d.ts.map +1 -1
  40. package/dist/insecureUrlResolver.js +5 -5
  41. package/dist/insecureUrlResolver.js.map +1 -1
  42. package/dist/legacy.d.ts +18 -0
  43. package/dist/messageRecognition.d.ts.map +1 -1
  44. package/dist/messageRecognition.js +2 -2
  45. package/dist/messageRecognition.js.map +1 -1
  46. package/dist/network.d.ts +3 -2
  47. package/dist/network.d.ts.map +1 -1
  48. package/dist/network.js +8 -8
  49. package/dist/network.js.map +1 -1
  50. package/dist/networkUtils.d.ts +1 -1
  51. package/dist/networkUtils.d.ts.map +1 -1
  52. package/dist/networkUtils.js.map +1 -1
  53. package/dist/packageVersion.d.ts +1 -1
  54. package/dist/packageVersion.js +1 -1
  55. package/dist/packageVersion.js.map +1 -1
  56. package/dist/parallelRequests.d.ts +6 -2
  57. package/dist/parallelRequests.d.ts.map +1 -1
  58. package/dist/parallelRequests.js +31 -31
  59. package/dist/parallelRequests.js.map +1 -1
  60. package/dist/prefetchDocumentStorageService.d.ts +1 -1
  61. package/dist/prefetchDocumentStorageService.d.ts.map +1 -1
  62. package/dist/prefetchDocumentStorageService.js +4 -4
  63. package/dist/prefetchDocumentStorageService.js.map +1 -1
  64. package/dist/public.d.ts +15 -0
  65. package/dist/rateLimiter.js +2 -2
  66. package/dist/rateLimiter.js.map +1 -1
  67. package/dist/readAndParse.d.ts +1 -1
  68. package/dist/readAndParse.d.ts.map +1 -1
  69. package/dist/readAndParse.js.map +1 -1
  70. package/dist/runWithRetry.d.ts.map +1 -1
  71. package/dist/runWithRetry.js +4 -4
  72. package/dist/runWithRetry.js.map +1 -1
  73. package/dist/storageUtils.d.ts +1 -1
  74. package/dist/storageUtils.d.ts.map +1 -1
  75. package/dist/storageUtils.js.map +1 -1
  76. package/dist/summaryForCreateNew.d.ts +1 -1
  77. package/dist/summaryForCreateNew.d.ts.map +1 -1
  78. package/dist/summaryForCreateNew.js.map +1 -1
  79. package/dist/treeConversions.d.ts.map +1 -1
  80. package/dist/treeConversions.js +2 -2
  81. package/dist/treeConversions.js.map +1 -1
  82. package/internal.d.ts +11 -0
  83. package/legacy.d.ts +11 -0
  84. package/lib/adapters/compression/documentServiceCompressionAdapter.d.ts +1 -1
  85. package/lib/adapters/compression/documentServiceCompressionAdapter.d.ts.map +1 -1
  86. package/lib/adapters/compression/documentServiceCompressionAdapter.js.map +1 -1
  87. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts +1 -1
  88. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.d.ts.map +1 -1
  89. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.js +1 -1
  90. package/lib/adapters/compression/documentServiceFactoryCompressionAdapter.js.map +1 -1
  91. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +2 -2
  92. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
  93. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +2 -2
  94. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
  95. package/lib/adapters/predefinedAdapters.d.ts +1 -1
  96. package/lib/adapters/predefinedAdapters.d.ts.map +1 -1
  97. package/lib/adapters/predefinedAdapters.js +2 -2
  98. package/lib/adapters/predefinedAdapters.js.map +1 -1
  99. package/lib/blob.d.ts +1 -1
  100. package/lib/blob.d.ts.map +1 -1
  101. package/lib/blob.js.map +1 -1
  102. package/lib/buildSnapshotTree.d.ts.map +1 -1
  103. package/lib/buildSnapshotTree.js +2 -2
  104. package/lib/buildSnapshotTree.js.map +1 -1
  105. package/lib/documentServiceFactoryProxy.d.ts +1 -1
  106. package/lib/documentServiceFactoryProxy.d.ts.map +1 -1
  107. package/lib/documentServiceFactoryProxy.js.map +1 -1
  108. package/lib/documentServiceProxy.d.ts +1 -1
  109. package/lib/documentServiceProxy.d.ts.map +1 -1
  110. package/lib/documentServiceProxy.js.map +1 -1
  111. package/lib/documentStorageServiceProxy.d.ts +1 -1
  112. package/lib/documentStorageServiceProxy.d.ts.map +1 -1
  113. package/lib/documentStorageServiceProxy.js +1 -1
  114. package/lib/documentStorageServiceProxy.js.map +1 -1
  115. package/lib/error.d.ts +1 -1
  116. package/lib/error.d.ts.map +1 -1
  117. package/lib/error.js +1 -1
  118. package/lib/error.js.map +1 -1
  119. package/lib/insecureUrlResolver.d.ts +1 -1
  120. package/lib/insecureUrlResolver.d.ts.map +1 -1
  121. package/lib/insecureUrlResolver.js +2 -2
  122. package/lib/insecureUrlResolver.js.map +1 -1
  123. package/lib/legacy.d.ts +18 -0
  124. package/lib/messageRecognition.d.ts.map +1 -1
  125. package/lib/messageRecognition.js.map +1 -1
  126. package/lib/network.d.ts +3 -2
  127. package/lib/network.d.ts.map +1 -1
  128. package/lib/network.js +2 -2
  129. package/lib/network.js.map +1 -1
  130. package/lib/networkUtils.d.ts +1 -1
  131. package/lib/networkUtils.d.ts.map +1 -1
  132. package/lib/networkUtils.js +1 -1
  133. package/lib/networkUtils.js.map +1 -1
  134. package/lib/packageVersion.d.ts +1 -1
  135. package/lib/packageVersion.js +1 -1
  136. package/lib/packageVersion.js.map +1 -1
  137. package/lib/parallelRequests.d.ts +6 -2
  138. package/lib/parallelRequests.d.ts.map +1 -1
  139. package/lib/parallelRequests.js +3 -3
  140. package/lib/parallelRequests.js.map +1 -1
  141. package/lib/prefetchDocumentStorageService.d.ts +1 -1
  142. package/lib/prefetchDocumentStorageService.d.ts.map +1 -1
  143. package/lib/prefetchDocumentStorageService.js +1 -1
  144. package/lib/prefetchDocumentStorageService.js.map +1 -1
  145. package/lib/public.d.ts +15 -0
  146. package/lib/rateLimiter.js +1 -1
  147. package/lib/rateLimiter.js.map +1 -1
  148. package/lib/readAndParse.d.ts +1 -1
  149. package/lib/readAndParse.d.ts.map +1 -1
  150. package/lib/readAndParse.js.map +1 -1
  151. package/lib/runWithRetry.d.ts.map +1 -1
  152. package/lib/runWithRetry.js +3 -3
  153. package/lib/runWithRetry.js.map +1 -1
  154. package/lib/storageUtils.d.ts +1 -1
  155. package/lib/storageUtils.d.ts.map +1 -1
  156. package/lib/storageUtils.js.map +1 -1
  157. package/lib/summaryForCreateNew.d.ts +1 -1
  158. package/lib/summaryForCreateNew.d.ts.map +1 -1
  159. package/lib/summaryForCreateNew.js.map +1 -1
  160. package/lib/treeConversions.d.ts.map +1 -1
  161. package/lib/treeConversions.js +1 -1
  162. package/lib/treeConversions.js.map +1 -1
  163. package/package.json +29 -50
  164. package/src/adapters/compression/documentServiceCompressionAdapter.ts +7 -2
  165. package/src/adapters/compression/documentServiceFactoryCompressionAdapter.ts +4 -2
  166. package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +7 -3
  167. package/src/adapters/predefinedAdapters.ts +4 -3
  168. package/src/blob.ts +1 -1
  169. package/src/buildSnapshotTree.ts +2 -2
  170. package/src/documentServiceFactoryProxy.ts +1 -1
  171. package/src/documentServiceProxy.ts +1 -1
  172. package/src/documentStorageServiceProxy.ts +2 -2
  173. package/src/error.ts +1 -1
  174. package/src/insecureUrlResolver.ts +6 -2
  175. package/src/messageRecognition.ts +1 -0
  176. package/src/network.ts +5 -6
  177. package/src/networkUtils.ts +3 -2
  178. package/src/packageVersion.ts +1 -1
  179. package/src/parallelRequests.ts +11 -4
  180. package/src/prefetchDocumentStorageService.ts +3 -1
  181. package/src/rateLimiter.ts +1 -1
  182. package/src/readAndParse.ts +1 -1
  183. package/src/runWithRetry.ts +5 -3
  184. package/src/storageUtils.ts +1 -1
  185. package/src/summaryForCreateNew.ts +3 -3
  186. package/src/treeConversions.ts +2 -1
  187. package/api-extractor-cjs.json +0 -8
  188. package/dist/driver-utils-alpha.d.ts +0 -167
  189. package/dist/driver-utils-beta.d.ts +0 -186
  190. package/dist/driver-utils-public.d.ts +0 -186
  191. package/dist/driver-utils-untrimmed.d.ts +0 -603
  192. package/lib/driver-utils-alpha.d.ts +0 -167
  193. package/lib/driver-utils-beta.d.ts +0 -186
  194. package/lib/driver-utils-public.d.ts +0 -186
  195. package/lib/driver-utils-untrimmed.d.ts +0 -603
  196. package/lib/test/insecureUrlResolverTest.spec.js +0 -101
  197. package/lib/test/insecureUrlResolverTest.spec.js.map +0 -1
  198. package/lib/test/parallelRequests.spec.js +0 -186
  199. package/lib/test/parallelRequests.spec.js.map +0 -1
  200. package/lib/test/rateLimiter.spec.js +0 -85
  201. package/lib/test/rateLimiter.spec.js.map +0 -1
  202. package/lib/test/runWithRetry.spec.js +0 -180
  203. package/lib/test/runWithRetry.spec.js.map +0 -1
  204. package/lib/test/summaryCompressionData.js +0 -170
  205. package/lib/test/summaryCompressionData.js.map +0 -1
  206. package/lib/test/summaryCompresssionTester.spec.js +0 -429
  207. package/lib/test/summaryCompresssionTester.spec.js.map +0 -1
  208. package/lib/test/types/validateDriverUtilsPrevious.generated.js +0 -108
  209. package/lib/test/types/validateDriverUtilsPrevious.generated.js.map +0 -1
  210. /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 { }