@fluidframework/test-utils 2.20.0 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/TestSummaryUtils.d.ts.map +1 -1
  3. package/dist/TestSummaryUtils.js +4 -1
  4. package/dist/TestSummaryUtils.js.map +1 -1
  5. package/dist/index.d.ts +1 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -6
  8. package/dist/index.js.map +1 -1
  9. package/dist/packageVersion.d.ts +1 -1
  10. package/dist/packageVersion.js +1 -1
  11. package/dist/packageVersion.js.map +1 -1
  12. package/dist/testFluidObject.d.ts +1 -1
  13. package/dist/testFluidObject.d.ts.map +1 -1
  14. package/dist/testFluidObject.js +2 -4
  15. package/dist/testFluidObject.js.map +1 -1
  16. package/dist/timeoutUtils.d.ts +0 -4
  17. package/dist/timeoutUtils.d.ts.map +1 -1
  18. package/dist/timeoutUtils.js +1 -6
  19. package/dist/timeoutUtils.js.map +1 -1
  20. package/lib/TestSummaryUtils.d.ts.map +1 -1
  21. package/lib/TestSummaryUtils.js +4 -1
  22. package/lib/TestSummaryUtils.js.map +1 -1
  23. package/lib/index.d.ts +1 -2
  24. package/lib/index.d.ts.map +1 -1
  25. package/lib/index.js +1 -2
  26. package/lib/index.js.map +1 -1
  27. package/lib/packageVersion.d.ts +1 -1
  28. package/lib/packageVersion.js +1 -1
  29. package/lib/packageVersion.js.map +1 -1
  30. package/lib/testFluidObject.d.ts +1 -1
  31. package/lib/testFluidObject.d.ts.map +1 -1
  32. package/lib/testFluidObject.js +2 -4
  33. package/lib/testFluidObject.js.map +1 -1
  34. package/lib/timeoutUtils.d.ts +0 -4
  35. package/lib/timeoutUtils.d.ts.map +1 -1
  36. package/lib/timeoutUtils.js +0 -5
  37. package/lib/timeoutUtils.js.map +1 -1
  38. package/package.json +26 -33
  39. package/src/TestSummaryUtils.ts +3 -0
  40. package/src/index.ts +0 -6
  41. package/src/packageVersion.ts +1 -1
  42. package/src/testFluidObject.ts +3 -6
  43. package/src/timeoutUtils.ts +0 -6
  44. package/dist/DriverWrappers.d.ts +0 -35
  45. package/dist/DriverWrappers.d.ts.map +0 -1
  46. package/dist/DriverWrappers.js +0 -60
  47. package/dist/DriverWrappers.js.map +0 -1
  48. package/lib/DriverWrappers.d.ts +0 -35
  49. package/lib/DriverWrappers.d.ts.map +0 -1
  50. package/lib/DriverWrappers.js +0 -54
  51. package/lib/DriverWrappers.js.map +0 -1
  52. package/src/DriverWrappers.ts +0 -90
@@ -1,90 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
- import { ISummaryTree } from "@fluidframework/driver-definitions";
8
- import {
9
- IDocumentService,
10
- IDocumentServiceFactory,
11
- IDocumentStorageService,
12
- IResolvedUrl,
13
- ISummaryContext,
14
- } from "@fluidframework/driver-definitions/internal";
15
-
16
- /**
17
- * @deprecated - unused
18
- * Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
19
- * `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
20
- * callback before it is uploaded to the server.
21
- * @internal
22
- */
23
- export function wrapDocumentStorageService(
24
- innerDocStorageService: IDocumentStorageService,
25
- uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
26
- ) {
27
- const outerDocStorageService = Object.create(
28
- innerDocStorageService,
29
- ) as IDocumentStorageService;
30
- outerDocStorageService.uploadSummaryWithContext = async (
31
- summary: ISummaryTree,
32
- context: ISummaryContext,
33
- ): Promise<string> => {
34
- const newContext = uploadSummaryCb(summary, context);
35
- return innerDocStorageService.uploadSummaryWithContext(summary, newContext);
36
- };
37
- return outerDocStorageService;
38
- }
39
-
40
- /**
41
- * @deprecated - unused
42
- * Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
43
- * `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
44
- * the client.
45
- * The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
46
- * to pass in the `uploadSummaryCb`.
47
- * @internal
48
- */
49
- export function wrapDocumentService(
50
- innerDocService: IDocumentService,
51
- uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
52
- ) {
53
- const outerDocService = Object.create(innerDocService) as IDocumentService;
54
- outerDocService.connectToStorage = async (): Promise<IDocumentStorageService> => {
55
- const storageService = await innerDocService.connectToStorage();
56
- return wrapDocumentStorageService(storageService, uploadSummaryCb);
57
- };
58
- return outerDocService;
59
- }
60
-
61
- /**
62
- * @deprecated - unused
63
- * Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
64
- * the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
65
- * uploaded by the client.
66
- * The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
67
- * pass in the `uploadSummaryCb`.
68
- * @internal
69
- */
70
- export function wrapDocumentServiceFactory(
71
- innerDocServiceFactory: IDocumentServiceFactory,
72
- uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
73
- ) {
74
- const outerDocServiceFactory = Object.create(
75
- innerDocServiceFactory,
76
- ) as IDocumentServiceFactory;
77
- outerDocServiceFactory.createDocumentService = async (
78
- resolvedUrl: IResolvedUrl,
79
- logger?: ITelemetryBaseLogger,
80
- clientIsSummarizer?: boolean,
81
- ): Promise<IDocumentService> => {
82
- const documentService = await innerDocServiceFactory.createDocumentService(
83
- resolvedUrl,
84
- logger,
85
- clientIsSummarizer,
86
- );
87
- return wrapDocumentService(documentService, uploadSummaryCb);
88
- };
89
- return outerDocServiceFactory;
90
- }