@fluidframework/driver-utils 2.0.0-dev.7.3.0.212138 → 2.0.0-dev.7.4.0.214930

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