@fluidframework/driver-utils 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.217212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-extractor-lint.json +13 -0
- package/api-report/driver-utils.api.md +47 -47
- package/dist/adapters/compression/compressionTypes.d.ts +2 -2
- package/dist/adapters/compression/compressionTypes.js +1 -1
- package/dist/adapters/compression/compressionTypes.js.map +1 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +1 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +1 -1
- package/dist/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
- package/dist/adapters/predefinedAdapters.d.ts +1 -1
- package/dist/adapters/predefinedAdapters.js +1 -1
- package/dist/adapters/predefinedAdapters.js.map +1 -1
- package/dist/blob.d.ts +3 -3
- package/dist/blob.js +3 -3
- package/dist/blob.js.map +1 -1
- package/dist/buildSnapshotTree.d.ts +1 -1
- package/dist/buildSnapshotTree.js +1 -1
- package/dist/buildSnapshotTree.js.map +1 -1
- package/dist/documentStorageServiceProxy.d.ts +1 -1
- package/dist/documentStorageServiceProxy.js +1 -1
- package/dist/documentStorageServiceProxy.js.map +1 -1
- package/dist/driver-utils-alpha.d.ts +104 -538
- package/dist/driver-utils-beta.d.ts +131 -552
- package/dist/driver-utils-public.d.ts +131 -552
- package/dist/driver-utils-untrimmed.d.ts +49 -49
- package/dist/error.d.ts +1 -1
- package/dist/error.js +1 -1
- package/dist/error.js.map +1 -1
- package/dist/insecureUrlResolver.d.ts +1 -1
- package/dist/insecureUrlResolver.js +1 -1
- package/dist/insecureUrlResolver.js.map +1 -1
- package/dist/messageRecognition.d.ts +3 -3
- package/dist/messageRecognition.js +3 -3
- package/dist/messageRecognition.js.map +1 -1
- package/dist/network.d.ts +19 -19
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +18 -18
- package/dist/network.js.map +1 -1
- package/dist/networkUtils.d.ts +1 -1
- package/dist/networkUtils.js +1 -1
- package/dist/networkUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/parallelRequests.d.ts +6 -6
- package/dist/parallelRequests.js +6 -6
- package/dist/parallelRequests.js.map +1 -1
- package/dist/prefetchDocumentStorageService.d.ts +1 -1
- package/dist/prefetchDocumentStorageService.js +1 -1
- package/dist/prefetchDocumentStorageService.js.map +1 -1
- package/dist/rateLimiter.d.ts +1 -1
- package/dist/rateLimiter.js +1 -1
- package/dist/rateLimiter.js.map +1 -1
- package/dist/readAndParse.d.ts +1 -1
- package/dist/readAndParse.js +1 -1
- package/dist/readAndParse.js.map +1 -1
- package/dist/runWithRetry.d.ts +3 -3
- package/dist/runWithRetry.js +2 -2
- package/dist/runWithRetry.js.map +1 -1
- package/dist/summaryForCreateNew.d.ts +2 -2
- package/dist/summaryForCreateNew.js +2 -2
- package/dist/summaryForCreateNew.js.map +1 -1
- package/dist/treeConversions.d.ts +1 -1
- package/dist/treeConversions.js +1 -1
- package/dist/treeConversions.js.map +1 -1
- package/lib/adapters/compression/compressionTypes.d.ts +2 -2
- package/lib/adapters/compression/compressionTypes.js +1 -1
- package/lib/adapters/compression/compressionTypes.js.map +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.d.ts +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js +1 -1
- package/lib/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.js.map +1 -1
- package/lib/adapters/predefinedAdapters.d.ts +1 -1
- package/lib/adapters/predefinedAdapters.js +1 -1
- package/lib/adapters/predefinedAdapters.js.map +1 -1
- package/lib/blob.d.ts +3 -3
- package/lib/blob.js +3 -3
- package/lib/blob.js.map +1 -1
- package/lib/buildSnapshotTree.d.ts +1 -1
- package/lib/buildSnapshotTree.js +1 -1
- package/lib/buildSnapshotTree.js.map +1 -1
- package/lib/documentStorageServiceProxy.d.ts +1 -1
- package/lib/documentStorageServiceProxy.js +1 -1
- package/lib/documentStorageServiceProxy.js.map +1 -1
- package/lib/driver-utils-alpha.d.ts +104 -538
- package/lib/driver-utils-beta.d.ts +131 -552
- package/lib/driver-utils-public.d.ts +131 -552
- package/lib/driver-utils-untrimmed.d.ts +49 -49
- package/lib/error.d.ts +1 -1
- package/lib/error.js +1 -1
- package/lib/error.js.map +1 -1
- package/lib/insecureUrlResolver.d.ts +1 -1
- package/lib/insecureUrlResolver.js +1 -1
- package/lib/insecureUrlResolver.js.map +1 -1
- package/lib/messageRecognition.d.ts +3 -3
- package/lib/messageRecognition.js +3 -3
- package/lib/messageRecognition.js.map +1 -1
- package/lib/network.d.ts +19 -19
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js +18 -18
- package/lib/network.js.map +1 -1
- package/lib/networkUtils.d.ts +1 -1
- package/lib/networkUtils.js +1 -1
- package/lib/networkUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/parallelRequests.d.ts +6 -6
- package/lib/parallelRequests.js +6 -6
- package/lib/parallelRequests.js.map +1 -1
- package/lib/prefetchDocumentStorageService.d.ts +1 -1
- package/lib/prefetchDocumentStorageService.js +1 -1
- package/lib/prefetchDocumentStorageService.js.map +1 -1
- package/lib/rateLimiter.d.ts +1 -1
- package/lib/rateLimiter.js +1 -1
- package/lib/rateLimiter.js.map +1 -1
- package/lib/readAndParse.d.ts +1 -1
- package/lib/readAndParse.js +1 -1
- package/lib/readAndParse.js.map +1 -1
- package/lib/runWithRetry.d.ts +3 -3
- package/lib/runWithRetry.js +2 -2
- package/lib/runWithRetry.js.map +1 -1
- package/lib/summaryForCreateNew.d.ts +2 -2
- package/lib/summaryForCreateNew.js +2 -2
- package/lib/summaryForCreateNew.js.map +1 -1
- package/lib/treeConversions.d.ts +1 -1
- package/lib/treeConversions.js +1 -1
- package/lib/treeConversions.js.map +1 -1
- package/package.json +9 -8
- package/src/adapters/compression/compressionTypes.ts +2 -2
- package/src/adapters/compression/summaryblob/documentStorageServiceSummaryBlobCompressionAdapter.ts +1 -1
- package/src/adapters/predefinedAdapters.ts +1 -1
- package/src/blob.ts +3 -3
- package/src/buildSnapshotTree.ts +1 -1
- package/src/documentStorageServiceProxy.ts +1 -1
- package/src/error.ts +1 -1
- package/src/insecureUrlResolver.ts +1 -1
- package/src/messageRecognition.ts +3 -3
- package/src/network.ts +19 -19
- package/src/networkUtils.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +6 -6
- package/src/prefetchDocumentStorageService.ts +1 -1
- package/src/rateLimiter.ts +1 -1
- package/src/readAndParse.ts +1 -1
- package/src/runWithRetry.ts +3 -3
- package/src/summaryForCreateNew.ts +2 -2
- package/src/treeConversions.ts +1 -1
|
@@ -39,13 +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
|
-
* @
|
|
42
|
+
* @internal
|
|
43
43
|
*/
|
|
44
44
|
export declare function applyStorageCompression(documentServiceFactory: IDocumentServiceFactory, config?: ICompressionStorageConfig | boolean): IDocumentServiceFactory;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Basic implementation of an attachment ITreeEntry
|
|
48
|
-
* @
|
|
48
|
+
* @internal
|
|
49
49
|
*/
|
|
50
50
|
export declare class AttachmentTreeEntry {
|
|
51
51
|
readonly path: string;
|
|
@@ -62,7 +62,7 @@ export declare class AttachmentTreeEntry {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* @
|
|
65
|
+
* @internal
|
|
66
66
|
*/
|
|
67
67
|
export declare class AuthorizationError extends LoggingError implements IAuthorizationError, IFluidErrorBase {
|
|
68
68
|
readonly claims: string | undefined;
|
|
@@ -73,13 +73,13 @@ export declare class AuthorizationError extends LoggingError implements IAuthori
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
|
-
* @
|
|
76
|
+
* @internal
|
|
77
77
|
*/
|
|
78
78
|
export declare const blobHeadersBlobName = ".metadata.blobHeaders";
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* Basic implementation of a blob ITreeEntry
|
|
82
|
-
* @
|
|
82
|
+
* @internal
|
|
83
83
|
*/
|
|
84
84
|
export declare class BlobTreeEntry {
|
|
85
85
|
readonly path: string;
|
|
@@ -102,7 +102,7 @@ export declare class BlobTreeEntry {
|
|
|
102
102
|
* @param blobMap - a map of blob's sha1 to content that gets filled with content from entries
|
|
103
103
|
* NOTE: blobMap's validity is contingent on the returned promise's resolution
|
|
104
104
|
* @returns the hierarchical tree
|
|
105
|
-
* @
|
|
105
|
+
* @internal
|
|
106
106
|
*/
|
|
107
107
|
export declare function buildSnapshotTree(entries: ITreeEntry[], blobMap: Map<string, ArrayBufferLike>): ISnapshotTree;
|
|
108
108
|
|
|
@@ -114,13 +114,13 @@ export declare function buildSnapshotTree(entries: ITreeEntry[], blobMap: Map<st
|
|
|
114
114
|
* @param delayMs - wait time for previous iteration
|
|
115
115
|
* @param error - error based on which we decide wait time.
|
|
116
116
|
* @returns Wait time to wait for.
|
|
117
|
-
* @
|
|
117
|
+
* @internal
|
|
118
118
|
*/
|
|
119
119
|
export declare function calculateMaxWaitTime(delayMs: number, error: unknown): number;
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
|
|
123
|
-
* @
|
|
123
|
+
* @internal
|
|
124
124
|
*/
|
|
125
125
|
export declare function canBeCoalescedByService(message: ISequencedDocumentMessage | IDocumentMessage): boolean;
|
|
126
126
|
|
|
@@ -128,7 +128,7 @@ export declare function canBeCoalescedByService(message: ISequencedDocumentMessa
|
|
|
128
128
|
* Check if a connection error can be retried. Unless explicitly allowed, retry is disallowed.
|
|
129
129
|
* I.e. asserts or unexpected exceptions in our code result in container failure.
|
|
130
130
|
* @param error - The error to inspect for ability to retry
|
|
131
|
-
* @
|
|
131
|
+
* @internal
|
|
132
132
|
*/
|
|
133
133
|
export declare const canRetryOnError: (error: any) => boolean;
|
|
134
134
|
|
|
@@ -147,12 +147,12 @@ export declare interface CombinedAppAndProtocolSummary extends ISummaryTree {
|
|
|
147
147
|
/**
|
|
148
148
|
* Converts ISummaryTree to ITree format.
|
|
149
149
|
* @param summaryTree - summary tree in ISummaryTree format
|
|
150
|
-
* @
|
|
150
|
+
* @internal
|
|
151
151
|
*/
|
|
152
152
|
export declare function convertSummaryTreeToSnapshotITree(summaryTree: ISummaryTree): ITree;
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
|
-
* @
|
|
155
|
+
* @internal
|
|
156
156
|
*/
|
|
157
157
|
export declare function createGenericNetworkError(message: string, retryInfo: {
|
|
158
158
|
canRetry: boolean;
|
|
@@ -160,12 +160,12 @@ export declare function createGenericNetworkError(message: string, retryInfo: {
|
|
|
160
160
|
}, props: DriverErrorTelemetryProps): ThrottlingError | GenericNetworkError;
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
|
-
* @
|
|
163
|
+
* @internal
|
|
164
164
|
*/
|
|
165
165
|
export declare const createWriteError: (message: string, props: DriverErrorTelemetryProps) => NonRetryableError<"writeError">;
|
|
166
166
|
|
|
167
167
|
/**
|
|
168
|
-
* @
|
|
168
|
+
* @internal
|
|
169
169
|
*/
|
|
170
170
|
export declare class DeltaStreamConnectionForbiddenError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
171
171
|
static readonly errorType = DriverErrorType.deltaStreamConnectionForbidden;
|
|
@@ -176,7 +176,7 @@ export declare class DeltaStreamConnectionForbiddenError extends LoggingError im
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
/**
|
|
179
|
-
* @
|
|
179
|
+
* @internal
|
|
180
180
|
*/
|
|
181
181
|
export declare class DocumentStorageServiceProxy implements IDocumentStorageService {
|
|
182
182
|
protected readonly internalStorageService: IDocumentStorageService;
|
|
@@ -195,20 +195,20 @@ export declare class DocumentStorageServiceProxy implements IDocumentStorageServ
|
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* Telemetry props with driver-specific required properties
|
|
198
|
-
* @
|
|
198
|
+
* @internal
|
|
199
199
|
*/
|
|
200
200
|
export declare type DriverErrorTelemetryProps = ITelemetryProperties & {
|
|
201
201
|
driverVersion: string | undefined;
|
|
202
202
|
};
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
|
-
* @
|
|
205
|
+
* @internal
|
|
206
206
|
*/
|
|
207
207
|
export declare const emptyMessageStream: IStream<ISequencedDocumentMessage[]>;
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* FluidInvalidSchema error class.
|
|
211
|
-
* @
|
|
211
|
+
* @internal
|
|
212
212
|
*/
|
|
213
213
|
export declare class FluidInvalidSchemaError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
214
214
|
readonly errorType = DriverErrorType.fluidInvalidSchema;
|
|
@@ -218,7 +218,7 @@ export declare class FluidInvalidSchemaError extends LoggingError implements IDr
|
|
|
218
218
|
|
|
219
219
|
/**
|
|
220
220
|
* Generic network error class.
|
|
221
|
-
* @
|
|
221
|
+
* @internal
|
|
222
222
|
*/
|
|
223
223
|
export declare class GenericNetworkError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
224
224
|
readonly canRetry: boolean;
|
|
@@ -229,31 +229,31 @@ export declare class GenericNetworkError extends LoggingError implements IDriver
|
|
|
229
229
|
/**
|
|
230
230
|
* Extract the attributes from the protocol summary.
|
|
231
231
|
* @param protocolSummary - protocol summary from which the values are to be extracted.
|
|
232
|
-
* @
|
|
232
|
+
* @internal
|
|
233
233
|
*/
|
|
234
234
|
export declare function getDocAttributesFromProtocolSummary(protocolSummary: ISummaryTree): IDocumentAttributes;
|
|
235
235
|
|
|
236
236
|
/**
|
|
237
237
|
* Extract quorum values from the protocol summary.
|
|
238
238
|
* @param protocolSummary - protocol summary from which the values are to be extracted.
|
|
239
|
-
* @
|
|
239
|
+
* @internal
|
|
240
240
|
*/
|
|
241
241
|
export declare function getQuorumValuesFromProtocolSummary(protocolSummary: ISummaryTree): [string, ICommittedProposal][];
|
|
242
242
|
|
|
243
243
|
/**
|
|
244
244
|
* Check retryAfterSeconds property on error and convert to ms
|
|
245
|
-
* @
|
|
246
|
-
|
|
245
|
+
* @internal
|
|
246
|
+
*/
|
|
247
247
|
export declare const getRetryDelayFromError: (error: any) => number | undefined;
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
250
|
* Check retryAfterSeconds property on error
|
|
251
|
-
* @
|
|
252
|
-
|
|
251
|
+
* @internal
|
|
252
|
+
*/
|
|
253
253
|
export declare const getRetryDelaySecondsFromError: (error: any) => number | undefined;
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
* @
|
|
256
|
+
* @internal
|
|
257
257
|
*/
|
|
258
258
|
export declare interface ICompressionStorageConfig {
|
|
259
259
|
algorithm: SummaryCompressionAlgorithm;
|
|
@@ -273,7 +273,7 @@ export declare interface ICompressionStorageConfig {
|
|
|
273
273
|
* The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional
|
|
274
274
|
* part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service
|
|
275
275
|
* works or a router inside of a single page app framework.
|
|
276
|
-
* @
|
|
276
|
+
* @internal
|
|
277
277
|
*/
|
|
278
278
|
export declare class InsecureUrlResolver implements IUrlResolver {
|
|
279
279
|
private readonly hostUrl;
|
|
@@ -293,7 +293,7 @@ export declare class InsecureUrlResolver implements IUrlResolver {
|
|
|
293
293
|
/**
|
|
294
294
|
* Interface describing an object passed to various network APIs.
|
|
295
295
|
* It allows caller to control cancellation, as well as learn about any delays.
|
|
296
|
-
* @
|
|
296
|
+
* @internal
|
|
297
297
|
*/
|
|
298
298
|
export declare interface IProgress {
|
|
299
299
|
/**
|
|
@@ -333,7 +333,7 @@ export declare function isCombinedAppAndProtocolSummary(summary: ISummaryTree |
|
|
|
333
333
|
* It tells if we have local connection only - we might not have connection to web.
|
|
334
334
|
* No solution for node.js (other than resolve dns names / ping specific sites)
|
|
335
335
|
* Can also use window.addEventListener("online" / "offline")
|
|
336
|
-
* @
|
|
336
|
+
* @internal
|
|
337
337
|
*/
|
|
338
338
|
export declare function isOnline(): OnlineStatus;
|
|
339
339
|
|
|
@@ -341,14 +341,14 @@ export declare function isOnline(): OnlineStatus;
|
|
|
341
341
|
* Tells if message was sent by container runtime
|
|
342
342
|
* @privateRemarks ADO #1385: To be moved to container-definitions
|
|
343
343
|
* @returns whether the message is a runtime message
|
|
344
|
-
* @
|
|
344
|
+
* @internal
|
|
345
345
|
*/
|
|
346
346
|
export declare function isRuntimeMessage(message: {
|
|
347
347
|
type: string;
|
|
348
348
|
}): boolean;
|
|
349
349
|
|
|
350
350
|
/**
|
|
351
|
-
* @
|
|
351
|
+
* @internal
|
|
352
352
|
*/
|
|
353
353
|
export declare class LocationRedirectionError extends LoggingError implements ILocationRedirectionError, IFluidErrorBase {
|
|
354
354
|
readonly redirectUrl: IResolvedUrl;
|
|
@@ -358,21 +358,21 @@ export declare class LocationRedirectionError extends LoggingError implements IL
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
|
-
* @
|
|
361
|
+
* @internal
|
|
362
362
|
*/
|
|
363
363
|
export declare function logNetworkFailure(logger: ITelemetryLoggerExt, event: ITelemetryErrorEvent, error?: any): void;
|
|
364
364
|
|
|
365
365
|
/**
|
|
366
366
|
* @privateRemarks ADO #1385: staging code changes across layers.
|
|
367
367
|
* Eventually to be replaced by MessageType.accept
|
|
368
|
-
* @
|
|
368
|
+
* @internal
|
|
369
369
|
*/
|
|
370
370
|
export declare enum MessageType2 {
|
|
371
371
|
Accept = "accept"
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
/**
|
|
375
|
-
* @
|
|
375
|
+
* @internal
|
|
376
376
|
*/
|
|
377
377
|
export declare class NetworkErrorBasic<T extends string> extends LoggingError implements IFluidErrorBase {
|
|
378
378
|
readonly errorType: T;
|
|
@@ -381,7 +381,7 @@ export declare class NetworkErrorBasic<T extends string> extends LoggingError im
|
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
/**
|
|
384
|
-
* @
|
|
384
|
+
* @internal
|
|
385
385
|
*/
|
|
386
386
|
export declare class NonRetryableError<T extends string> extends NetworkErrorBasic<T> {
|
|
387
387
|
readonly errorType: T;
|
|
@@ -389,7 +389,7 @@ export declare class NonRetryableError<T extends string> extends NetworkErrorBas
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
/**
|
|
392
|
-
* @
|
|
392
|
+
* @internal
|
|
393
393
|
*/
|
|
394
394
|
export declare enum OnlineStatus {
|
|
395
395
|
Offline = 0,
|
|
@@ -408,7 +408,7 @@ export declare enum OnlineStatus {
|
|
|
408
408
|
* @param logger - logger to use
|
|
409
409
|
* @param requestCallback - callback to request batches
|
|
410
410
|
* @returns Queue that can be used to retrieve data
|
|
411
|
-
* @
|
|
411
|
+
* @internal
|
|
412
412
|
*/
|
|
413
413
|
export declare class ParallelRequests<T> {
|
|
414
414
|
private to;
|
|
@@ -442,7 +442,7 @@ export declare class ParallelRequests<T> {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
/**
|
|
445
|
-
* @
|
|
445
|
+
* @internal
|
|
446
446
|
*/
|
|
447
447
|
export declare class PrefetchDocumentStorageService extends DocumentStorageServiceProxy {
|
|
448
448
|
private readonly prefetchCache;
|
|
@@ -462,7 +462,7 @@ export declare class PrefetchDocumentStorageService extends DocumentStorageServi
|
|
|
462
462
|
/**
|
|
463
463
|
* Helper queue class to allow async push / pull
|
|
464
464
|
* It's essentially a pipe allowing multiple writers, and single reader
|
|
465
|
-
* @
|
|
465
|
+
* @internal
|
|
466
466
|
*/
|
|
467
467
|
export declare class Queue<T> implements IStream<T> {
|
|
468
468
|
private readonly queue;
|
|
@@ -476,7 +476,7 @@ export declare class Queue<T> implements IStream<T> {
|
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
/**
|
|
479
|
-
* @
|
|
479
|
+
* @internal
|
|
480
480
|
*/
|
|
481
481
|
export declare class RateLimiter {
|
|
482
482
|
private maxRequests;
|
|
@@ -499,7 +499,7 @@ export declare class RateLimiter {
|
|
|
499
499
|
* @typeParam T - Output type matching JSON format of inpyt blob data.
|
|
500
500
|
*
|
|
501
501
|
* @returns The object that we decoded and parsed via `JSON.parse`.
|
|
502
|
-
* @
|
|
502
|
+
* @internal
|
|
503
503
|
*/
|
|
504
504
|
export declare function readAndParse<T>(storage: Pick<IDocumentStorageService, "readBlob">, id: string): Promise<T>;
|
|
505
505
|
|
|
@@ -514,12 +514,12 @@ export declare function readAndParse<T>(storage: Pick<IDocumentStorageService, "
|
|
|
514
514
|
* @param signal - Cancelation signal
|
|
515
515
|
* @param scenarioName - Reason for fetching ops
|
|
516
516
|
* @returns Messages fetched
|
|
517
|
-
* @
|
|
517
|
+
* @internal
|
|
518
518
|
*/
|
|
519
519
|
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[]>;
|
|
520
520
|
|
|
521
521
|
/**
|
|
522
|
-
* @
|
|
522
|
+
* @internal
|
|
523
523
|
*/
|
|
524
524
|
export declare class RetryableError<T extends string> extends NetworkErrorBasic<T> {
|
|
525
525
|
readonly errorType: T;
|
|
@@ -527,22 +527,22 @@ export declare class RetryableError<T extends string> extends NetworkErrorBasic<
|
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
/**
|
|
530
|
-
* @
|
|
530
|
+
* @internal
|
|
531
531
|
*/
|
|
532
532
|
export declare function runWithRetry<T>(api: (cancel?: AbortSignal) => Promise<T>, fetchCallName: string, logger: ITelemetryLoggerExt, progress: IProgress): Promise<T>;
|
|
533
533
|
|
|
534
534
|
/**
|
|
535
|
-
* @
|
|
535
|
+
* @internal
|
|
536
536
|
*/
|
|
537
537
|
export declare function streamFromMessages(messagesArg: Promise<ISequencedDocumentMessage[]>): IStream<ISequencedDocumentMessage[]>;
|
|
538
538
|
|
|
539
539
|
/**
|
|
540
|
-
* @
|
|
540
|
+
* @internal
|
|
541
541
|
*/
|
|
542
542
|
export declare function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
|
|
543
543
|
|
|
544
544
|
/**
|
|
545
|
-
* @
|
|
545
|
+
* @internal
|
|
546
546
|
*/
|
|
547
547
|
export declare enum SummaryCompressionAlgorithm {
|
|
548
548
|
None = 0,
|
|
@@ -551,7 +551,7 @@ export declare enum SummaryCompressionAlgorithm {
|
|
|
551
551
|
|
|
552
552
|
/**
|
|
553
553
|
* Throttling error class - used to communicate all throttling errors
|
|
554
|
-
* @
|
|
554
|
+
* @internal
|
|
555
555
|
*/
|
|
556
556
|
export declare class ThrottlingError extends LoggingError implements IThrottlingWarning, IFluidErrorBase {
|
|
557
557
|
readonly retryAfterSeconds: number;
|
|
@@ -562,7 +562,7 @@ export declare class ThrottlingError extends LoggingError implements IThrottling
|
|
|
562
562
|
|
|
563
563
|
/**
|
|
564
564
|
* Basic implementation of a tree ITreeEntry
|
|
565
|
-
* @
|
|
565
|
+
* @internal
|
|
566
566
|
*/
|
|
567
567
|
export declare class TreeTreeEntry {
|
|
568
568
|
readonly path: string;
|
|
@@ -579,7 +579,7 @@ export declare class TreeTreeEntry {
|
|
|
579
579
|
|
|
580
580
|
/**
|
|
581
581
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
582
|
-
* @
|
|
582
|
+
* @internal
|
|
583
583
|
*/
|
|
584
584
|
export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
585
585
|
readonly errorType = DriverErrorType.usageError;
|
package/lib/error.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { DriverErrorType, IDriverErrorBase } from "@fluidframework/driver-defini
|
|
|
6
6
|
import { IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
|
|
7
7
|
/**
|
|
8
8
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
9
|
-
* @
|
|
9
|
+
* @internal
|
|
10
10
|
*/
|
|
11
11
|
export declare class UsageError extends LoggingError implements IDriverErrorBase, IFluidErrorBase {
|
|
12
12
|
readonly errorType = DriverErrorType.usageError;
|
package/lib/error.js
CHANGED
|
@@ -7,7 +7,7 @@ import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
|
7
7
|
import { LoggingError } from "@fluidframework/telemetry-utils";
|
|
8
8
|
/**
|
|
9
9
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
10
|
-
* @
|
|
10
|
+
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export class UsageError extends LoggingError {
|
|
13
13
|
constructor(message) {
|
package/lib/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,gDAAgD;AAChD,OAAO,EAAE,eAAe,EAAoB,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAK3C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QALtC,gDAAgD;QACvC,cAAS,GAAG,eAAe,CAAC,UAAU,CAAC;QACvC,aAAQ,GAAG,KAAK,CAAC;IAI1B,CAAC;CACD","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 * @
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,gDAAgD;AAChD,OAAO,EAAE,eAAe,EAAoB,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAmB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAK3C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QALtC,gDAAgD;QACvC,cAAS,GAAG,eAAe,CAAC,UAAU,CAAC;QACvC,aAAQ,GAAG,KAAK,CAAC;IAI1B,CAAC;CACD","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 * @internal\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"]}
|
|
@@ -17,7 +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
|
-
* @
|
|
20
|
+
* @internal
|
|
21
21
|
*/
|
|
22
22
|
export declare class InsecureUrlResolver implements IUrlResolver {
|
|
23
23
|
private readonly hostUrl;
|
|
@@ -19,7 +19,7 @@ import Axios from "axios";
|
|
|
19
19
|
* The tenantId/documentId pair defines the 'full' document ID the service makes use of. The path is then an optional
|
|
20
20
|
* part of the URL that the document interprets and maps to a data store. It's exactly similar to how a web service
|
|
21
21
|
* works or a router inside of a single page app framework.
|
|
22
|
-
* @
|
|
22
|
+
* @internal
|
|
23
23
|
*/
|
|
24
24
|
export class InsecureUrlResolver {
|
|
25
25
|
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,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAA8B,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,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,MAAM,CAAQ;QACd,kBAAa,GAAb,aAAa,CAAiB;QAR/B,UAAK,GAAG,IAAI,GAAG,EAAiC,CAAC;IAS/D,CAAC;IAEG,KAAK,CAAC,OAAO,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xB,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,YAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD","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"]}
|
|
1
|
+
{"version":3,"file":"insecureUrlResolver.js","sourceRoot":"","sources":["../src/insecureUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAA8B,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,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;QA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yEAAyE;QACzE,MAAM,CAAC,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,YAAY,CAAC,SAAS,CAAC,EAAE,IAAI;aAC9B;SACD,CAAC;QACF,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD","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 * @internal\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,7 +7,7 @@ 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
|
-
* @
|
|
10
|
+
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export declare function isRuntimeMessage(message: {
|
|
13
13
|
type: string;
|
|
@@ -15,14 +15,14 @@ export declare function isRuntimeMessage(message: {
|
|
|
15
15
|
/**
|
|
16
16
|
* @privateRemarks ADO #1385: staging code changes across layers.
|
|
17
17
|
* Eventually to be replaced by MessageType.accept
|
|
18
|
-
* @
|
|
18
|
+
* @internal
|
|
19
19
|
*/
|
|
20
20
|
export declare enum MessageType2 {
|
|
21
21
|
Accept = "accept"
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
|
|
25
|
-
* @
|
|
25
|
+
* @internal
|
|
26
26
|
*/
|
|
27
27
|
export declare function canBeCoalescedByService(message: ISequencedDocumentMessage | IDocumentMessage): boolean;
|
|
28
28
|
//# sourceMappingURL=messageRecognition.d.ts.map
|
|
@@ -7,7 +7,7 @@ import { MessageType, } from "@fluidframework/protocol-definitions";
|
|
|
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
|
-
* @
|
|
10
|
+
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export function isRuntimeMessage(message) {
|
|
13
13
|
return message.type === MessageType.Operation;
|
|
@@ -15,7 +15,7 @@ export function isRuntimeMessage(message) {
|
|
|
15
15
|
/**
|
|
16
16
|
* @privateRemarks ADO #1385: staging code changes across layers.
|
|
17
17
|
* Eventually to be replaced by MessageType.accept
|
|
18
|
-
* @
|
|
18
|
+
* @internal
|
|
19
19
|
*/
|
|
20
20
|
export var MessageType2;
|
|
21
21
|
(function (MessageType2) {
|
|
@@ -23,7 +23,7 @@ export var MessageType2;
|
|
|
23
23
|
})(MessageType2 || (MessageType2 = {}));
|
|
24
24
|
/**
|
|
25
25
|
* @privateRemarks ADO #1385: To be moved to packages/protocol-base/src/protocol.ts
|
|
26
|
-
* @
|
|
26
|
+
* @internal
|
|
27
27
|
*/
|
|
28
28
|
export function canBeCoalescedByService(message) {
|
|
29
29
|
// This assumes that in the future relay service may implement coalescing of accept messages,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,WAAW,GACX,MAAM,sCAAsC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,KAAZ,YAAY,QAEvB;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC","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 * @
|
|
1
|
+
{"version":3,"file":"messageRecognition.js","sourceRoot":"","sources":["../src/messageRecognition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,WAAW,GACX,MAAM,sCAAsC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAyB;IACzD,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,YAEX;AAFD,WAAY,YAAY;IACvB,iCAAiB,CAAA;AAClB,CAAC,EAFW,YAAY,KAAZ,YAAY,QAEvB;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACtC,OAAqD;IAErD,6FAA6F;IAC7F,mEAAmE;IACnE,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM,CAAC;AAClF,CAAC","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 * @internal\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 * @internal\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 * @internal\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"]}
|