@fluidframework/local-driver 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.245554

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 (113) hide show
  1. package/.eslintrc.cjs +5 -5
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +20 -0
  4. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  5. package/api-extractor-lint.json +1 -1
  6. package/api-extractor.json +1 -1
  7. package/api-report/local-driver.api.md +4 -2
  8. package/dist/index.d.ts +7 -7
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +16 -16
  11. package/dist/index.js.map +1 -1
  12. package/dist/local-driver-alpha.d.ts +2 -2
  13. package/dist/local-driver-beta.d.ts +6 -0
  14. package/dist/local-driver-public.d.ts +6 -0
  15. package/dist/local-driver-untrimmed.d.ts +28 -3
  16. package/dist/localDocumentService.d.ts +1 -1
  17. package/dist/localDocumentService.d.ts.map +1 -1
  18. package/dist/localDocumentService.js +7 -7
  19. package/dist/localDocumentService.js.map +1 -1
  20. package/dist/localDocumentServiceFactory.d.ts +0 -1
  21. package/dist/localDocumentServiceFactory.d.ts.map +1 -1
  22. package/dist/localDocumentServiceFactory.js +6 -8
  23. package/dist/localDocumentServiceFactory.js.map +1 -1
  24. package/dist/localDocumentStorageService.d.ts +27 -2
  25. package/dist/localDocumentStorageService.d.ts.map +1 -1
  26. package/dist/localDocumentStorageService.js +130 -3
  27. package/dist/localDocumentStorageService.js.map +1 -1
  28. package/dist/localResolver.d.ts +0 -1
  29. package/dist/localResolver.d.ts.map +1 -1
  30. package/dist/localResolver.js +4 -6
  31. package/dist/localResolver.js.map +1 -1
  32. package/dist/localSessionStorageDb.js +2 -2
  33. package/dist/localSessionStorageDb.js.map +1 -1
  34. package/dist/package.json +3 -0
  35. package/dist/tsdoc-metadata.json +1 -1
  36. package/lib/{auth.d.mts → auth.d.ts} +1 -1
  37. package/lib/auth.d.ts.map +1 -0
  38. package/lib/{auth.mjs → auth.js} +1 -1
  39. package/lib/auth.js.map +1 -0
  40. package/lib/{index.mjs → index.d.ts} +8 -8
  41. package/lib/index.d.ts.map +1 -0
  42. package/lib/{index.d.mts → index.js} +8 -8
  43. package/lib/index.js.map +1 -0
  44. package/lib/{local-driver-alpha.d.mts → local-driver-alpha.d.ts} +2 -2
  45. package/lib/{local-driver-beta.d.mts → local-driver-beta.d.ts} +6 -0
  46. package/lib/{local-driver-public.d.mts → local-driver-public.d.ts} +6 -0
  47. package/lib/{local-driver-untrimmed.d.mts → local-driver-untrimmed.d.ts} +28 -3
  48. package/lib/{localCreateDocument.d.mts → localCreateDocument.d.ts} +1 -1
  49. package/lib/localCreateDocument.d.ts.map +1 -0
  50. package/lib/{localCreateDocument.mjs → localCreateDocument.js} +1 -1
  51. package/lib/localCreateDocument.js.map +1 -0
  52. package/lib/{localDeltaStorageService.d.mts → localDeltaStorageService.d.ts} +1 -1
  53. package/lib/localDeltaStorageService.d.ts.map +1 -0
  54. package/lib/{localDeltaStorageService.mjs → localDeltaStorageService.js} +1 -1
  55. package/lib/localDeltaStorageService.js.map +1 -0
  56. package/lib/{localDocumentDeltaConnection.d.mts → localDocumentDeltaConnection.d.ts} +1 -1
  57. package/lib/localDocumentDeltaConnection.d.ts.map +1 -0
  58. package/lib/{localDocumentDeltaConnection.mjs → localDocumentDeltaConnection.js} +1 -1
  59. package/lib/localDocumentDeltaConnection.js.map +1 -0
  60. package/lib/{localDocumentService.d.mts → localDocumentService.d.ts} +2 -2
  61. package/lib/localDocumentService.d.ts.map +1 -0
  62. package/lib/{localDocumentService.mjs → localDocumentService.js} +5 -5
  63. package/lib/localDocumentService.js.map +1 -0
  64. package/lib/{localDocumentServiceFactory.d.mts → localDocumentServiceFactory.d.ts} +1 -2
  65. package/lib/localDocumentServiceFactory.d.ts.map +1 -0
  66. package/lib/{localDocumentServiceFactory.mjs → localDocumentServiceFactory.js} +5 -7
  67. package/lib/localDocumentServiceFactory.js.map +1 -0
  68. package/lib/{localDocumentStorageService.d.mts → localDocumentStorageService.d.ts} +28 -3
  69. package/lib/localDocumentStorageService.d.ts.map +1 -0
  70. package/lib/localDocumentStorageService.js +211 -0
  71. package/lib/localDocumentStorageService.js.map +1 -0
  72. package/lib/{localResolver.d.mts → localResolver.d.ts} +1 -2
  73. package/lib/localResolver.d.ts.map +1 -0
  74. package/lib/{localResolver.mjs → localResolver.js} +4 -6
  75. package/lib/localResolver.js.map +1 -0
  76. package/lib/{localSessionStorageDb.d.mts → localSessionStorageDb.d.ts} +1 -1
  77. package/lib/localSessionStorageDb.d.ts.map +1 -0
  78. package/lib/{localSessionStorageDb.mjs → localSessionStorageDb.js} +6 -2
  79. package/lib/localSessionStorageDb.js.map +1 -0
  80. package/lib/test/localResolverTest.spec.js +47 -0
  81. package/lib/test/localResolverTest.spec.js.map +1 -0
  82. package/lib/test/types/validateLocalDriverPrevious.generated.js +26 -0
  83. package/lib/test/types/validateLocalDriverPrevious.generated.js.map +1 -0
  84. package/package.json +49 -54
  85. package/src/index.ts +7 -7
  86. package/src/localDocumentService.ts +4 -4
  87. package/src/localDocumentServiceFactory.ts +5 -7
  88. package/src/localDocumentStorageService.ts +180 -4
  89. package/src/localResolver.ts +3 -5
  90. package/src/localSessionStorageDb.ts +1 -1
  91. package/tsconfig.cjs.json +7 -0
  92. package/tsconfig.json +2 -5
  93. package/lib/auth.d.mts.map +0 -1
  94. package/lib/auth.mjs.map +0 -1
  95. package/lib/index.d.mts.map +0 -1
  96. package/lib/index.mjs.map +0 -1
  97. package/lib/localCreateDocument.d.mts.map +0 -1
  98. package/lib/localCreateDocument.mjs.map +0 -1
  99. package/lib/localDeltaStorageService.d.mts.map +0 -1
  100. package/lib/localDeltaStorageService.mjs.map +0 -1
  101. package/lib/localDocumentDeltaConnection.d.mts.map +0 -1
  102. package/lib/localDocumentDeltaConnection.mjs.map +0 -1
  103. package/lib/localDocumentService.d.mts.map +0 -1
  104. package/lib/localDocumentService.mjs.map +0 -1
  105. package/lib/localDocumentServiceFactory.d.mts.map +0 -1
  106. package/lib/localDocumentServiceFactory.mjs.map +0 -1
  107. package/lib/localDocumentStorageService.d.mts.map +0 -1
  108. package/lib/localDocumentStorageService.mjs +0 -84
  109. package/lib/localDocumentStorageService.mjs.map +0 -1
  110. package/lib/localResolver.d.mts.map +0 -1
  111. package/lib/localResolver.mjs.map +0 -1
  112. package/lib/localSessionStorageDb.d.mts.map +0 -1
  113. package/lib/localSessionStorageDb.mjs.map +0 -1
package/.eslintrc.cjs CHANGED
@@ -4,15 +4,15 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
7
+ extends: [
8
+ require.resolve("@fluidframework/eslint-config-fluid/minimal-deprecated"),
9
+ "prettier",
10
+ ],
8
11
  parserOptions: {
9
12
  project: ["./tsconfig.json", "./src/test/tsconfig.json"],
10
13
  },
11
14
  rules: {
12
15
  "@typescript-eslint/strict-boolean-expressions": "off",
13
-
14
- // This library is used in the browser, so we don't want dependencies on most node libraries.
15
- "import/no-nodejs-modules": ["error", { allow: ["url", "events"] }],
16
16
  },
17
17
  overrides: [
18
18
  {
@@ -20,7 +20,7 @@ module.exports = {
20
20
  files: ["*.spec.ts", "src/test/**"],
21
21
  rules: {
22
22
  // Test files are run in node only so additional node libraries can be used.
23
- "import/no-nodejs-modules": ["error", { allow: ["assert", "url", "events"] }],
23
+ "import/no-nodejs-modules": ["error", { allow: ["assert"] }],
24
24
  },
25
25
  },
26
26
  ],
@@ -5,7 +5,7 @@
5
5
 
6
6
  "use strict";
7
7
 
8
- const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
8
+ const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
9
9
 
10
10
  const packageDir = __dirname;
11
11
  const config = getFluidTestMochaConfig(packageDir);
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @fluidframework/local-driver
2
2
 
3
+ ## 2.0.0-rc.2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Resolved URLs no longer use non-standard protocols ([#19840](https://github.com/microsoft/FluidFramework/issues/19840)) [9d3d185183](https://github.com/microsoft/FluidFramework/commits/9d3d1851830d953792a6dfad60dde6f1c59480de)
8
+
9
+ Previously, `IResolvedUrl.url` could use a non-standard protocol like `fluid://`, `fluid-odsp://`, or `fluid-test://`. These have been replaced with `https://` to permit standards-compliant URL parsing.
10
+
11
+ - driver-definitions: repositoryUrl removed from IDocumentStorageService ([#19522](https://github.com/microsoft/FluidFramework/issues/19522)) [90eb3c9d33](https://github.com/microsoft/FluidFramework/commits/90eb3c9d33d80e24caa1393a50f414c5602f6aa3)
12
+
13
+ The `repositoryUrl` member of `IDocumentStorageService` was unused and always equal to the empty string. It has been removed.
14
+
15
+ - container-definitions: Added containerMetadata prop on IContainer interface ([#19142](https://github.com/microsoft/FluidFramework/issues/19142)) [d0d77f3516](https://github.com/microsoft/FluidFramework/commits/d0d77f3516d67f3c9faedb47b20dbd4e309c3bc2)
16
+
17
+ Added `containerMetadata` prop on IContainer interface.
18
+
19
+ - runtime-definitions: Moved ISignalEnvelope interface to core-interfaces ([#19142](https://github.com/microsoft/FluidFramework/issues/19142)) [d0d77f3516](https://github.com/microsoft/FluidFramework/commits/d0d77f3516d67f3c9faedb47b20dbd4e309c3bc2)
20
+
21
+ The `ISignalEnvelope` interface has been moved to the @fluidframework/core-interfaces package.
22
+
3
23
  ## 2.0.0-rc.1.0.0
4
24
 
5
25
  ### Minor Changes
@@ -1,4 +1,8 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base-esm.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
4
+ // CJS is actually secondary; so, no report.
5
+ "apiReport": {
6
+ "enabled": false
7
+ }
4
8
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-lint.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.esm.primary.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-base.esm.primary.json"
4
4
  }
@@ -23,6 +23,8 @@ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server
23
23
  import { IRequest } from '@fluidframework/core-interfaces';
24
24
  import { IResolvedUrl } from '@fluidframework/driver-definitions';
25
25
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
26
+ import { ISnapshot } from '@fluidframework/driver-definitions';
27
+ import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
26
28
  import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
27
29
  import { IStream } from '@fluidframework/driver-definitions';
28
30
  import { ISummaryContext } from '@fluidframework/driver-definitions';
@@ -95,6 +97,8 @@ export class LocalDocumentStorageService implements IDocumentStorageService {
95
97
  // (undocumented)
96
98
  downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
97
99
  // (undocumented)
100
+ getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
101
+ // (undocumented)
98
102
  getSnapshotTree(version?: IVersion): Promise<ISnapshotTreeEx | null>;
99
103
  // (undocumented)
100
104
  getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
@@ -103,8 +107,6 @@ export class LocalDocumentStorageService implements IDocumentStorageService {
103
107
  // (undocumented)
104
108
  readBlob(blobId: string): Promise<ArrayBufferLike>;
105
109
  // (undocumented)
106
- readonly repositoryUrl: string;
107
- // (undocumented)
108
110
  uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
109
111
  }
110
112
 
package/dist/index.d.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { LocalDeltaStorageService } from "./localDeltaStorageService";
6
- export { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection";
7
- export { createLocalDocumentService, LocalDocumentService } from "./localDocumentService";
8
- export { LocalDocumentServiceFactory } from "./localDocumentServiceFactory";
9
- export { LocalDocumentStorageService } from "./localDocumentStorageService";
10
- export { createLocalResolverCreateNewRequest, LocalResolver } from "./localResolver";
11
- export { LocalSessionStorageDbFactory } from "./localSessionStorageDb";
5
+ export { LocalDeltaStorageService } from "./localDeltaStorageService.js";
6
+ export { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection.js";
7
+ export { createLocalDocumentService, LocalDocumentService } from "./localDocumentService.js";
8
+ export { LocalDocumentServiceFactory } from "./localDocumentServiceFactory.js";
9
+ export { LocalDocumentStorageService } from "./localDocumentStorageService.js";
10
+ export { createLocalResolverCreateNewRequest, LocalResolver } from "./localResolver.js";
11
+ export { LocalSessionStorageDbFactory } from "./localSessionStorageDb.js";
12
12
  //# 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,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,mCAAmC,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,mCAAmC,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -5,20 +5,20 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.LocalSessionStorageDbFactory = exports.LocalResolver = exports.createLocalResolverCreateNewRequest = exports.LocalDocumentStorageService = exports.LocalDocumentServiceFactory = exports.LocalDocumentService = exports.createLocalDocumentService = exports.LocalDocumentDeltaConnection = exports.LocalDeltaStorageService = void 0;
8
- var localDeltaStorageService_1 = require("./localDeltaStorageService");
9
- Object.defineProperty(exports, "LocalDeltaStorageService", { enumerable: true, get: function () { return localDeltaStorageService_1.LocalDeltaStorageService; } });
10
- var localDocumentDeltaConnection_1 = require("./localDocumentDeltaConnection");
11
- Object.defineProperty(exports, "LocalDocumentDeltaConnection", { enumerable: true, get: function () { return localDocumentDeltaConnection_1.LocalDocumentDeltaConnection; } });
12
- var localDocumentService_1 = require("./localDocumentService");
13
- Object.defineProperty(exports, "createLocalDocumentService", { enumerable: true, get: function () { return localDocumentService_1.createLocalDocumentService; } });
14
- Object.defineProperty(exports, "LocalDocumentService", { enumerable: true, get: function () { return localDocumentService_1.LocalDocumentService; } });
15
- var localDocumentServiceFactory_1 = require("./localDocumentServiceFactory");
16
- Object.defineProperty(exports, "LocalDocumentServiceFactory", { enumerable: true, get: function () { return localDocumentServiceFactory_1.LocalDocumentServiceFactory; } });
17
- var localDocumentStorageService_1 = require("./localDocumentStorageService");
18
- Object.defineProperty(exports, "LocalDocumentStorageService", { enumerable: true, get: function () { return localDocumentStorageService_1.LocalDocumentStorageService; } });
19
- var localResolver_1 = require("./localResolver");
20
- Object.defineProperty(exports, "createLocalResolverCreateNewRequest", { enumerable: true, get: function () { return localResolver_1.createLocalResolverCreateNewRequest; } });
21
- Object.defineProperty(exports, "LocalResolver", { enumerable: true, get: function () { return localResolver_1.LocalResolver; } });
22
- var localSessionStorageDb_1 = require("./localSessionStorageDb");
23
- Object.defineProperty(exports, "LocalSessionStorageDbFactory", { enumerable: true, get: function () { return localSessionStorageDb_1.LocalSessionStorageDbFactory; } });
8
+ var localDeltaStorageService_js_1 = require("./localDeltaStorageService.js");
9
+ Object.defineProperty(exports, "LocalDeltaStorageService", { enumerable: true, get: function () { return localDeltaStorageService_js_1.LocalDeltaStorageService; } });
10
+ var localDocumentDeltaConnection_js_1 = require("./localDocumentDeltaConnection.js");
11
+ Object.defineProperty(exports, "LocalDocumentDeltaConnection", { enumerable: true, get: function () { return localDocumentDeltaConnection_js_1.LocalDocumentDeltaConnection; } });
12
+ var localDocumentService_js_1 = require("./localDocumentService.js");
13
+ Object.defineProperty(exports, "createLocalDocumentService", { enumerable: true, get: function () { return localDocumentService_js_1.createLocalDocumentService; } });
14
+ Object.defineProperty(exports, "LocalDocumentService", { enumerable: true, get: function () { return localDocumentService_js_1.LocalDocumentService; } });
15
+ var localDocumentServiceFactory_js_1 = require("./localDocumentServiceFactory.js");
16
+ Object.defineProperty(exports, "LocalDocumentServiceFactory", { enumerable: true, get: function () { return localDocumentServiceFactory_js_1.LocalDocumentServiceFactory; } });
17
+ var localDocumentStorageService_js_1 = require("./localDocumentStorageService.js");
18
+ Object.defineProperty(exports, "LocalDocumentStorageService", { enumerable: true, get: function () { return localDocumentStorageService_js_1.LocalDocumentStorageService; } });
19
+ var localResolver_js_1 = require("./localResolver.js");
20
+ Object.defineProperty(exports, "createLocalResolverCreateNewRequest", { enumerable: true, get: function () { return localResolver_js_1.createLocalResolverCreateNewRequest; } });
21
+ Object.defineProperty(exports, "LocalResolver", { enumerable: true, get: function () { return localResolver_js_1.LocalResolver; } });
22
+ var localSessionStorageDb_js_1 = require("./localSessionStorageDb.js");
23
+ Object.defineProperty(exports, "LocalSessionStorageDbFactory", { enumerable: true, get: function () { return localSessionStorageDb_js_1.LocalSessionStorageDbFactory; } });
24
24
  //# 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,uEAAsE;AAA7D,oIAAA,wBAAwB,OAAA;AACjC,+EAA8E;AAArE,4IAAA,4BAA4B,OAAA;AACrC,+DAA0F;AAAjF,kIAAA,0BAA0B,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AACzD,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,iDAAqF;AAA5E,oIAAA,mCAAmC,OAAA;AAAE,8GAAA,aAAa,OAAA;AAC3D,iEAAuE;AAA9D,qIAAA,4BAA4B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { LocalDeltaStorageService } from \"./localDeltaStorageService\";\nexport { LocalDocumentDeltaConnection } from \"./localDocumentDeltaConnection\";\nexport { createLocalDocumentService, LocalDocumentService } from \"./localDocumentService\";\nexport { LocalDocumentServiceFactory } from \"./localDocumentServiceFactory\";\nexport { LocalDocumentStorageService } from \"./localDocumentStorageService\";\nexport { createLocalResolverCreateNewRequest, LocalResolver } from \"./localResolver\";\nexport { LocalSessionStorageDbFactory } from \"./localSessionStorageDb\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,qEAA6F;AAApF,qIAAA,0BAA0B,OAAA;AAAE,+HAAA,oBAAoB,OAAA;AACzD,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,uDAAwF;AAA/E,uIAAA,mCAAmC,OAAA;AAAE,iHAAA,aAAa,OAAA;AAC3D,uEAA0E;AAAjE,wIAAA,4BAA4B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { LocalDeltaStorageService } from \"./localDeltaStorageService.js\";\nexport { LocalDocumentDeltaConnection } from \"./localDocumentDeltaConnection.js\";\nexport { createLocalDocumentService, LocalDocumentService } from \"./localDocumentService.js\";\nexport { LocalDocumentServiceFactory } from \"./localDocumentServiceFactory.js\";\nexport { LocalDocumentStorageService } from \"./localDocumentStorageService.js\";\nexport { createLocalResolverCreateNewRequest, LocalResolver } from \"./localResolver.js\";\nexport { LocalSessionStorageDbFactory } from \"./localSessionStorageDb.js\";\n"]}
@@ -17,6 +17,8 @@ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server
17
17
  import { IRequest } from '@fluidframework/core-interfaces';
18
18
  import { IResolvedUrl } from '@fluidframework/driver-definitions';
19
19
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
20
+ import { ISnapshot } from '@fluidframework/driver-definitions';
21
+ import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
20
22
  import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
21
23
  import { IStream } from '@fluidframework/driver-definitions';
22
24
  import { ISummaryContext } from '@fluidframework/driver-definitions';
@@ -58,7 +60,6 @@ export declare class LocalDocumentServiceFactory implements IDocumentServiceFact
58
60
  private readonly documentDeltaConnectionsMap;
59
61
  /**
60
62
  * @param localDeltaConnectionServer - delta connection server for ops
61
- * @alpha
62
63
  */
63
64
  constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
64
65
  createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
@@ -100,7 +101,6 @@ export declare class LocalResolver implements IUrlResolver {
100
101
  * token from constant test strings. The root of the URL is fake, but the
101
102
  * remaining relative URL can still be parsed.
102
103
  * @param request - request to handle
103
- * @alpha
104
104
  */
105
105
  resolve(request: IRequest): Promise<IResolvedUrl>;
106
106
  getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
@@ -17,6 +17,8 @@ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server
17
17
  import { IRequest } from '@fluidframework/core-interfaces';
18
18
  import { IResolvedUrl } from '@fluidframework/driver-definitions';
19
19
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
20
+ import { ISnapshot } from '@fluidframework/driver-definitions';
21
+ import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
20
22
  import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
21
23
  import { IStream } from '@fluidframework/driver-definitions';
22
24
  import { ISummaryContext } from '@fluidframework/driver-definitions';
@@ -56,6 +58,10 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
56
58
 
57
59
  /* Excluded from this release type: IResolvedUrl */
58
60
 
61
+ /* Excluded from this release type: ISnapshot */
62
+
63
+ /* Excluded from this release type: ISnapshotFetchOptions */
64
+
59
65
  /* Excluded from this release type: IStream */
60
66
 
61
67
  /* Excluded from this release type: ISummaryContext */
@@ -17,6 +17,8 @@ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server
17
17
  import { IRequest } from '@fluidframework/core-interfaces';
18
18
  import { IResolvedUrl } from '@fluidframework/driver-definitions';
19
19
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
20
+ import { ISnapshot } from '@fluidframework/driver-definitions';
21
+ import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
20
22
  import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
21
23
  import { IStream } from '@fluidframework/driver-definitions';
22
24
  import { ISummaryContext } from '@fluidframework/driver-definitions';
@@ -56,6 +58,10 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
56
58
 
57
59
  /* Excluded from this release type: IResolvedUrl */
58
60
 
61
+ /* Excluded from this release type: ISnapshot */
62
+
63
+ /* Excluded from this release type: ISnapshotFetchOptions */
64
+
59
65
  /* Excluded from this release type: IStream */
60
66
 
61
67
  /* Excluded from this release type: ISummaryContext */
@@ -17,6 +17,8 @@ import { ILocalDeltaConnectionServer } from '@fluidframework/server-local-server
17
17
  import { IRequest } from '@fluidframework/core-interfaces';
18
18
  import { IResolvedUrl } from '@fluidframework/driver-definitions';
19
19
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
20
+ import { ISnapshot } from '@fluidframework/driver-definitions';
21
+ import { ISnapshotFetchOptions } from '@fluidframework/driver-definitions';
20
22
  import { ISnapshotTreeEx } from '@fluidframework/protocol-definitions';
21
23
  import { IStream } from '@fluidframework/driver-definitions';
22
24
  import { ISummaryContext } from '@fluidframework/driver-definitions';
@@ -147,7 +149,6 @@ export declare class LocalDocumentServiceFactory implements IDocumentServiceFact
147
149
  private readonly documentDeltaConnectionsMap;
148
150
  /**
149
151
  * @param localDeltaConnectionServer - delta connection server for ops
150
- * @alpha
151
152
  */
152
153
  constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
153
154
  createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
@@ -184,10 +185,35 @@ export declare class LocalDocumentStorageService implements IDocumentStorageServ
184
185
  private readonly resolvedUrl?;
185
186
  protected readonly blobsShaCache: Map<string, string>;
186
187
  private readonly summaryTreeUploadManager;
187
- readonly repositoryUrl: string;
188
188
  constructor(id: string, manager: GitManager, policies: IDocumentStorageServicePolicies, localDeltaConnectionServer?: ILocalDeltaConnectionServer | undefined, resolvedUrl?: IResolvedUrl | undefined);
189
189
  getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
190
190
  getSnapshotTree(version?: IVersion): Promise<ISnapshotTreeEx | null>;
191
+ getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
192
+ /**
193
+ * Strips the tree or any subtree of data if it has a groupId.
194
+ *
195
+ * @param tree - The tree to strip of loading groupIds
196
+ * @returns a tree that has trees with groupIds that are empty
197
+ */
198
+ private stripTreeOfLoadingGroupIds;
199
+ /**
200
+ * Named differently as the algorithm is a little more involved.
201
+ *
202
+ * We want to strip the tree if it has a groupId that is not in the loadingGroupIds or if it doesn't have a descendent or ancestor
203
+ * that has a groupId that is in the loadingGroupIds.
204
+ *
205
+ * We keep the tree in the opposite case.
206
+ *
207
+ * @param tree - the tree to strip of any data that is not in the loadingGroupIds
208
+ * @param loadingGroupIds - the set of groupIds that are being loaded
209
+ * @param ancestorGroupIdInLoadingGroup - whether the ancestor of the tree has a groupId that is in the loadingGroupIds
210
+ * @returns whether or not it or descendant has a groupId that is in the loadingGroupIds
211
+ */
212
+ private filterTreeByLoadingGroupIds;
213
+ private populateBlobContents;
214
+ private populateGroupId;
215
+ private stripTree;
216
+ private readGroupId;
191
217
  readBlob(blobId: string): Promise<ArrayBufferLike>;
192
218
  uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
193
219
  createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
@@ -209,7 +235,6 @@ export declare class LocalResolver implements IUrlResolver {
209
235
  * token from constant test strings. The root of the URL is fake, but the
210
236
  * remaining relative URL can still be parsed.
211
237
  * @param request - request to handle
212
- * @alpha
213
238
  */
214
239
  resolve(request: IRequest): Promise<IResolvedUrl>;
215
240
  getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
@@ -8,7 +8,7 @@ import { IClient } from "@fluidframework/protocol-definitions";
8
8
  import { ITokenProvider } from "@fluidframework/routerlicious-driver";
9
9
  import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
10
10
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
11
- import { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection";
11
+ import { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection.js";
12
12
  /**
13
13
  * Basic implementation of a document service for local use.
14
14
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"localDocumentService.d.ts","sourceRoot":"","sources":["../src/localDocumentService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACN,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAG9E;;;GAGG;AACH,qBAAa,oBACZ,SAAQ,iBAAiB,CAAC,sBAAsB,CAChD,YAAW,gBAAgB;aASV,WAAW,EAAE,YAAY;IACzC,OAAO,CAAC,QAAQ,CAAC,0BAA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AuB,CAAC;IAcjE;;OAEG;IACU,qBAAqB,IAAI,OAAO,CAAC,4BAA4B,CAAC;IAW3E;;;OAGG;IACU,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAgCrF;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACzC,WAAW,EAAE,YAAY,EACzB,0BAA0B,EAAE,2BAA2B,EACvD,aAAa,EAAE,cAAc,EAC7B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,4BAA4B,CAAC,EACtE,QAAQ,CAAC,EAAE,wBAAwB,EACnC,oBAAoB,CAAC,EAAE,gBAAgB,EACvC,MAAM,CAAC,EAAE,oBAAoB,GAC3B,gBAAgB,CAYlB"}
@@ -8,9 +8,9 @@ exports.createLocalDocumentService = exports.LocalDocumentService = void 0;
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
9
  const server_services_client_1 = require("@fluidframework/server-services-client");
10
10
  const server_test_utils_1 = require("@fluidframework/server-test-utils");
11
- const localDocumentStorageService_1 = require("./localDocumentStorageService");
12
- const localDocumentDeltaConnection_1 = require("./localDocumentDeltaConnection");
13
- const localDeltaStorageService_1 = require("./localDeltaStorageService");
11
+ const localDocumentStorageService_js_1 = require("./localDocumentStorageService.js");
12
+ const localDocumentDeltaConnection_js_1 = require("./localDocumentDeltaConnection.js");
13
+ const localDeltaStorageService_js_1 = require("./localDeltaStorageService.js");
14
14
  /**
15
15
  * Basic implementation of a document service for local use.
16
16
  * @internal
@@ -22,7 +22,7 @@ class LocalDocumentService extends client_utils_1.TypedEventEmitter {
22
22
  * @param tenantId - ID of tenant
23
23
  * @param documentId - ID of document
24
24
  */
25
- constructor(resolvedUrl, localDeltaConnectionServer, tokenProvider, tenantId, documentId, documentDeltaConnectionsMap, policies = {}, innerDocumentService, logger) {
25
+ constructor(resolvedUrl, localDeltaConnectionServer, tokenProvider, tenantId, documentId, documentDeltaConnectionsMap, policies = { supportGetSnapshotApi: true }, innerDocumentService, logger) {
26
26
  super();
27
27
  this.resolvedUrl = resolvedUrl;
28
28
  this.localDeltaConnectionServer = localDeltaConnectionServer;
@@ -39,7 +39,7 @@ class LocalDocumentService extends client_utils_1.TypedEventEmitter {
39
39
  * Creates and returns a document storage service for local use.
40
40
  */
41
41
  async connectToStorage() {
42
- return new localDocumentStorageService_1.LocalDocumentStorageService(this.documentId, new server_services_client_1.GitManager(new server_test_utils_1.TestHistorian(this.localDeltaConnectionServer.testDbFactory.testDatabase)), {
42
+ return new localDocumentStorageService_js_1.LocalDocumentStorageService(this.documentId, new server_services_client_1.GitManager(new server_test_utils_1.TestHistorian(this.localDeltaConnectionServer.testDbFactory.testDatabase)), {
43
43
  maximumCacheDurationMs: 432000000, // 5 days in ms. Not actually enforced but shouldn't matter for any local driver scenario
44
44
  }, this.localDeltaConnectionServer, this.resolvedUrl);
45
45
  }
@@ -50,7 +50,7 @@ class LocalDocumentService extends client_utils_1.TypedEventEmitter {
50
50
  if (this.innerDocumentService) {
51
51
  return this.innerDocumentService.connectToDeltaStorage();
52
52
  }
53
- return new localDeltaStorageService_1.LocalDeltaStorageService(this.tenantId, this.documentId, this.localDeltaConnectionServer.databaseManager);
53
+ return new localDeltaStorageService_js_1.LocalDeltaStorageService(this.tenantId, this.documentId, this.localDeltaConnectionServer.databaseManager);
54
54
  }
55
55
  /**
56
56
  * Creates and returns a delta stream for local use.
@@ -64,7 +64,7 @@ class LocalDocumentService extends client_utils_1.TypedEventEmitter {
64
64
  return this.innerDocumentService.connectToDeltaStream(client);
65
65
  }
66
66
  const ordererToken = await this.tokenProvider.fetchOrdererToken(this.tenantId, this.documentId);
67
- const documentDeltaConnection = await localDocumentDeltaConnection_1.LocalDocumentDeltaConnection.create(this.tenantId, this.documentId, ordererToken.jwt, client, this.localDeltaConnectionServer.webSocketServer, undefined, this.logger);
67
+ const documentDeltaConnection = await localDocumentDeltaConnection_js_1.LocalDocumentDeltaConnection.create(this.tenantId, this.documentId, ordererToken.jwt, client, this.localDeltaConnectionServer.webSocketServer, undefined, this.logger);
68
68
  const clientId = documentDeltaConnection.clientId;
69
69
  // Add this document service for the clientId in the document service factory.
70
70
  this.documentDeltaConnectionsMap.set(clientId, documentDeltaConnection);
@@ -1 +1 @@
1
- {"version":3,"file":"localDocumentService.js","sourceRoot":"","sources":["../src/localDocumentService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAYjE,mFAAoE;AACpE,yEAAkE;AAGlE,+EAA4E;AAC5E,iFAA8E;AAC9E,yEAAsE;AAEtE;;;GAGG;AACH,MAAa,oBACZ,SAAQ,gCAAyC;IAGjD;;;;;OAKG;IACH,YACiB,WAAyB,EACxB,0BAAuD,EACvD,aAA6B,EAC7B,QAAgB,EAChB,UAAkB,EAClB,2BAAsE,EACvE,WAAqC,EAAE,EACtC,oBAAuC,EACvC,MAA6B;QAE9C,KAAK,EAAE,CAAC;QAVQ,gBAAW,GAAX,WAAW,CAAc;QACxB,+BAA0B,GAA1B,0BAA0B,CAA6B;QACvD,kBAAa,GAAb,aAAa,CAAgB;QAC7B,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAQ;QAClB,gCAA2B,GAA3B,2BAA2B,CAA2C;QACvE,aAAQ,GAAR,QAAQ,CAA+B;QACtC,yBAAoB,GAApB,oBAAoB,CAAmB;QACvC,WAAM,GAAN,MAAM,CAAuB;IAG/C,CAAC;IAEM,OAAO,KAAI,CAAC;IAEnB;;OAEG;IACI,KAAK,CAAC,gBAAgB;QAC5B,OAAO,IAAI,yDAA2B,CACrC,IAAI,CAAC,UAAU,EACf,IAAI,mCAAU,CACb,IAAI,iCAAa,CAAC,IAAI,CAAC,0BAA0B,CAAC,aAAa,CAAC,YAAY,CAAC,CAC7E,EACD;YACC,sBAAsB,EAAE,SAAW,EAAE,yFAAyF;SAC9H,EACD,IAAI,CAAC,0BAA0B,EAC/B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CAAC,CAAC,CAAC;QAEH,OAAO,uBAAuB,CAAC;IAChC,CAAC;CACD;AA7FD,oDA6FC;AAED;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CACzC,WAAyB,EACzB,0BAAuD,EACvD,aAA6B,EAC7B,QAAgB,EAChB,UAAkB,EAClB,2BAAsE,EACtE,QAAmC,EACnC,oBAAuC,EACvC,MAA6B;IAE7B,OAAO,IAAI,oBAAoB,CAC9B,WAAW,EACX,0BAA0B,EAC1B,aAAa,EACb,QAAQ,EACR,UAAU,EACV,2BAA2B,EAC3B,QAAQ,EACR,oBAAoB,EACpB,MAAM,CACN,CAAC;AACH,CAAC;AAtBD,gEAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\nimport { GitManager } from \"@fluidframework/server-services-client\";\nimport { TestHistorian } from \"@fluidframework/server-test-utils\";\nimport { ILocalDeltaConnectionServer } from \"@fluidframework/server-local-server\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { LocalDocumentStorageService } from \"./localDocumentStorageService\";\nimport { LocalDocumentDeltaConnection } from \"./localDocumentDeltaConnection\";\nimport { LocalDeltaStorageService } from \"./localDeltaStorageService\";\n\n/**\n * Basic implementation of a document service for local use.\n * @internal\n */\nexport class LocalDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\t/**\n\t * @param localDeltaConnectionServer - delta connection server for ops\n\t * @param tokenProvider - token provider\n\t * @param tenantId - ID of tenant\n\t * @param documentId - ID of document\n\t */\n\tconstructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\tprivate readonly localDeltaConnectionServer: ILocalDeltaConnectionServer,\n\t\tprivate readonly tokenProvider: ITokenProvider,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly documentId: string,\n\t\tprivate readonly documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>,\n\t\tpublic readonly policies: IDocumentServicePolicies = {},\n\t\tprivate readonly innerDocumentService?: IDocumentService,\n\t\tprivate readonly logger?: ITelemetryBaseLogger,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose() {}\n\n\t/**\n\t * Creates and returns a document storage service for local use.\n\t */\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn new LocalDocumentStorageService(\n\t\t\tthis.documentId,\n\t\t\tnew GitManager(\n\t\t\t\tnew TestHistorian(this.localDeltaConnectionServer.testDbFactory.testDatabase),\n\t\t\t),\n\t\t\t{\n\t\t\t\tmaximumCacheDurationMs: 432_000_000, // 5 days in ms. Not actually enforced but shouldn't matter for any local driver scenario\n\t\t\t},\n\t\t\tthis.localDeltaConnectionServer,\n\t\t\tthis.resolvedUrl,\n\t\t);\n\t}\n\n\t/**\n\t * Creates and returns a delta storage service for local use.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\tif (this.innerDocumentService) {\n\t\t\treturn this.innerDocumentService.connectToDeltaStorage();\n\t\t}\n\t\treturn new LocalDeltaStorageService(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t\tthis.localDeltaConnectionServer.databaseManager,\n\t\t);\n\t}\n\n\t/**\n\t * Creates and returns a delta stream for local use.\n\t * @param client - client data\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\tif (this.policies.storageOnly === true) {\n\t\t\tthrow new Error(\"can't connect to delta stream in storage-only mode\");\n\t\t}\n\t\tif (this.innerDocumentService) {\n\t\t\treturn this.innerDocumentService.connectToDeltaStream(client);\n\t\t}\n\t\tconst ordererToken = await this.tokenProvider.fetchOrdererToken(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t);\n\t\tconst documentDeltaConnection = await LocalDocumentDeltaConnection.create(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t\tordererToken.jwt,\n\t\t\tclient,\n\t\t\tthis.localDeltaConnectionServer.webSocketServer,\n\t\t\tundefined,\n\t\t\tthis.logger,\n\t\t);\n\t\tconst clientId = documentDeltaConnection.clientId;\n\n\t\t// Add this document service for the clientId in the document service factory.\n\t\tthis.documentDeltaConnectionsMap.set(clientId, documentDeltaConnection);\n\n\t\t// Add a listener to remove this document service when the client is disconnected.\n\t\tdocumentDeltaConnection.on(\"disconnect\", () => {\n\t\t\tthis.documentDeltaConnectionsMap.delete(clientId);\n\t\t});\n\n\t\treturn documentDeltaConnection;\n\t}\n}\n\n/**\n * Creates and returns a document service for local use.\n * @param localDeltaConnectionServer - delta connection server for ops\n * @param tokenProvider - token provider with a single token\n * @param tenantId - ID of tenant\n * @param documentId - ID of document\n * @internal\n */\nexport function createLocalDocumentService(\n\tresolvedUrl: IResolvedUrl,\n\tlocalDeltaConnectionServer: ILocalDeltaConnectionServer,\n\ttokenProvider: ITokenProvider,\n\ttenantId: string,\n\tdocumentId: string,\n\tdocumentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>,\n\tpolicies?: IDocumentServicePolicies,\n\tinnerDocumentService?: IDocumentService,\n\tlogger?: ITelemetryBaseLogger,\n): IDocumentService {\n\treturn new LocalDocumentService(\n\t\tresolvedUrl,\n\t\tlocalDeltaConnectionServer,\n\t\ttokenProvider,\n\t\ttenantId,\n\t\tdocumentId,\n\t\tdocumentDeltaConnectionsMap,\n\t\tpolicies,\n\t\tinnerDocumentService,\n\t\tlogger,\n\t);\n}\n"]}
1
+ {"version":3,"file":"localDocumentService.js","sourceRoot":"","sources":["../src/localDocumentService.ts"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;IAE7B,OAAO,IAAI,oBAAoB,CAC9B,WAAW,EACX,0BAA0B,EAC1B,aAAa,EACb,QAAQ,EACR,UAAU,EACV,2BAA2B,EAC3B,QAAQ,EACR,oBAAoB,EACpB,MAAM,CACN,CAAC;AACH,CAAC;AAtBD,gEAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceEvents,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { IClient } from \"@fluidframework/protocol-definitions\";\nimport { ITokenProvider } from \"@fluidframework/routerlicious-driver\";\nimport { GitManager } from \"@fluidframework/server-services-client\";\nimport { TestHistorian } from \"@fluidframework/server-test-utils\";\nimport { ILocalDeltaConnectionServer } from \"@fluidframework/server-local-server\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { LocalDocumentStorageService } from \"./localDocumentStorageService.js\";\nimport { LocalDocumentDeltaConnection } from \"./localDocumentDeltaConnection.js\";\nimport { LocalDeltaStorageService } from \"./localDeltaStorageService.js\";\n\n/**\n * Basic implementation of a document service for local use.\n * @internal\n */\nexport class LocalDocumentService\n\textends TypedEventEmitter<IDocumentServiceEvents>\n\timplements IDocumentService\n{\n\t/**\n\t * @param localDeltaConnectionServer - delta connection server for ops\n\t * @param tokenProvider - token provider\n\t * @param tenantId - ID of tenant\n\t * @param documentId - ID of document\n\t */\n\tconstructor(\n\t\tpublic readonly resolvedUrl: IResolvedUrl,\n\t\tprivate readonly localDeltaConnectionServer: ILocalDeltaConnectionServer,\n\t\tprivate readonly tokenProvider: ITokenProvider,\n\t\tprivate readonly tenantId: string,\n\t\tprivate readonly documentId: string,\n\t\tprivate readonly documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>,\n\t\tpublic readonly policies: IDocumentServicePolicies = { supportGetSnapshotApi: true },\n\t\tprivate readonly innerDocumentService?: IDocumentService,\n\t\tprivate readonly logger?: ITelemetryBaseLogger,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic dispose() {}\n\n\t/**\n\t * Creates and returns a document storage service for local use.\n\t */\n\tpublic async connectToStorage(): Promise<IDocumentStorageService> {\n\t\treturn new LocalDocumentStorageService(\n\t\t\tthis.documentId,\n\t\t\tnew GitManager(\n\t\t\t\tnew TestHistorian(this.localDeltaConnectionServer.testDbFactory.testDatabase),\n\t\t\t),\n\t\t\t{\n\t\t\t\tmaximumCacheDurationMs: 432_000_000, // 5 days in ms. Not actually enforced but shouldn't matter for any local driver scenario\n\t\t\t},\n\t\t\tthis.localDeltaConnectionServer,\n\t\t\tthis.resolvedUrl,\n\t\t);\n\t}\n\n\t/**\n\t * Creates and returns a delta storage service for local use.\n\t */\n\tpublic async connectToDeltaStorage(): Promise<IDocumentDeltaStorageService> {\n\t\tif (this.innerDocumentService) {\n\t\t\treturn this.innerDocumentService.connectToDeltaStorage();\n\t\t}\n\t\treturn new LocalDeltaStorageService(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t\tthis.localDeltaConnectionServer.databaseManager,\n\t\t);\n\t}\n\n\t/**\n\t * Creates and returns a delta stream for local use.\n\t * @param client - client data\n\t */\n\tpublic async connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection> {\n\t\tif (this.policies.storageOnly === true) {\n\t\t\tthrow new Error(\"can't connect to delta stream in storage-only mode\");\n\t\t}\n\t\tif (this.innerDocumentService) {\n\t\t\treturn this.innerDocumentService.connectToDeltaStream(client);\n\t\t}\n\t\tconst ordererToken = await this.tokenProvider.fetchOrdererToken(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t);\n\t\tconst documentDeltaConnection = await LocalDocumentDeltaConnection.create(\n\t\t\tthis.tenantId,\n\t\t\tthis.documentId,\n\t\t\tordererToken.jwt,\n\t\t\tclient,\n\t\t\tthis.localDeltaConnectionServer.webSocketServer,\n\t\t\tundefined,\n\t\t\tthis.logger,\n\t\t);\n\t\tconst clientId = documentDeltaConnection.clientId;\n\n\t\t// Add this document service for the clientId in the document service factory.\n\t\tthis.documentDeltaConnectionsMap.set(clientId, documentDeltaConnection);\n\n\t\t// Add a listener to remove this document service when the client is disconnected.\n\t\tdocumentDeltaConnection.on(\"disconnect\", () => {\n\t\t\tthis.documentDeltaConnectionsMap.delete(clientId);\n\t\t});\n\n\t\treturn documentDeltaConnection;\n\t}\n}\n\n/**\n * Creates and returns a document service for local use.\n * @param localDeltaConnectionServer - delta connection server for ops\n * @param tokenProvider - token provider with a single token\n * @param tenantId - ID of tenant\n * @param documentId - ID of document\n * @internal\n */\nexport function createLocalDocumentService(\n\tresolvedUrl: IResolvedUrl,\n\tlocalDeltaConnectionServer: ILocalDeltaConnectionServer,\n\ttokenProvider: ITokenProvider,\n\ttenantId: string,\n\tdocumentId: string,\n\tdocumentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection>,\n\tpolicies?: IDocumentServicePolicies,\n\tinnerDocumentService?: IDocumentService,\n\tlogger?: ITelemetryBaseLogger,\n): IDocumentService {\n\treturn new LocalDocumentService(\n\t\tresolvedUrl,\n\t\tlocalDeltaConnectionServer,\n\t\ttokenProvider,\n\t\ttenantId,\n\t\tdocumentId,\n\t\tdocumentDeltaConnectionsMap,\n\t\tpolicies,\n\t\tinnerDocumentService,\n\t\tlogger,\n\t);\n}\n"]}
@@ -17,7 +17,6 @@ export declare class LocalDocumentServiceFactory implements IDocumentServiceFact
17
17
  private readonly documentDeltaConnectionsMap;
18
18
  /**
19
19
  * @param localDeltaConnectionServer - delta connection server for ops
20
- * @alpha
21
20
  */
22
21
  constructor(localDeltaConnectionServer: ILocalDeltaConnectionServer, policies?: IDocumentServicePolicies | undefined, innerDocumentService?: IDocumentService | undefined);
23
22
  createContainer(createNewSummary: ISummaryTree | undefined, resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
@@ -1 +1 @@
1
- {"version":3,"file":"localDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/localDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAKnF;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,uBAAuB;IAUzE,OAAO,CAAC,QAAQ,CAAC,0BAA0B;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAC1B,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAVvC,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CACjC;IAEX;;;OAGG;gBAEe,0BAA0B,EAAE,2BAA2B,EACvD,QAAQ,CAAC,sCAA0B,EACnC,oBAAoB,CAAC,8BAAkB;IAG5C,eAAe,CAC3B,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAU5B;;;;OAIG;IACU,qBAAqB,CACjC,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IA8B5B;;;;OAIG;IACI,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM;IAQlE;;;;;;OAMG;IACI,UAAU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AAM;IAQlE;;;;;;OAMG;IACI,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG;CAOtF"}
@@ -5,10 +5,9 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.LocalDocumentServiceFactory = void 0;
8
- const url_1 = require("url");
9
8
  const routerlicious_driver_1 = require("@fluidframework/routerlicious-driver");
10
- const localDocumentService_1 = require("./localDocumentService");
11
- const localCreateDocument_1 = require("./localCreateDocument");
9
+ const localDocumentService_js_1 = require("./localDocumentService.js");
10
+ const localCreateDocument_js_1 = require("./localCreateDocument.js");
12
11
  /**
13
12
  * Implementation of document service factory for local use.
14
13
  * @alpha
@@ -16,7 +15,6 @@ const localCreateDocument_1 = require("./localCreateDocument");
16
15
  class LocalDocumentServiceFactory {
17
16
  /**
18
17
  * @param localDeltaConnectionServer - delta connection server for ops
19
- * @alpha
20
18
  */
21
19
  constructor(localDeltaConnectionServer, policies, innerDocumentService) {
22
20
  this.localDeltaConnectionServer = localDeltaConnectionServer;
@@ -30,7 +28,7 @@ class LocalDocumentServiceFactory {
30
28
  throw new Error("Provide the localDeltaConnectionServer!!");
31
29
  }
32
30
  if (createNewSummary !== undefined) {
33
- await (0, localCreateDocument_1.createDocument)(this.localDeltaConnectionServer, resolvedUrl, createNewSummary);
31
+ await (0, localCreateDocument_js_1.createDocument)(this.localDeltaConnectionServer, resolvedUrl, createNewSummary);
34
32
  }
35
33
  return this.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
36
34
  }
@@ -40,8 +38,8 @@ class LocalDocumentServiceFactory {
40
38
  * @param resolvedUrl - resolved URL of document
41
39
  */
42
40
  async createDocumentService(resolvedUrl, logger, clientIsSummarizer) {
43
- const parsedUrl = (0, url_1.parse)(resolvedUrl.url);
44
- const [, tenantId, documentId] = parsedUrl.path ? parsedUrl.path.split("/") : [];
41
+ const parsedUrl = new URL(resolvedUrl.url);
42
+ const [, tenantId, documentId] = parsedUrl.pathname ? parsedUrl.pathname.split("/") : [];
45
43
  if (!documentId || !tenantId) {
46
44
  throw new Error(`Couldn't parse resolved url. [documentId:${documentId}][tenantId:${tenantId}]`);
47
45
  }
@@ -51,7 +49,7 @@ class LocalDocumentServiceFactory {
51
49
  throw new Error(`Token was not provided.`);
52
50
  }
53
51
  const tokenProvider = new routerlicious_driver_1.DefaultTokenProvider(jwtToken);
54
- return (0, localDocumentService_1.createLocalDocumentService)(resolvedUrl, this.localDeltaConnectionServer, tokenProvider, tenantId, documentId, this.documentDeltaConnectionsMap, this.policies, this.innerDocumentService, logger);
52
+ return (0, localDocumentService_js_1.createLocalDocumentService)(resolvedUrl, this.localDeltaConnectionServer, tokenProvider, tenantId, documentId, this.documentDeltaConnectionsMap, this.policies, this.innerDocumentService, logger);
55
53
  }
56
54
  /**
57
55
  * Gets the document delta connection for the clientId and asks it to disconnect the client.
@@ -1 +1 @@
1
- {"version":3,"file":"localDocumentServiceFactory.js","sourceRoot":"","sources":["../src/localDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAA4B;AAQ5B,+EAA4E;AAI5E,iEAAoE;AACpE,+DAAuD;AAEvD;;;GAGG;AACH,MAAa,2BAA2B;IAKvC;;;OAGG;IACH,YACkB,0BAAuD,EACvD,QAAmC,EACnC,oBAAuC;QAFvC,+BAA0B,GAA1B,0BAA0B,CAA6B;QACvD,aAAQ,GAAR,QAAQ,CAA2B;QACnC,yBAAoB,GAApB,oBAAoB,CAAmB;QAXzD,6CAA6C;QAC5B,gCAA2B,GAC3C,IAAI,GAAG,EAAE,CAAC;IAUR,CAAC;IAEG,KAAK,CAAC,eAAe,CAC3B,gBAA0C,EAC1C,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B;QAE5B,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,0CAA0C,C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,uBAAuB,GAAG,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,uBAAuB,KAAK,SAAS,EAAE;YAC1C,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;SACtD;QACD,uBAAuB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;OAMG;IACI,UAAU,CAAC,QAAgB,EAAE,IAAa,EAAE,IAAoB,EAAE,OAAa;QACrF,MAAM,uBAAuB,GAAG,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,uBAAuB,KAAK,SAAS,EAAE;YAC1C,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;SACtD;QACD,uBAAuB,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACD;AAhGD,kEAgGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { DefaultTokenProvider } from \"@fluidframework/routerlicious-driver\";\nimport { ILocalDeltaConnectionServer } from \"@fluidframework/server-local-server\";\nimport { ISummaryTree, NackErrorType } from \"@fluidframework/protocol-definitions\";\nimport { LocalDocumentDeltaConnection } from \"./localDocumentDeltaConnection\";\nimport { createLocalDocumentService } from \"./localDocumentService\";\nimport { createDocument } from \"./localCreateDocument\";\n\n/**\n * Implementation of document service factory for local use.\n * @alpha\n */\nexport class LocalDocumentServiceFactory implements IDocumentServiceFactory {\n\t// A map of clientId to LocalDocumentService.\n\tprivate readonly documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection> =\n\t\tnew Map();\n\n\t/**\n\t * @param localDeltaConnectionServer - delta connection server for ops\n\t * @alpha\n\t */\n\tconstructor(\n\t\tprivate readonly localDeltaConnectionServer: ILocalDeltaConnectionServer,\n\t\tprivate readonly policies?: IDocumentServicePolicies,\n\t\tprivate readonly innerDocumentService?: IDocumentService,\n\t) {}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tif (!this.localDeltaConnectionServer) {\n\t\t\tthrow new Error(\"Provide the localDeltaConnectionServer!!\");\n\t\t}\n\t\tif (createNewSummary !== undefined) {\n\t\t\tawait createDocument(this.localDeltaConnectionServer, resolvedUrl, createNewSummary);\n\t\t}\n\t\treturn this.createDocumentService(resolvedUrl, logger, clientIsSummarizer);\n\t}\n\n\t/**\n\t * Creates and returns a document service for testing using the given resolved\n\t * URL for the tenant ID, document ID, and token.\n\t * @param resolvedUrl - resolved URL of document\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tconst parsedUrl = parse(resolvedUrl.url);\n\t\tconst [, tenantId, documentId] = parsedUrl.path ? parsedUrl.path.split(\"/\") : [];\n\t\tif (!documentId || !tenantId) {\n\t\t\tthrow new Error(\n\t\t\t\t`Couldn't parse resolved url. [documentId:${documentId}][tenantId:${tenantId}]`,\n\t\t\t);\n\t\t}\n\n\t\tconst fluidResolvedUrl = resolvedUrl;\n\t\tconst jwtToken = fluidResolvedUrl.tokens.jwt;\n\t\tif (!jwtToken) {\n\t\t\tthrow new Error(`Token was not provided.`);\n\t\t}\n\n\t\tconst tokenProvider = new DefaultTokenProvider(jwtToken);\n\n\t\treturn createLocalDocumentService(\n\t\t\tresolvedUrl,\n\t\t\tthis.localDeltaConnectionServer,\n\t\t\ttokenProvider,\n\t\t\ttenantId,\n\t\t\tdocumentId,\n\t\t\tthis.documentDeltaConnectionsMap,\n\t\t\tthis.policies,\n\t\t\tthis.innerDocumentService,\n\t\t\tlogger,\n\t\t);\n\t}\n\n\t/**\n\t * Gets the document delta connection for the clientId and asks it to disconnect the client.\n\t * @param clientId - The ID of the client to be disconnected.\n\t * @param disconnectReason - The reason of the disconnection.\n\t */\n\tpublic disconnectClient(clientId: string, disconnectReason: string) {\n\t\tconst documentDeltaConnection = this.documentDeltaConnectionsMap.get(clientId);\n\t\tif (documentDeltaConnection === undefined) {\n\t\t\tthrow new Error(`No client with the id: ${clientId}`);\n\t\t}\n\t\tdocumentDeltaConnection.disconnectClient(disconnectReason);\n\t}\n\n\t/**\n\t * Gets the document delta connection for the clientId and asks it to nack the client.\n\t * @param clientId - The ID of the client to be Nack'd.\n\t * @param code - An error code number that represents the error. It will be a valid HTTP error code.\n\t * @param type - Type of the Nack.\n\t * @param message - A message about the nack for debugging/logging/telemetry purposes.\n\t */\n\tpublic nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any) {\n\t\tconst documentDeltaConnection = this.documentDeltaConnectionsMap.get(clientId);\n\t\tif (documentDeltaConnection === undefined) {\n\t\t\tthrow new Error(`No client with the id: ${clientId}`);\n\t\t}\n\t\tdocumentDeltaConnection.nackClient(code, type, message);\n\t}\n}\n"]}
1
+ {"version":3,"file":"localDocumentServiceFactory.js","sourceRoot":"","sources":["../src/localDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,+EAA4E;AAI5E,uEAAuE;AACvE,qEAA0D;AAE1D;;;GAGG;AACH,MAAa,2BAA2B;IAKvC;;OAEG;IACH,YACkB,0BAAuD,EACvD,QAAmC,EACnC,oBAAuC;QAFvC,+BAA0B,GAA1B,0BAA0B,CAA6B;QACvD,aAAQ,GAAR,QAAQ,CAA2B;QACnC,yBAAoB,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AO,IAAA,oDAA0B,EAChC,WAAW,EACX,IAAI,CAAC,0BAA0B,EAC/B,aAAa,EACb,QAAQ,EACR,UAAU,EACV,IAAI,CAAC,2BAA2B,EAChC,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,oBAAoB,EACzB,MAAM,CACN,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,gBAAgB,CAAC,QAAgB,EAAE,gBAAwB;QACjE,MAAM,uBAAuB,GAAG,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,uBAAuB,KAAK,SAAS,EAAE;YAC1C,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;SACtD;QACD,uBAAuB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;OAMG;IACI,UAAU,CAAC,QAAgB,EAAE,IAAa,EAAE,IAAoB,EAAE,OAAa;QACrF,MAAM,uBAAuB,GAAG,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,uBAAuB,KAAK,SAAS,EAAE;YAC1C,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;SACtD;QACD,uBAAuB,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACD;AA/FD,kEA+FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIResolvedUrl,\n} from \"@fluidframework/driver-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { DefaultTokenProvider } from \"@fluidframework/routerlicious-driver\";\nimport { ILocalDeltaConnectionServer } from \"@fluidframework/server-local-server\";\nimport { ISummaryTree, NackErrorType } from \"@fluidframework/protocol-definitions\";\nimport { LocalDocumentDeltaConnection } from \"./localDocumentDeltaConnection.js\";\nimport { createLocalDocumentService } from \"./localDocumentService.js\";\nimport { createDocument } from \"./localCreateDocument.js\";\n\n/**\n * Implementation of document service factory for local use.\n * @alpha\n */\nexport class LocalDocumentServiceFactory implements IDocumentServiceFactory {\n\t// A map of clientId to LocalDocumentService.\n\tprivate readonly documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection> =\n\t\tnew Map();\n\n\t/**\n\t * @param localDeltaConnectionServer - delta connection server for ops\n\t */\n\tconstructor(\n\t\tprivate readonly localDeltaConnectionServer: ILocalDeltaConnectionServer,\n\t\tprivate readonly policies?: IDocumentServicePolicies,\n\t\tprivate readonly innerDocumentService?: IDocumentService,\n\t) {}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tif (!this.localDeltaConnectionServer) {\n\t\t\tthrow new Error(\"Provide the localDeltaConnectionServer!!\");\n\t\t}\n\t\tif (createNewSummary !== undefined) {\n\t\t\tawait createDocument(this.localDeltaConnectionServer, resolvedUrl, createNewSummary);\n\t\t}\n\t\treturn this.createDocumentService(resolvedUrl, logger, clientIsSummarizer);\n\t}\n\n\t/**\n\t * Creates and returns a document service for testing using the given resolved\n\t * URL for the tenant ID, document ID, and token.\n\t * @param resolvedUrl - resolved URL of document\n\t */\n\tpublic async createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tconst parsedUrl = new URL(resolvedUrl.url);\n\t\tconst [, tenantId, documentId] = parsedUrl.pathname ? parsedUrl.pathname.split(\"/\") : [];\n\t\tif (!documentId || !tenantId) {\n\t\t\tthrow new Error(\n\t\t\t\t`Couldn't parse resolved url. [documentId:${documentId}][tenantId:${tenantId}]`,\n\t\t\t);\n\t\t}\n\n\t\tconst fluidResolvedUrl = resolvedUrl;\n\t\tconst jwtToken = fluidResolvedUrl.tokens.jwt;\n\t\tif (!jwtToken) {\n\t\t\tthrow new Error(`Token was not provided.`);\n\t\t}\n\n\t\tconst tokenProvider = new DefaultTokenProvider(jwtToken);\n\n\t\treturn createLocalDocumentService(\n\t\t\tresolvedUrl,\n\t\t\tthis.localDeltaConnectionServer,\n\t\t\ttokenProvider,\n\t\t\ttenantId,\n\t\t\tdocumentId,\n\t\t\tthis.documentDeltaConnectionsMap,\n\t\t\tthis.policies,\n\t\t\tthis.innerDocumentService,\n\t\t\tlogger,\n\t\t);\n\t}\n\n\t/**\n\t * Gets the document delta connection for the clientId and asks it to disconnect the client.\n\t * @param clientId - The ID of the client to be disconnected.\n\t * @param disconnectReason - The reason of the disconnection.\n\t */\n\tpublic disconnectClient(clientId: string, disconnectReason: string) {\n\t\tconst documentDeltaConnection = this.documentDeltaConnectionsMap.get(clientId);\n\t\tif (documentDeltaConnection === undefined) {\n\t\t\tthrow new Error(`No client with the id: ${clientId}`);\n\t\t}\n\t\tdocumentDeltaConnection.disconnectClient(disconnectReason);\n\t}\n\n\t/**\n\t * Gets the document delta connection for the clientId and asks it to nack the client.\n\t * @param clientId - The ID of the client to be Nack'd.\n\t * @param code - An error code number that represents the error. It will be a valid HTTP error code.\n\t * @param type - Type of the Nack.\n\t * @param message - A message about the nack for debugging/logging/telemetry purposes.\n\t */\n\tpublic nackClient(clientId: string, code?: number, type?: NackErrorType, message?: any) {\n\t\tconst documentDeltaConnection = this.documentDeltaConnectionsMap.get(clientId);\n\t\tif (documentDeltaConnection === undefined) {\n\t\t\tthrow new Error(`No client with the id: ${clientId}`);\n\t\t}\n\t\tdocumentDeltaConnection.nackClient(code, type, message);\n\t}\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IDocumentStorageService, IDocumentStorageServicePolicies, IResolvedUrl, ISummaryContext } from "@fluidframework/driver-definitions";
5
+ import { IDocumentStorageService, IDocumentStorageServicePolicies, IResolvedUrl, ISummaryContext, type ISnapshotFetchOptions, type ISnapshot } from "@fluidframework/driver-definitions";
6
6
  import { ICreateBlobResponse, ISnapshotTreeEx, ISummaryHandle, ISummaryTree, IVersion } from "@fluidframework/protocol-definitions";
7
7
  import { GitManager } from "@fluidframework/server-services-client";
8
8
  import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
@@ -17,10 +17,35 @@ export declare class LocalDocumentStorageService implements IDocumentStorageServ
17
17
  private readonly resolvedUrl?;
18
18
  protected readonly blobsShaCache: Map<string, string>;
19
19
  private readonly summaryTreeUploadManager;
20
- readonly repositoryUrl: string;
21
20
  constructor(id: string, manager: GitManager, policies: IDocumentStorageServicePolicies, localDeltaConnectionServer?: ILocalDeltaConnectionServer | undefined, resolvedUrl?: IResolvedUrl | undefined);
22
21
  getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
23
22
  getSnapshotTree(version?: IVersion): Promise<ISnapshotTreeEx | null>;
23
+ getSnapshot(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
24
+ /**
25
+ * Strips the tree or any subtree of data if it has a groupId.
26
+ *
27
+ * @param tree - The tree to strip of loading groupIds
28
+ * @returns a tree that has trees with groupIds that are empty
29
+ */
30
+ private stripTreeOfLoadingGroupIds;
31
+ /**
32
+ * Named differently as the algorithm is a little more involved.
33
+ *
34
+ * We want to strip the tree if it has a groupId that is not in the loadingGroupIds or if it doesn't have a descendent or ancestor
35
+ * that has a groupId that is in the loadingGroupIds.
36
+ *
37
+ * We keep the tree in the opposite case.
38
+ *
39
+ * @param tree - the tree to strip of any data that is not in the loadingGroupIds
40
+ * @param loadingGroupIds - the set of groupIds that are being loaded
41
+ * @param ancestorGroupIdInLoadingGroup - whether the ancestor of the tree has a groupId that is in the loadingGroupIds
42
+ * @returns whether or not it or descendant has a groupId that is in the loadingGroupIds
43
+ */
44
+ private filterTreeByLoadingGroupIds;
45
+ private populateBlobContents;
46
+ private populateGroupId;
47
+ private stripTree;
48
+ private readGroupId;
24
49
  readBlob(blobId: string): Promise<ArrayBufferLike>;
25
50
  uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
26
51
  createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"localDocumentStorageService.d.ts","sourceRoot":"","sources":["../src/localDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,uBAAuB,EACvB,+BAA+B,EAC/B,YAAY,EACZ,eAAe,EACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACN,UAAU,EAGV,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAIlF;;GAEG;AACH,qBAAa,2BAA4B,YAAW,uBAAuB;IASzE,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,OAAO;aACR,QAAQ,EAAE,+BAA+B;IACzD,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAV9B,SAAS,CAAC,QAAQ,CAAC,aAAa,sBAA6B;IAC7D,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAwB;IAEjE,SAAgB,aAAa,EAAE,MAAM,CAAM;gBAGzB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,UAAU,EACpB,QAAQ,EAAE,+BAA+B,EACxC,0BAA0B,CAAC,yCAA6B,EACxD,WAAW,CAAC,0BAAc;IAS/B,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG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