@fluidframework/driver-utils 2.0.0-dev.7.2.0.203917 → 2.0.0-dev.7.2.0.204906

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 (185) hide show
  1. package/api-extractor.json +1 -12
  2. package/api-report/driver-utils.api.md +9 -1
  3. package/dist/adapters/compression/compressionTypes.d.ts +6 -0
  4. package/dist/adapters/compression/compressionTypes.d.ts.map +1 -1
  5. package/dist/adapters/compression/compressionTypes.js +3 -0
  6. package/dist/adapters/compression/compressionTypes.js.map +1 -1
  7. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +4 -0
  8. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
  9. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +4 -0
  10. package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
  11. package/dist/adapters/predefinedAdapters.d.ts +1 -0
  12. package/dist/adapters/predefinedAdapters.d.ts.map +1 -1
  13. package/dist/adapters/predefinedAdapters.js +1 -0
  14. package/dist/adapters/predefinedAdapters.js.map +1 -1
  15. package/dist/blob.d.ts +3 -0
  16. package/dist/blob.d.ts.map +1 -1
  17. package/dist/blob.js +3 -0
  18. package/dist/blob.js.map +1 -1
  19. package/dist/buildSnapshotTree.d.ts +1 -0
  20. package/dist/buildSnapshotTree.d.ts.map +1 -1
  21. package/dist/buildSnapshotTree.js +1 -0
  22. package/dist/buildSnapshotTree.js.map +1 -1
  23. package/dist/documentStorageServiceProxy.d.ts +3 -0
  24. package/dist/documentStorageServiceProxy.d.ts.map +1 -1
  25. package/dist/documentStorageServiceProxy.js +3 -0
  26. package/dist/documentStorageServiceProxy.js.map +1 -1
  27. package/dist/driver-utils-alpha.d.ts +112 -5
  28. package/dist/driver-utils-beta.d.ts +112 -5
  29. package/dist/driver-utils-public.d.ts +112 -5
  30. package/dist/driver-utils-untrimmed.d.ts +112 -5
  31. package/dist/error.d.ts +4 -1
  32. package/dist/error.d.ts.map +1 -1
  33. package/dist/error.js +4 -1
  34. package/dist/error.js.map +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +2 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/insecureUrlResolver.d.ts +1 -0
  40. package/dist/insecureUrlResolver.d.ts.map +1 -1
  41. package/dist/insecureUrlResolver.js +1 -0
  42. package/dist/insecureUrlResolver.js.map +1 -1
  43. package/dist/messageRecognition.d.ts +10 -0
  44. package/dist/messageRecognition.d.ts.map +1 -1
  45. package/dist/messageRecognition.js +10 -3
  46. package/dist/messageRecognition.js.map +1 -1
  47. package/dist/network.d.ts +49 -3
  48. package/dist/network.d.ts.map +1 -1
  49. package/dist/network.js +45 -5
  50. package/dist/network.js.map +1 -1
  51. package/dist/networkUtils.d.ts +3 -0
  52. package/dist/networkUtils.d.ts.map +1 -1
  53. package/dist/networkUtils.js +3 -0
  54. package/dist/networkUtils.js.map +1 -1
  55. package/dist/packageVersion.d.ts +1 -1
  56. package/dist/packageVersion.js +1 -1
  57. package/dist/packageVersion.js.map +1 -1
  58. package/dist/parallelRequests.d.ts +12 -0
  59. package/dist/parallelRequests.d.ts.map +1 -1
  60. package/dist/parallelRequests.js +12 -0
  61. package/dist/parallelRequests.js.map +1 -1
  62. package/dist/prefetchDocumentStorageService.d.ts +3 -0
  63. package/dist/prefetchDocumentStorageService.d.ts.map +1 -1
  64. package/dist/prefetchDocumentStorageService.js +3 -0
  65. package/dist/prefetchDocumentStorageService.js.map +1 -1
  66. package/dist/rateLimiter.d.ts +3 -0
  67. package/dist/rateLimiter.d.ts.map +1 -1
  68. package/dist/rateLimiter.js +3 -0
  69. package/dist/rateLimiter.js.map +1 -1
  70. package/dist/readAndParse.d.ts +1 -0
  71. package/dist/readAndParse.d.ts.map +1 -1
  72. package/dist/readAndParse.js +1 -0
  73. package/dist/readAndParse.js.map +1 -1
  74. package/dist/runWithRetry.d.ts +5 -0
  75. package/dist/runWithRetry.d.ts.map +1 -1
  76. package/dist/runWithRetry.js +4 -0
  77. package/dist/runWithRetry.js.map +1 -1
  78. package/dist/summaryForCreateNew.d.ts +2 -0
  79. package/dist/summaryForCreateNew.d.ts.map +1 -1
  80. package/dist/summaryForCreateNew.js +2 -0
  81. package/dist/summaryForCreateNew.js.map +1 -1
  82. package/dist/treeConversions.d.ts +1 -0
  83. package/dist/treeConversions.d.ts.map +1 -1
  84. package/dist/treeConversions.js +1 -0
  85. package/dist/treeConversions.js.map +1 -1
  86. package/lib/adapters/compression/compressionTypes.d.ts +6 -0
  87. package/lib/adapters/compression/compressionTypes.d.ts.map +1 -1
  88. package/lib/adapters/compression/compressionTypes.js +3 -0
  89. package/lib/adapters/compression/compressionTypes.js.map +1 -1
  90. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +4 -0
  91. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts.map +1 -1
  92. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +4 -0
  93. package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
  94. package/lib/adapters/predefinedAdapters.d.ts +1 -0
  95. package/lib/adapters/predefinedAdapters.d.ts.map +1 -1
  96. package/lib/adapters/predefinedAdapters.js +1 -0
  97. package/lib/adapters/predefinedAdapters.js.map +1 -1
  98. package/lib/blob.d.ts +3 -0
  99. package/lib/blob.d.ts.map +1 -1
  100. package/lib/blob.js +3 -0
  101. package/lib/blob.js.map +1 -1
  102. package/lib/buildSnapshotTree.d.ts +1 -0
  103. package/lib/buildSnapshotTree.d.ts.map +1 -1
  104. package/lib/buildSnapshotTree.js +1 -0
  105. package/lib/buildSnapshotTree.js.map +1 -1
  106. package/lib/documentStorageServiceProxy.d.ts +3 -0
  107. package/lib/documentStorageServiceProxy.d.ts.map +1 -1
  108. package/lib/documentStorageServiceProxy.js +3 -0
  109. package/lib/documentStorageServiceProxy.js.map +1 -1
  110. package/lib/error.d.ts +4 -1
  111. package/lib/error.d.ts.map +1 -1
  112. package/lib/error.js +4 -1
  113. package/lib/error.js.map +1 -1
  114. package/lib/index.d.ts +1 -1
  115. package/lib/index.d.ts.map +1 -1
  116. package/lib/index.js +1 -1
  117. package/lib/index.js.map +1 -1
  118. package/lib/insecureUrlResolver.d.ts +1 -0
  119. package/lib/insecureUrlResolver.d.ts.map +1 -1
  120. package/lib/insecureUrlResolver.js +1 -0
  121. package/lib/insecureUrlResolver.js.map +1 -1
  122. package/lib/messageRecognition.d.ts +10 -0
  123. package/lib/messageRecognition.d.ts.map +1 -1
  124. package/lib/messageRecognition.js +10 -3
  125. package/lib/messageRecognition.js.map +1 -1
  126. package/lib/network.d.ts +49 -3
  127. package/lib/network.d.ts.map +1 -1
  128. package/lib/network.js +45 -5
  129. package/lib/network.js.map +1 -1
  130. package/lib/networkUtils.d.ts +3 -0
  131. package/lib/networkUtils.d.ts.map +1 -1
  132. package/lib/networkUtils.js +3 -0
  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 +12 -0
  138. package/lib/parallelRequests.d.ts.map +1 -1
  139. package/lib/parallelRequests.js +12 -0
  140. package/lib/parallelRequests.js.map +1 -1
  141. package/lib/prefetchDocumentStorageService.d.ts +3 -0
  142. package/lib/prefetchDocumentStorageService.d.ts.map +1 -1
  143. package/lib/prefetchDocumentStorageService.js +3 -0
  144. package/lib/prefetchDocumentStorageService.js.map +1 -1
  145. package/lib/rateLimiter.d.ts +3 -0
  146. package/lib/rateLimiter.d.ts.map +1 -1
  147. package/lib/rateLimiter.js +3 -0
  148. package/lib/rateLimiter.js.map +1 -1
  149. package/lib/readAndParse.d.ts +1 -0
  150. package/lib/readAndParse.d.ts.map +1 -1
  151. package/lib/readAndParse.js +1 -0
  152. package/lib/readAndParse.js.map +1 -1
  153. package/lib/runWithRetry.d.ts +5 -0
  154. package/lib/runWithRetry.d.ts.map +1 -1
  155. package/lib/runWithRetry.js +4 -0
  156. package/lib/runWithRetry.js.map +1 -1
  157. package/lib/summaryForCreateNew.d.ts +2 -0
  158. package/lib/summaryForCreateNew.d.ts.map +1 -1
  159. package/lib/summaryForCreateNew.js +2 -0
  160. package/lib/summaryForCreateNew.js.map +1 -1
  161. package/lib/treeConversions.d.ts +1 -0
  162. package/lib/treeConversions.d.ts.map +1 -1
  163. package/lib/treeConversions.js +1 -0
  164. package/lib/treeConversions.js.map +1 -1
  165. package/package.json +7 -7
  166. package/src/adapters/compression/compressionTypes.ts +6 -0
  167. package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +4 -0
  168. package/src/adapters/predefinedAdapters.ts +1 -0
  169. package/src/blob.ts +3 -0
  170. package/src/buildSnapshotTree.ts +1 -0
  171. package/src/documentStorageServiceProxy.ts +3 -0
  172. package/src/error.ts +4 -1
  173. package/src/index.ts +1 -0
  174. package/src/insecureUrlResolver.ts +1 -0
  175. package/src/messageRecognition.ts +10 -3
  176. package/src/network.ts +49 -6
  177. package/src/networkUtils.ts +3 -0
  178. package/src/packageVersion.ts +1 -1
  179. package/src/parallelRequests.ts +12 -0
  180. package/src/prefetchDocumentStorageService.ts +3 -0
  181. package/src/rateLimiter.ts +3 -0
  182. package/src/readAndParse.ts +1 -0
  183. package/src/runWithRetry.ts +5 -0
  184. package/src/summaryForCreateNew.ts +2 -0
  185. package/src/treeConversions.ts +1 -0
@@ -39,11 +39,13 @@ import { LoggingError } from '@fluidframework/telemetry-utils';
39
39
  * @param documentServiceFactory - The document service factory to apply compression to.
40
40
  * @param config - The compression configuration.
41
41
  * @returns The document service factory possibly with compression applied.
42
+ * @public
42
43
  */
43
44
  export declare function applyStorageCompression(documentServiceFactory: IDocumentServiceFactory, config?: ICompressionStorageConfig | boolean): IDocumentServiceFactory;
44
45
 
45
46
  /**
46
47
  * Basic implementation of an attachment ITreeEntry
48
+ * @public
47
49
  */
48
50
  export declare class AttachmentTreeEntry {
49
51
  readonly path: string;
@@ -59,6 +61,9 @@ export declare class AttachmentTreeEntry {
59
61
  constructor(path: string, id: string);
60
62
  }
61
63
 
64
+ /**
65
+ * @public
66
+ */
62
67
  export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
63
68
  readonly claims: string | undefined;
64
69
  readonly tenantId: string | undefined;
@@ -67,10 +72,14 @@ export declare class AuthorizationError extends LoggingError implements IAuthori
67
72
  constructor(message: string, claims: string | undefined, tenantId: string | undefined, props: DriverErrorTelemetryProps);
68
73
  }
69
74
 
75
+ /**
76
+ * @public
77
+ */
70
78
  export declare const blobHeadersBlobName = ".metadata.blobHeaders";
71
79
 
72
80
  /**
73
81
  * Basic implementation of a blob ITreeEntry
82
+ * @public
74
83
  */
75
84
  export declare class BlobTreeEntry {
76
85
  readonly path: string;
@@ -93,6 +102,7 @@ export declare class BlobTreeEntry {
93
102
  * @param blobMap - a map of blob's sha1 to content that gets filled with content from entries
94
103
  * NOTE: blobMap's validity is contingent on the returned promise's resolution
95
104
  * @returns the hierarchical tree
105
+ * @public
96
106
  */
97
107
  export declare function buildSnapshotTree(entries: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>): ISnapshotTree;
98
108
 
@@ -102,15 +112,21 @@ export declare function buildSnapshotTree(entries: ITreeEntry[], blobMap: Map<st
102
112
  * to when endpoint is reachable in which case it is 30s.
103
113
  * @param error - error based on which we decide max wait time.
104
114
  * @returns Max wait time.
115
+ * @public
105
116
  */
106
117
  export declare function calculateMaxWaitTime(error: unknown): number;
107
118
 
119
+ /**
120
+ * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
121
+ * @public
122
+ */
108
123
  export declare function canBeCoalescedByService(message: ISequencedDocumentMessage | IDocumentMessage): boolean;
109
124
 
110
125
  /**
111
126
  * Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.
112
127
  * I.e. asserts or unexpected exceptions in our code result in container failure.
113
128
  * @param error - The error to inspect for ability to retry
129
+ * @public
114
130
  */
115
131
  export declare const canRetryOnError: (error: any) => boolean;
116
132
 
@@ -129,16 +145,26 @@ export declare interface CombinedAppAndProtocolSummary extends ISummaryTree {
129
145
  /**
130
146
  * Converts ISummaryTree to ITree format.
131
147
  * @param summaryTree - summary tree in ISummaryTree format
148
+ * @public
132
149
  */
133
150
  export declare function convertSummaryTreeToSnapshotITree(summaryTree: ISummaryTree): ITree;
134
151
 
152
+ /**
153
+ * @public
154
+ */
135
155
  export declare function createGenericNetworkError(message: string, retryInfo: {
136
156
  canRetry: boolean;
137
157
  retryAfterMs?: number;
138
158
  }, props: DriverErrorTelemetryProps): ThrottlingError | GenericNetworkError;
139
159
 
160
+ /**
161
+ * @public
162
+ */
140
163
  export declare const createWriteError: (message: string, props: DriverErrorTelemetryProps) => NonRetryableError<"writeError">;
141
164
 
165
+ /**
166
+ * @public
167
+ */
142
168
  export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
143
169
  static readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
144
170
  readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
@@ -147,6 +173,9 @@ export declare class DeltaStreamConnectionForbiddenError extends LoggingError im
147
173
  constructor(message: string, props: DriverErrorTelemetryProps, storageOnlyReason?: string);
148
174
  }
149
175
 
176
+ /**
177
+ * @public
178
+ */
150
179
  export declare class DocumentStorageServiceProxy implements IDocumentStorageService {
151
180
  protected readonly internalStorageService: IDocumentStorageService;
152
181
  private _policies;
@@ -162,15 +191,22 @@ export declare class DocumentStorageServiceProxy implements IDocumentStorageServ
162
191
  readBlob(blobId: string): Promise<ArrayBufferLike>;
163
192
  }
164
193
 
165
- /** Telemetry props with driver-specific required properties */
194
+ /**
195
+ * Telemetry props with driver-specific required properties
196
+ * @public
197
+ */
166
198
  export declare type DriverErrorTelemetryProps = ITelemetryProperties & {
167
199
  driverVersion: string | undefined;
168
200
  };
169
201
 
202
+ /**
203
+ * @public
204
+ */
170
205
  export declare const emptyMessageStream: IStream<ISequencedDocumentMessage[]>;
171
206
 
172
207
  /**
173
208
  * FluidInvalidSchema error class.
209
+ * @public
174
210
  */
175
211
  export declare class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
176
212
  readonly errorType = DriverErrorType.fluidInvalidSchema;
@@ -180,6 +216,7 @@ export declare class FluidInvalidSchemaError extends LoggingError implements IDr
180
216
 
181
217
  /**
182
218
  * Generic network error class.
219
+ * @public
183
220
  */
184
221
  export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
185
222
  readonly canRetry: boolean;
@@ -190,21 +227,32 @@ export declare class GenericNetworkError extends LoggingError implements IDriver
190
227
  /**
191
228
  * Extract the attributes from the protocol summary.
192
229
  * @param protocolSummary - protocol summary from which the values are to be extracted.
230
+ * @public
193
231
  */
194
232
  export declare function getDocAttributesFromProtocolSummary(protocolSummary: ISummaryTree): IDocumentAttributes;
195
233
 
196
234
  /**
197
235
  * Extract quorum values from the protocol summary.
198
236
  * @param protocolSummary - protocol summary from which the values are to be extracted.
237
+ * @public
199
238
  */
200
239
  export declare function getQuorumValuesFromProtocolSummary(protocolSummary: ISummaryTree): [string, ICommittedProposal][];
201
240
 
202
- /** Check retryAfterSeconds property on error and convert to ms */
241
+ /**
242
+ * Check retryAfterSeconds property on error and convert to ms
243
+ * @public
244
+ * */
203
245
  export declare const getRetryDelayFromError: (error: any) => number | undefined;
204
246
 
205
- /** Check retryAfterSeconds property on error */
247
+ /**
248
+ * Check retryAfterSeconds property on error
249
+ * @public
250
+ * */
206
251
  export declare const getRetryDelaySecondsFromError: (error: any) => number | undefined;
207
252
 
253
+ /**
254
+ * @public
255
+ */
208
256
  export declare interface ICompressionStorageConfig {
209
257
  algorithm: SummaryCompressionAlgorithm;
210
258
  minSizeToCompress: number;
@@ -223,6 +271,7 @@ export declare interface ICompressionStorageConfig {
223
271
  * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional
224
272
  * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service
225
273
  * works or a router inside of a single page app framework.
274
+ * @public
226
275
  */
227
276
  export declare class InsecureUrlResolver implements IUrlResolver {
228
277
  private readonly hostUrl;
@@ -242,6 +291,7 @@ export declare class InsecureUrlResolver implements IUrlResolver {
242
291
  /**
243
292
  * Interface describing an object passed to various network APIs.
244
293
  * It allows caller to control cancellation, as well as learn about any delays.
294
+ * @public
245
295
  */
246
296
  export declare interface IProgress {
247
297
  /**
@@ -277,17 +327,27 @@ export declare interface IProgress {
277
327
  */
278
328
  export declare function isCombinedAppAndProtocolSummary(summary: ISummaryTree | undefined, ...optionalRootTrees: string[]): summary is CombinedAppAndProtocolSummary;
279
329
 
330
+ /**
331
+ * It tells if we have local connection only - we might not have connection to web.
332
+ * No solution for node.js (other than resolve dns names / ping specific sites)
333
+ * Can also use window.addEventListener("online" / "offline")
334
+ * @public
335
+ */
280
336
  export declare function isOnline(): OnlineStatus;
281
337
 
282
338
  /**
283
339
  * Tells if message was sent by container runtime
284
340
  * @privateRemarks ADO #1385: To be moved to container-definitions
285
341
  * @returns whether the message is a runtime message
342
+ * @public
286
343
  */
287
344
  export declare function isRuntimeMessage(message: {
288
345
  type: string;
289
346
  }): boolean;
290
347
 
348
+ /**
349
+ * @public
350
+ */
291
351
  export declare class LocationRedirectionError extends LoggingError implements ILocationRedirectionError, IFluidErrorBase {
292
352
  readonly redirectUrl: IResolvedUrl;
293
353
  readonly errorType = DriverErrorType.locationRedirection;
@@ -295,23 +355,40 @@ export declare class LocationRedirectionError extends LoggingError implements IL
295
355
  constructor(message: string, redirectUrl: IResolvedUrl, props: DriverErrorTelemetryProps);
296
356
  }
297
357
 
358
+ /**
359
+ * @public
360
+ */
298
361
  export declare function logNetworkFailure(logger: ITelemetryLoggerExt, event: ITelemetryErrorEvent, error?: any): void;
299
362
 
363
+ /**
364
+ * @privateRemarks ADO #1385: staging code changes across layers.
365
+ * Eventually to be replaced by MessageType.accept
366
+ * @public
367
+ */
300
368
  export declare enum MessageType2 {
301
369
  Accept = "accept"
302
370
  }
303
371
 
372
+ /**
373
+ * @public
374
+ */
304
375
  export declare class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {
305
376
  readonly errorType: T;
306
377
  readonly canRetry: boolean;
307
378
  constructor(message: string, errorType: T, canRetry: boolean, props: DriverErrorTelemetryProps);
308
379
  }
309
380
 
381
+ /**
382
+ * @public
383
+ */
310
384
  export declare class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {
311
385
  readonly errorType: T;
312
386
  constructor(message: string, errorType: T, props: DriverErrorTelemetryProps);
313
387
  }
314
388
 
389
+ /**
390
+ * @public
391
+ */
315
392
  export declare enum OnlineStatus {
316
393
  Offline = 0,
317
394
  Online = 1,
@@ -329,6 +406,7 @@ export declare enum OnlineStatus {
329
406
  * @param logger - logger to use
330
407
  * @param requestCallback - callback to request batches
331
408
  * @returns Queue that can be used to retrieve data
409
+ * @public
332
410
  */
333
411
  export declare class ParallelRequests<T> {
334
412
  private to;
@@ -361,6 +439,9 @@ export declare class ParallelRequests<T> {
361
439
  private addRequestCore;
362
440
  }
363
441
 
442
+ /**
443
+ * @public
444
+ */
364
445
  export declare class PrefetchDocumentStorageService extends DocumentStorageServiceProxy {
365
446
  private readonly prefetchCache;
366
447
  private prefetchEnabled;
@@ -379,6 +460,7 @@ export declare class PrefetchDocumentStorageService extends DocumentStorageServi
379
460
  /**
380
461
  * Helper queue class to allow async push / pull
381
462
  * It's essentially a pipe allowing multiple writers, and single reader
463
+ * @public
382
464
  */
383
465
  export declare class Queue<T> implements IStream<T> {
384
466
  private readonly queue;
@@ -391,6 +473,9 @@ export declare class Queue<T> implements IStream<T> {
391
473
  read(): Promise<IStreamResult<T>>;
392
474
  }
393
475
 
476
+ /**
477
+ * @public
478
+ */
394
479
  export declare class RateLimiter {
395
480
  private maxRequests;
396
481
  private readonly tasks;
@@ -412,6 +497,7 @@ export declare class RateLimiter {
412
497
  * @typeParam T - Output type matching JSON format of inpyt blob data.
413
498
  *
414
499
  * @returns The object that we decoded and parsed via `JSON.parse`.
500
+ * @public
415
501
  */
416
502
  export declare function readAndParse<T>(storage: Pick<IDocumentStorageService, "readBlob">, id: string): Promise<T>;
417
503
 
@@ -426,27 +512,44 @@ export declare function readAndParse<T>(storage: Pick<IDocumentStorageService, "
426
512
  * @param signal - Cancelation signal
427
513
  * @param scenarioName - Reason for fetching ops
428
514
  * @returns Messages fetched
515
+ * @public
429
516
  */
430
517
  export declare function requestOps(get: (from: number, to: number, telemetryProps: ITelemetryProperties) => Promise<IDeltasFetchResult>, concurrency: number, fromTotal: number, toTotal: number | undefined, payloadSize: number, logger: ITelemetryLoggerExt, signal?: AbortSignal, scenarioName?: string): IStream<ISequencedDocumentMessage[]>;
431
518
 
519
+ /**
520
+ * @public
521
+ */
432
522
  export declare class RetryableError<T extends string> extends NetworkErrorBasic<T> {
433
523
  readonly errorType: T;
434
524
  constructor(message: string, errorType: T, props: DriverErrorTelemetryProps);
435
525
  }
436
526
 
527
+ /**
528
+ * @public
529
+ */
437
530
  export declare function runWithRetry<T>(api: (cancel?: AbortSignal) => Promise<T>, fetchCallName: string, logger: ITelemetryLoggerExt, progress: IProgress): Promise<T>;
438
531
 
532
+ /**
533
+ * @public
534
+ */
439
535
  export declare function streamFromMessages(messagesArg: Promise<ISequencedDocumentMessage[]>): IStream<ISequencedDocumentMessage[]>;
440
536
 
537
+ /**
538
+ * @public
539
+ */
441
540
  export declare function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
442
541
 
443
- declare enum SummaryCompressionAlgorithm {
542
+ /**
543
+ * @public
544
+ */
545
+ export declare enum SummaryCompressionAlgorithm {
444
546
  None = 0,
445
547
  LZ4 = 1
446
548
  }
447
549
 
448
550
  /**
449
551
  * Throttling error class - used to communicate all throttling errors
552
+ * @public
450
553
  */
451
554
  export declare class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
452
555
  readonly retryAfterSeconds: number;
@@ -457,6 +560,7 @@ export declare class ThrottlingError extends LoggingError implements IThrottling
457
560
 
458
561
  /**
459
562
  * Basic implementation of a tree ITreeEntry
563
+ * @public
460
564
  */
461
565
  export declare class TreeTreeEntry {
462
566
  readonly path: string;
@@ -471,7 +575,10 @@ export declare class TreeTreeEntry {
471
575
  constructor(path: string, value: ITree);
472
576
  }
473
577
 
474
- /** Error indicating an API is being used improperly resulting in an invalid operation. */
578
+ /**
579
+ * Error indicating an API is being used improperly resulting in an invalid operation.
580
+ * @public
581
+ */
475
582
  export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
476
583
  readonly errorType = DriverErrorType.usageError;
477
584
  readonly canRetry = false;
package/dist/error.d.ts CHANGED
@@ -4,7 +4,10 @@
4
4
  */
5
5
  import { DriverErrorType, IDriverErrorBase } from "@fluidframework/driver-definitions";
6
6
  import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
7
- /** Error indicating an API is being used improperly resulting in an invalid operation. */
7
+ /**
8
+ * Error indicating an API is being used improperly resulting in an invalid operation.
9
+ * @public
10
+ */
8
11
  export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
9
12
  readonly errorType = DriverErrorType.usageError;
10
13
  readonly canRetry = false;
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF,0FAA0F;AAC1F,qBAAa,UAAW,SAAQ,YAAa,YAAW,gBAAgB,EAAE,eAAe;IAExF,QAAQ,CAAC,SAAS,8BAA8B;IAChD,QAAQ,CAAC,QAAQ,SAAS;gBAEd,OAAO,EAAE,MAAM;CAG3B"}
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,qBAAa,UAAW,SAAQ,YAAa,YAAW,gBAAgB,EAAE,eAAe;IAExF,QAAQ,CAAC,SAAS,8BAA8B;IAChD,QAAQ,CAAC,QAAQ,SAAS;gBAEd,OAAO,EAAE,MAAM;CAG3B"}
package/dist/error.js CHANGED
@@ -8,7 +8,10 @@ exports.UsageError = void 0;
8
8
  // eslint-disable-next-line import/no-deprecated
9
9
  const driver_definitions_1 = require("@fluidframework/driver-definitions");
10
10
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
11
- /** Error indicating an API is being used improperly resulting in an invalid operation. */
11
+ /**
12
+ * Error indicating an API is being used improperly resulting in an invalid operation.
13
+ * @public
14
+ */
12
15
  class UsageError extends telemetry_utils_1.LoggingError {
13
16
  constructor(message) {
14
17
  super(message, { usageError: true });
package/dist/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gDAAgD;AAChD,2EAAuF;AACvF,qEAAgF;AAEhF,0FAA0F;AAC1F,MAAa,UAAW,SAAQ,8BAAY;IAK3C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QALtC,gDAAgD;QACvC,cAAS,GAAG,oCAAe,CAAC,UAAU,CAAC;QACvC,aAAQ,GAAG,KAAK,CAAC;IAI1B,CAAC;CACD;AARD,gCAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// eslint-disable-next-line import/no-deprecated\nimport { DriverErrorType, IDriverErrorBase } from \"@fluidframework/driver-definitions\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\n/** Error indicating an API is being used improperly resulting in an invalid operation. */\nexport class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.usageError;\n\treadonly canRetry = false;\n\n\tconstructor(message: string) {\n\t\tsuper(message, { usageError: true });\n\t}\n}\n"]}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gDAAgD;AAChD,2EAAuF;AACvF,qEAAgF;AAEhF;;;GAGG;AACH,MAAa,UAAW,SAAQ,8BAAY;IAK3C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QALtC,gDAAgD;QACvC,cAAS,GAAG,oCAAe,CAAC,UAAU,CAAC;QACvC,aAAQ,GAAG,KAAK,CAAC;IAI1B,CAAC;CACD;AARD,gCAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// eslint-disable-next-line import/no-deprecated\nimport { DriverErrorType, IDriverErrorBase } from \"@fluidframework/driver-definitions\";\nimport { IFluidErrorBase, LoggingError } from \"@fluidframework/telemetry-utils\";\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * @public\n */\nexport class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {\n\t// eslint-disable-next-line import/no-deprecated\n\treadonly errorType = DriverErrorType.usageError;\n\treadonly canRetry = false;\n\n\tconstructor(message: string) {\n\t\tsuper(message, { usageError: true });\n\t}\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -17,5 +17,5 @@ export { readAndParse } from "./readAndParse";
17
17
  export { calculateMaxWaitTime, IProgress, runWithRetry } from "./runWithRetry";
18
18
  export { CombinedAppAndProtocolSummary, getDocAttributesFromProtocolSummary, getQuorumValuesFromProtocolSummary, isCombinedAppAndProtocolSummary, } from "./summaryForCreateNew";
19
19
  export { convertSummaryTreeToSnapshotITree } from "./treeConversions";
20
- export { applyStorageCompression, ICompressionStorageConfig, blobHeadersBlobName, } from "./adapters";
20
+ export { applyStorageCompression, ICompressionStorageConfig, SummaryCompressionAlgorithm, blobHeadersBlobName, } from "./adapters";
21
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,mCAAmC,EACnC,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,QAAQ,EACR,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV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AAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EACN,6BAA6B,EAC7B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EACN,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,GACnB,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.blobHeadersBlobName = exports.applyStorageCompression = exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.runWithRetry = exports.calculateMaxWaitTime = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.MessageType2 = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.UsageError = exports.DocumentStorageServiceProxy = exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = exports.buildSnapshotTree = void 0;
7
+ exports.blobHeadersBlobName = exports.SummaryCompressionAlgorithm = exports.applyStorageCompression = exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.runWithRetry = exports.calculateMaxWaitTime = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.MessageType2 = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.UsageError = exports.DocumentStorageServiceProxy = exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = exports.buildSnapshotTree = void 0;
8
8
  var buildSnapshotTree_1 = require("./buildSnapshotTree");
9
9
  Object.defineProperty(exports, "buildSnapshotTree", { enumerable: true, get: function () { return buildSnapshotTree_1.buildSnapshotTree; } });
10
10
  var blob_1 = require("./blob");
@@ -64,5 +64,6 @@ var treeConversions_1 = require("./treeConversions");
64
64
  Object.defineProperty(exports, "convertSummaryTreeToSnapshotITree", { enumerable: true, get: function () { return treeConversions_1.convertSummaryTreeToSnapshotITree; } });
65
65
  var adapters_1 = require("./adapters");
66
66
  Object.defineProperty(exports, "applyStorageCompression", { enumerable: true, get: function () { return adapters_1.applyStorageCompression; } });
67
+ Object.defineProperty(exports, "SummaryCompressionAlgorithm", { enumerable: true, get: function () { return adapters_1.SummaryCompressionAlgorithm; } });
67
68
  Object.defineProperty(exports, "blobHeadersBlobName", { enumerable: true, get: function () { return adapters_1.blobHeadersBlobName; } });
68
69
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,+BAA2E;AAAlE,qGAAA,aAAa,OAAA;AAAE,qGAAA,aAAa,OAAA;AAAE,2GAAA,mBAAmB,OAAA;AAC1D,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AACnB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2DAA+F;AAAtF,6HAAA,uBAAuB,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAAE,kHAAA,YAAY,OAAA;AAChE,qCAkBmB;AAjBlB,6GAAA,kBAAkB,OAAA;AAClB,0GAAA,eAAe,OAAA;AACf,oHAAA,yBAAyB,OAAA;AACzB,2GAAA,gBAAgB,OAAA;AAChB,8HAAA,mCAAmC,OAAA;AAEnC,kHAAA,uBAAuB,OAAA;AACvB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,wHAAA,6BAA6B,OAAA;AAC7B,mGAAA,QAAQ,OAAA;AACR,mHAAA,wBAAwB,OAAA;AACxB,4GAAA,iBAAiB,OAAA;AACjB,4GAAA,iBAAiB,OAAA;AACjB,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AAEhB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,uDAO4B;AAN3B,sHAAA,kBAAkB,OAAA;AAClB,oHAAA,gBAAgB,OAAA;AAChB,yGAAA,KAAK,OAAA;AACL,8GAAA,UAAU,OAAA;AACV,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AAEf,mFAAkF;AAAzE,gJAAA,8BAA8B,OAAA;AACvC,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+CAA+E;AAAtE,oHAAA,oBAAoB,OAAA;AAAa,4GAAA,YAAY,OAAA;AACtD,6DAK+B;AAH9B,0IAAA,mCAAmC,OAAA;AACnC,yIAAA,kCAAkC,OAAA;AAClC,sIAAA,+BAA+B,OAAA;AAEhC,qDAAsE;AAA7D,oIAAA,iCAAiC,OAAA;AAC1C,uCAIoB;AAHnB,mHAAA,uBAAuB,OAAA;AAEvB,+GAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree\";\nexport { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from \"./blob\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy\";\nexport { UsageError } from \"./error\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver\";\nexport { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from \"./messageRecognition\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network\";\nexport { logNetworkFailure } from \"./networkUtils\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService\";\nexport { RateLimiter } from \"./rateLimiter\";\nexport { readAndParse } from \"./readAndParse\";\nexport { calculateMaxWaitTime, IProgress, runWithRetry } from \"./runWithRetry\";\nexport {\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions\";\nexport {\n\tapplyStorageCompression,\n\tICompressionStorageConfig,\n\tblobHeadersBlobName,\n} from \"./adapters\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,+BAA2E;AAAlE,qGAAA,aAAa,OAAA;AAAE,qGAAA,aAAa,OAAA;AAAE,2GAAA,mBAAmB,OAAA;AAC1D,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AACnB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2DAA+F;AAAtF,6HAAA,uBAAuB,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAAE,kHAAA,YAAY,OAAA;AAChE,qCAkBmB;AAjBlB,6GAAA,kBAAkB,OAAA;AAClB,0GAAA,eAAe,OAAA;AACf,oHAAA,yBAAyB,OAAA;AACzB,2GAAA,gBAAgB,OAAA;AAChB,8HAAA,mCAAmC,OAAA;AAEnC,kHAAA,uBAAuB,OAAA;AACvB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,wHAAA,6BAA6B,OAAA;AAC7B,mGAAA,QAAQ,OAAA;AACR,mHAAA,wBAAwB,OAAA;AACxB,4GAAA,iBAAiB,OAAA;AACjB,4GAAA,iBAAiB,OAAA;AACjB,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AAEhB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,uDAO4B;AAN3B,sHAAA,kBAAkB,OAAA;AAClB,oHAAA,gBAAgB,OAAA;AAChB,yGAAA,KAAK,OAAA;AACL,8GAAA,UAAU,OAAA;AACV,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AAEf,mFAAkF;AAAzE,gJAAA,8BAA8B,OAAA;AACvC,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+CAA+E;AAAtE,oHAAA,oBAAoB,OAAA;AAAa,4GAAA,YAAY,OAAA;AACtD,6DAK+B;AAH9B,0IAAA,mCAAmC,OAAA;AACnC,yIAAA,kCAAkC,OAAA;AAClC,sIAAA,+BAA+B,OAAA;AAEhC,qDAAsE;AAA7D,oIAAA,iCAAiC,OAAA;AAC1C,uCAKoB;AAJnB,mHAAA,uBAAuB,OAAA;AAEvB,uHAAA,2BAA2B,OAAA;AAC3B,+GAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree\";\nexport { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from \"./blob\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy\";\nexport { UsageError } from \"./error\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver\";\nexport { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from \"./messageRecognition\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network\";\nexport { logNetworkFailure } from \"./networkUtils\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService\";\nexport { RateLimiter } from \"./rateLimiter\";\nexport { readAndParse } from \"./readAndParse\";\nexport { calculateMaxWaitTime, IProgress, runWithRetry } from \"./runWithRetry\";\nexport {\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions\";\nexport {\n\tapplyStorageCompression,\n\tICompressionStorageConfig,\n\tSummaryCompressionAlgorithm,\n\tblobHeadersBlobName,\n} from \"./adapters\";\n"]}
@@ -17,6 +17,7 @@ import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
17
17
  * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional
18
18
  * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service
19
19
  * works or a router inside of a single page app framework.
20
+ * @public
20
21
  */
21
22
  export declare class InsecureUrlResolver implements IUrlResolver {
22
23
  private readonly hostUrl;
@@ -1 +1 @@
1
- {"version":3,"file":"insecureUrlResolver.d.ts","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,E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AC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAR/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4C;gBAGhD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,GAAE,OAAe;IAGnC,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IA+C1E,OAAO,CAAC,aAAa;IAiDR,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBrF,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ;CAU1D"}
@@ -25,6 +25,7 @@ const axios_1 = __importDefault(require("axios"));
25
25
  * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional
26
26
  * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service
27
27
  * works or a router inside of a single page app framework.
28
+ * @public
28
29
  */
29
30
  class InsecureUrlResolver {
30
31
  constructor(hostUrl, ordererUrl, storageUrl, tenantId, bearer, isForNodeTest = false) {
@@ -1 +1 @@
1
- {"version":3,"file":"insecureUrlResolver.js","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,6BAA4B;AAC5B,2DAAoD;AAEpD,2EAA8F;AAC9F,kDAA0B;AAE1B;;;;;;;;;;;;;GAaG;AACH,MAAa,mBAAmB;IAG/B,YACkB,OAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,gBAAyB,KAAK;QAL9B,YAAO,GAAP,OAAO,CAAQ;QACf,eAAU,GAAV,UAAU,CAAQ;QAClB,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAA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UAAU,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAExE,IAAI,GAAG,GAAG,WAAW,CAAC;QACtB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACpB;QAED,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAChF,UAAU,CACV,IAAI,GAAG,EAAE,CAAC;IACZ,CAAC;IAEM,sBAAsB,CAAC,QAAiB;QAC9C,MAAM,gBAAgB,GAAa;YAClC,yEAAyE;YACzE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;YACrE,OAAO,EAAE;gBACR,CAAC,iCAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD;AAtID,kDAsIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IResolvedUrl, IUrlResolver, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * fluid://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\treturn this.resolveHelper(documentId, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\tconst documentId = fullPath.split(\"/\")[0];\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/api/v1/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `fluid://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `fluid://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst parsedUrl = parse(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
1
+ {"version":3,"file":"insecureUrlResolver.js","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,6BAA4B;AAC5B,2DAAoD;AAEpD,2EAA8F;AAC9F,kDAA0B;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAa,mBAAmB;IAG/B,YACkB,OAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,gBAAyB,KAAK;QAL9B,YAAO,GAAP,OAAO,CAAQ;QACf,eAAU,GAAV,UAAU,CAAQ;QAClB,eAAU,GAAV,UAAU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AAE,CAAC;QAC9D,yEAAyE;QACzE,IAAA,mBAAM,EAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAExE,IAAI,GAAG,GAAG,WAAW,CAAC;QACtB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACpB;QAED,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAChF,UAAU,CACV,IAAI,GAAG,EAAE,CAAC;IACZ,CAAC;IAEM,sBAAsB,CAAC,QAAiB;QAC9C,MAAM,gBAAgB,GAAa;YAClC,yEAAyE;YACzE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;YACrE,OAAO,EAAE;gBACR,CAAC,iCAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD;AAtID,kDAsIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IResolvedUrl, IUrlResolver, DriverHeader } from \"@fluidframework/driver-definitions\";\nimport Axios from \"axios\";\n\n/**\n * As the name implies this is not secure and should not be used in production. It simply makes the example easier\n * to get up and running.\n *\n * In our example we run a simple web server via webpack-dev-server. This defines a URL format of the form\n * http://localhost:8080/<documentId>/<path>.\n *\n * We then need to map that to a Fluid based URL. These are of the form\n * fluid://orderingUrl/<tenantId>/<documentId>/<path>.\n *\n * The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional\n * part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service\n * works or a router inside of a single page app framework.\n * @public\n */\nexport class InsecureUrlResolver implements IUrlResolver {\n\tprivate readonly cache = new Map<string, Promise<IResolvedUrl>>();\n\n\tconstructor(\n\t\tprivate readonly hostUrl: string,\n\t\tprivate readonly ordererUrl: string,\n\t\tprivate readonly storageUrl: string,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly bearer: string,\n\t\tprivate readonly isForNodeTest: boolean = false,\n\t) {}\n\n\tpublic async resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (request.headers?.[DriverHeader.createNew]) {\n\t\t\tconst [, queryString] = request.url.split(\"?\");\n\t\t\tconst searchParams = new URLSearchParams(queryString);\n\t\t\tconst fileName = searchParams.get(\"fileName\");\n\t\t\treturn this.resolveHelper(fileName);\n\t\t}\n\t\tconst parsedUrl = new URL(request.url);\n\t\t// If hosts match then we use the local tenant information. Otherwise we make a REST call out to the hosting\n\t\t// service using our bearer token.\n\t\tif (this.isForNodeTest) {\n\t\t\tconst [, documentId, tmpRelativePath] = parsedUrl.pathname.substr(1).split(\"/\");\n\t\t\tconst relativePath = tmpRelativePath ?? \"\";\n\t\t\treturn this.resolveHelper(documentId, relativePath, parsedUrl.search);\n\t\t} else if (parsedUrl.host === window.location.host) {\n\t\t\tconst fullPath = parsedUrl.pathname.substr(1);\n\t\t\tconst documentId = fullPath.split(\"/\")[0];\n\t\t\tconst documentRelativePath = fullPath.slice(documentId.length);\n\t\t\treturn this.resolveHelper(documentId, documentRelativePath);\n\t\t} else {\n\t\t\tconst maybeResolvedUrl = this.cache.get(request.url);\n\t\t\tif (maybeResolvedUrl) {\n\t\t\t\treturn maybeResolvedUrl;\n\t\t\t}\n\n\t\t\tconst headers = {\n\t\t\t\tAuthorization: `Bearer ${this.bearer}`,\n\t\t\t};\n\t\t\tconst resolvedP = Axios.post<IResolvedUrl>(\n\t\t\t\t`${this.hostUrl}/api/v1/load`,\n\t\t\t\t{\n\t\t\t\t\turl: request.url,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theaders,\n\t\t\t\t},\n\t\t\t);\n\t\t\tthis.cache.set(\n\t\t\t\trequest.url,\n\t\t\t\tresolvedP.then((resolved) => resolved.data),\n\t\t\t);\n\n\t\t\treturn this.cache.get(request.url);\n\t\t}\n\t}\n\n\tprivate resolveHelper(\n\t\tdocumentId: string | null,\n\t\tdocumentRelativePath: string = \"\",\n\t\tqueryParams: string = \"\",\n\t) {\n\t\tconst encodedTenantId = encodeURIComponent(this.tenantId);\n\t\tconst host = new URL(this.ordererUrl).host;\n\t\t// when the document ID is not provided we need to resolve a special create new document URL.\n\t\t// the actual container ID will be generated by the driver.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tif (!documentId) {\n\t\t\tconst createNewResponse: IResolvedUrl = {\n\t\t\t\tendpoints: {\n\t\t\t\t\tdeltaStorageUrl: `${this.ordererUrl}/deltas/${encodedTenantId}/new`,\n\t\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\t\tstorageUrl: `${this.storageUrl}/repos/${encodedTenantId}`,\n\t\t\t\t},\n\t\t\t\t// document ID is ignored by the driver for new container requests\n\t\t\t\tid: \"\",\n\t\t\t\ttokens: {},\n\t\t\t\ttype: \"fluid\",\n\t\t\t\turl: `fluid://${host}/${encodedTenantId}/new`,\n\t\t\t};\n\t\t\treturn createNewResponse;\n\t\t}\n\t\tconst encodedDocId = encodeURIComponent(documentId);\n\t\tconst relativePath =\n\t\t\t!documentRelativePath || documentRelativePath.startsWith(\"/\")\n\t\t\t\t? documentRelativePath\n\t\t\t\t: `/${documentRelativePath}`;\n\t\tconst documentUrl = `fluid://${host}/${encodedTenantId}/${encodedDocId}${relativePath}${queryParams}`;\n\n\t\tconst deltaStorageUrl = `${this.ordererUrl}/deltas/${encodedTenantId}/${encodedDocId}`;\n\t\tconst storageUrl = `${this.storageUrl}/repos/${encodedTenantId}`;\n\n\t\tconst response: IResolvedUrl = {\n\t\t\tendpoints: {\n\t\t\t\tdeltaStorageUrl,\n\t\t\t\tordererUrl: this.ordererUrl,\n\t\t\t\tstorageUrl,\n\t\t\t},\n\t\t\tid: documentId,\n\t\t\ttokens: {},\n\t\t\ttype: \"fluid\",\n\t\t\turl: documentUrl,\n\t\t};\n\t\treturn response;\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tconst parsedUrl = parse(resolvedUrl.url);\n\t\tconst [, , documentId] = parsedUrl.pathname?.split(\"/\") ?? [];\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\tassert(!!documentId, 0x273 /* \"Invalid document id from parsed URL\" */);\n\n\t\tlet url = relativeUrl;\n\t\tif (url.startsWith(\"/\")) {\n\t\t\turl = url.substr(1);\n\t\t}\n\n\t\treturn `${this.hostUrl}/${encodeURIComponent(this.tenantId)}/${encodeURIComponent(\n\t\t\tdocumentId,\n\t\t)}/${url}`;\n\t}\n\n\tpublic createCreateNewRequest(fileName?: string): IRequest {\n\t\tconst createNewRequest: IRequest = {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\turl: fileName ? `${this.hostUrl}?fileName=${fileName}` : this.hostUrl,\n\t\t\theaders: {\n\t\t\t\t[DriverHeader.createNew]: true,\n\t\t\t},\n\t\t};\n\t\treturn createNewRequest;\n\t}\n}\n"]}
@@ -7,12 +7,22 @@ import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/pro
7
7
  * Tells if message was sent by container runtime
8
8
  * @privateRemarks ADO #1385: To be moved to container-definitions
9
9
  * @returns whether the message is a runtime message
10
+ * @public
10
11
  */
11
12
  export declare function isRuntimeMessage(message: {
12
13
  type: string;
13
14
  }): boolean;
15
+ /**
16
+ * @privateRemarks ADO #1385: staging code changes across layers.
17
+ * Eventually to be replaced by MessageType.accept
18
+ * @public
19
+ */
14
20
  export declare enum MessageType2 {
15
21
  Accept = "accept"
16
22
  }
23
+ /**
24
+ * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
25
+ * @public
26
+ */
17
27
  export declare function canBeCoalescedByService(message: ISequencedDocumentMessage | IDocumentMessage): boolean;
18
28
  //# sourceMappingURL=messageRecognition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messageRecognition.d.ts","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEnE;AAID,oBAAY,YAAY;IACvB,MAAM,WAAW;CACjB;AAGD,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,yBAAyB,GAAG,gBAAgB,GACnD,OAAO,CAIT"}
1
+ {"version":3,"file":"messageRecognition.d.ts","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EAEzB,MAAM,sCAAsC,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEnE;AAED;;;;GAIG;AACH,oBAAY,YAAY;IACvB,MAAM,WAAW;CACjB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,yBAAyB,GAAG,gBAAgB,GACnD,OAAO,CAIT"}
@@ -10,18 +10,25 @@ const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
10
10
  * Tells if message was sent by container runtime
11
11
  * @privateRemarks ADO #1385: To be moved to container-definitions
12
12
  * @returns whether the message is a runtime message
13
+ * @public
13
14
  */
14
15
  function isRuntimeMessage(message) {
15
16
  return message.type === protocol_definitions_1.MessageType.Operation;
16
17
  }
17
18
  exports.isRuntimeMessage = isRuntimeMessage;
18
- // ADO #1385: staging code changes across layers.
19
- // Eventually to be replaced by MessageType.accept
19
+ /**
20
+ * @privateRemarks ADO #1385: staging code changes across layers.
21
+ * Eventually to be replaced by MessageType.accept
22
+ * @public
23
+ */
20
24
  var MessageType2;
21
25
  (function (MessageType2) {
22
26
  MessageType2["Accept"] = "accept";
23
27
  })(MessageType2 || (exports.MessageType2 = MessageType2 = {}));
24
- // ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
28
+ /**
29
+ * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
30
+ * @public
31
+ */
25
32
  function canBeCoalescedByService(message) {
26
33
  // This assumes that in the future relay service may implement coalescing of accept messages,
27
34
  // same way it was doing coalescing of immediate noops in the past.
@@ -1 +1 @@
1
- {"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+EAI8C;AAE9C;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAFD,4CAEC;AAED,iDAAiD;AACjD,kDAAkD;AAClD,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB;AAED,mEAAmE;AACnE,SAAgB,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC;AAND,0DAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Tells if message was sent by container runtime\n * @privateRemarks ADO #1385: To be moved to container-definitions\n * @returns whether the message is a runtime message\n */\nexport function isRuntimeMessage(message: { type: string }): boolean {\n\treturn message.type === MessageType.Operation;\n}\n\n// ADO #1385: staging code changes across layers.\n// Eventually to be replaced by MessageType.accept\nexport enum MessageType2 {\n\tAccept = \"accept\",\n}\n\n// ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\nexport function canBeCoalescedByService(\n\tmessage: ISequencedDocumentMessage | IDocumentMessage,\n): boolean {\n\t// This assumes that in the future relay service may implement coalescing of accept messages,\n\t// same way it was doing coalescing of immediate noops in the past.\n\treturn message.type === MessageType.NoOp || message.type === MessageType2.Accept;\n}\n"]}
1
+ {"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+EAI8C;AAE9C;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAFD,4CAEC;AAED;;;;GAIG;AACH,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,kCAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC;AAND,0DAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tMessageType,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Tells if message was sent by container runtime\n * @privateRemarks ADO #1385: To be moved to container-definitions\n * @returns whether the message is a runtime message\n * @public\n */\nexport function isRuntimeMessage(message: { type: string }): boolean {\n\treturn message.type === MessageType.Operation;\n}\n\n/**\n * @privateRemarks ADO #1385: staging code changes across layers.\n * Eventually to be replaced by MessageType.accept\n * @public\n */\nexport enum MessageType2 {\n\tAccept = \"accept\",\n}\n\n/**\n * @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts\n * @public\n */\nexport function canBeCoalescedByService(\n\tmessage: ISequencedDocumentMessage | IDocumentMessage,\n): boolean {\n\t// This assumes that in the future relay service may implement coalescing of accept messages,\n\t// same way it was doing coalescing of immediate noops in the past.\n\treturn message.type === MessageType.NoOp || message.type === MessageType2.Accept;\n}\n"]}