@fluidframework/local-driver 2.0.0-dev.3.1.0.125672 → 2.0.0-dev.4.1.0.148229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-extractor.json +4 -0
- package/dist/localCreateDocument.d.ts +8 -0
- package/dist/localCreateDocument.d.ts.map +1 -0
- package/dist/localCreateDocument.js +29 -0
- package/dist/localCreateDocument.js.map +1 -0
- package/dist/localDocumentService.d.ts.map +1 -1
- package/dist/localDocumentService.js +1 -1
- package/dist/localDocumentService.js.map +1 -1
- package/dist/localDocumentServiceFactory.d.ts +0 -1
- package/dist/localDocumentServiceFactory.d.ts.map +1 -1
- package/dist/localDocumentServiceFactory.js +4 -21
- package/dist/localDocumentServiceFactory.js.map +1 -1
- package/dist/localDocumentStorageService.d.ts +5 -2
- package/dist/localDocumentStorageService.d.ts.map +1 -1
- package/dist/localDocumentStorageService.js +14 -1
- package/dist/localDocumentStorageService.js.map +1 -1
- package/dist/localSessionStorageDb.d.ts.map +1 -1
- package/dist/localSessionStorageDb.js +3 -0
- package/dist/localSessionStorageDb.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/auth.d.ts +12 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +38 -0
- package/lib/auth.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -0
- package/lib/index.js.map +1 -0
- package/lib/localCreateDocument.d.ts +8 -0
- package/lib/localCreateDocument.d.ts.map +1 -0
- package/lib/localCreateDocument.js +25 -0
- package/lib/localCreateDocument.js.map +1 -0
- package/lib/localDeltaStorageService.d.ts +19 -0
- package/lib/localDeltaStorageService.d.ts.map +1 -0
- package/lib/localDeltaStorageService.js +31 -0
- package/lib/localDeltaStorageService.js.map +1 -0
- package/lib/localDocumentDeltaConnection.d.ts +47 -0
- package/lib/localDocumentDeltaConnection.d.ts.map +1 -0
- package/lib/localDocumentDeltaConnection.js +88 -0
- package/lib/localDocumentDeltaConnection.js.map +1 -0
- package/lib/localDocumentService.d.ts +52 -0
- package/lib/localDocumentService.d.ts.map +1 -0
- package/lib/localDocumentService.js +80 -0
- package/lib/localDocumentService.js.map +1 -0
- package/lib/localDocumentServiceFactory.d.ts +43 -0
- package/lib/localDocumentServiceFactory.d.ts.map +1 -0
- package/lib/localDocumentServiceFactory.js +81 -0
- package/lib/localDocumentServiceFactory.js.map +1 -0
- package/lib/localDocumentStorageService.d.ts +27 -0
- package/lib/localDocumentStorageService.d.ts.map +1 -0
- package/lib/localDocumentStorageService.js +85 -0
- package/lib/localDocumentStorageService.js.map +1 -0
- package/lib/localResolver.d.ts +26 -0
- package/lib/localResolver.d.ts.map +1 -0
- package/lib/localResolver.js +70 -0
- package/lib/localResolver.js.map +1 -0
- package/lib/localSessionStorageDb.d.ts +10 -0
- package/lib/localSessionStorageDb.d.ts.map +1 -0
- package/lib/localSessionStorageDb.js +295 -0
- package/lib/localSessionStorageDb.js.map +1 -0
- package/lib/packageVersion.d.ts +9 -0
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/packageVersion.js +9 -0
- package/lib/packageVersion.js.map +1 -0
- package/package.json +57 -49
- package/src/localCreateDocument.ts +48 -0
- package/src/localDocumentService.ts +2 -0
- package/src/localDocumentServiceFactory.ts +6 -43
- package/src/localDocumentStorageService.ts +17 -0
- package/src/localSessionStorageDb.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/tsconfig.esnext.json +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/local-driver",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.4.1.0.148229",
|
|
4
4
|
"description": "Fluid local driver",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,27 +15,6 @@
|
|
|
15
15
|
"moniker": "@fluidframework/server-services-client/dist/generateNames.js"
|
|
16
16
|
},
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "npm run build:genver && concurrently npm:build:compile npm:lint",
|
|
20
|
-
"build:compile": "npm run tsc && npm run build:test",
|
|
21
|
-
"build:full": "npm run build",
|
|
22
|
-
"build:full:compile": "npm run build:compile",
|
|
23
|
-
"build:genver": "gen-version",
|
|
24
|
-
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
25
|
-
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
26
|
-
"eslint": "eslint --format stylish src",
|
|
27
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
28
|
-
"format": "npm run prettier:fix",
|
|
29
|
-
"lint": "npm run prettier && npm run eslint",
|
|
30
|
-
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
31
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
32
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
33
|
-
"test": "npm run test:mocha",
|
|
34
|
-
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
35
|
-
"test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
36
|
-
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
37
|
-
"tsc": "tsc"
|
|
38
|
-
},
|
|
39
18
|
"nyc": {
|
|
40
19
|
"all": true,
|
|
41
20
|
"cache-dir": "nyc/.cache",
|
|
@@ -58,49 +37,78 @@
|
|
|
58
37
|
},
|
|
59
38
|
"dependencies": {
|
|
60
39
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
61
|
-
"@fluidframework/common-utils": "^1.
|
|
62
|
-
"@fluidframework/core-interfaces": "
|
|
63
|
-
"@fluidframework/driver-base": "
|
|
64
|
-
"@fluidframework/driver-definitions": "
|
|
65
|
-
"@fluidframework/driver-utils": "
|
|
66
|
-
"@fluidframework/protocol-base": "^0.
|
|
40
|
+
"@fluidframework/common-utils": "^1.1.1",
|
|
41
|
+
"@fluidframework/core-interfaces": "2.0.0-dev.4.1.0.148229",
|
|
42
|
+
"@fluidframework/driver-base": "2.0.0-dev.4.1.0.148229",
|
|
43
|
+
"@fluidframework/driver-definitions": "2.0.0-dev.4.1.0.148229",
|
|
44
|
+
"@fluidframework/driver-utils": "2.0.0-dev.4.1.0.148229",
|
|
45
|
+
"@fluidframework/protocol-base": "^0.1039.1000",
|
|
67
46
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
68
|
-
"@fluidframework/routerlicious-driver": "
|
|
69
|
-
"@fluidframework/server-local-server": "^0.
|
|
70
|
-
"@fluidframework/server-services-client": "^0.
|
|
71
|
-
"@fluidframework/server-services-core": "^0.
|
|
72
|
-
"@fluidframework/server-test-utils": "^0.
|
|
73
|
-
"@fluidframework/telemetry-utils": "
|
|
47
|
+
"@fluidframework/routerlicious-driver": "2.0.0-dev.4.1.0.148229",
|
|
48
|
+
"@fluidframework/server-local-server": "^0.1039.1000",
|
|
49
|
+
"@fluidframework/server-services-client": "^0.1039.1000",
|
|
50
|
+
"@fluidframework/server-services-core": "^0.1039.1000",
|
|
51
|
+
"@fluidframework/server-test-utils": "^0.1039.1000",
|
|
52
|
+
"@fluidframework/telemetry-utils": "2.0.0-dev.4.1.0.148229",
|
|
74
53
|
"events": "^3.1.0",
|
|
75
54
|
"jsrsasign": "^10.5.25",
|
|
76
55
|
"url": "^0.11.0",
|
|
77
56
|
"uuid": "^8.3.1"
|
|
78
57
|
},
|
|
79
58
|
"devDependencies": {
|
|
80
|
-
"@fluid-tools/build-cli": "^0.
|
|
59
|
+
"@fluid-tools/build-cli": "^0.13.1",
|
|
81
60
|
"@fluidframework/build-common": "^1.1.0",
|
|
61
|
+
"@fluidframework/build-tools": "^0.13.1",
|
|
82
62
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
83
|
-
"@fluidframework/local-driver-previous": "npm:@fluidframework/local-driver@2.0.0-internal.
|
|
84
|
-
"@fluidframework/mocha-test-setup": "
|
|
85
|
-
"@
|
|
63
|
+
"@fluidframework/local-driver-previous": "npm:@fluidframework/local-driver@2.0.0-internal.4.0.0",
|
|
64
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev.4.1.0.148229",
|
|
65
|
+
"@microsoft/api-extractor": "^7.34.4",
|
|
86
66
|
"@types/jsrsasign": "^8.0.8",
|
|
87
67
|
"@types/mocha": "^9.1.1",
|
|
88
|
-
"@types/node": "^14.18.
|
|
89
|
-
"concurrently": "^6.
|
|
90
|
-
"
|
|
68
|
+
"@types/node": "^14.18.38",
|
|
69
|
+
"concurrently": "^7.6.0",
|
|
70
|
+
"copyfiles": "^2.4.1",
|
|
71
|
+
"cross-env": "^7.0.3",
|
|
91
72
|
"eslint": "~8.6.0",
|
|
92
|
-
"mocha": "^10.
|
|
93
|
-
"
|
|
73
|
+
"mocha": "^10.2.0",
|
|
74
|
+
"mocha-json-output-reporter": "^2.0.1",
|
|
75
|
+
"mocha-multi-reporters": "^1.5.1",
|
|
76
|
+
"moment": "^2.21.0",
|
|
77
|
+
"nyc": "^15.1.0",
|
|
94
78
|
"prettier": "~2.6.2",
|
|
95
|
-
"rimraf": "^
|
|
79
|
+
"rimraf": "^4.4.0",
|
|
96
80
|
"socket.io-client": "^4.4.1",
|
|
97
81
|
"typescript": "~4.5.5"
|
|
98
82
|
},
|
|
99
83
|
"typeValidation": {
|
|
100
|
-
"version": "2.0.0-internal.3.1.0",
|
|
101
|
-
"previousVersionStyle": "~previousMinor",
|
|
102
|
-
"baselineRange": ">=2.0.0-internal.3.0.0 <2.0.0-internal.3.1.0",
|
|
103
|
-
"baselineVersion": "2.0.0-internal.3.0.0",
|
|
104
84
|
"broken": {}
|
|
85
|
+
},
|
|
86
|
+
"scripts": {
|
|
87
|
+
"build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
88
|
+
"build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
|
|
89
|
+
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
90
|
+
"build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
91
|
+
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
92
|
+
"build:full": "npm run build",
|
|
93
|
+
"build:full:compile": "npm run build:compile",
|
|
94
|
+
"build:genver": "gen-version",
|
|
95
|
+
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
96
|
+
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
|
|
97
|
+
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
98
|
+
"eslint": "eslint --format stylish src",
|
|
99
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
100
|
+
"format": "npm run prettier:fix",
|
|
101
|
+
"lint": "npm run prettier && npm run eslint",
|
|
102
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
103
|
+
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
104
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
105
|
+
"test": "npm run test:mocha",
|
|
106
|
+
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
107
|
+
"test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
108
|
+
"test:mocha:multireport": "cross-env FLUID_TEST_MULTIREPORT=1 npm run test:mocha",
|
|
109
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
110
|
+
"tsc": "tsc",
|
|
111
|
+
"typetests:gen": "fluid-type-test-generator",
|
|
112
|
+
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
105
113
|
}
|
|
106
|
-
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { IFluidResolvedUrl } from "@fluidframework/driver-definitions";
|
|
7
|
+
import {
|
|
8
|
+
getDocAttributesFromProtocolSummary,
|
|
9
|
+
getQuorumValuesFromProtocolSummary,
|
|
10
|
+
isCombinedAppAndProtocolSummary,
|
|
11
|
+
} from "@fluidframework/driver-utils";
|
|
12
|
+
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
13
|
+
import { LocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
14
|
+
import { defaultHash } from "@fluidframework/server-services-client";
|
|
15
|
+
|
|
16
|
+
export async function createDocument(
|
|
17
|
+
localDeltaConnectionServer,
|
|
18
|
+
resolvedUrl: IFluidResolvedUrl,
|
|
19
|
+
summary: ISummaryTree,
|
|
20
|
+
) {
|
|
21
|
+
const pathName = new URL(resolvedUrl.url).pathname;
|
|
22
|
+
const pathArr = pathName.split("/");
|
|
23
|
+
const tenantId = pathArr[pathArr.length - 2];
|
|
24
|
+
const id = pathArr[pathArr.length - 1];
|
|
25
|
+
const documentStorage = (localDeltaConnectionServer as LocalDeltaConnectionServer)
|
|
26
|
+
.documentStorage;
|
|
27
|
+
if (!isCombinedAppAndProtocolSummary(summary)) {
|
|
28
|
+
throw new Error("Protocol and App Summary required in the full summary");
|
|
29
|
+
}
|
|
30
|
+
const protocolSummary = summary.tree[".protocol"];
|
|
31
|
+
const appSummary = summary.tree[".app"];
|
|
32
|
+
const documentAttributes = getDocAttributesFromProtocolSummary(protocolSummary);
|
|
33
|
+
const quorumValues = getQuorumValuesFromProtocolSummary(protocolSummary);
|
|
34
|
+
const sequenceNumber = documentAttributes.sequenceNumber;
|
|
35
|
+
await documentStorage.createDocument(
|
|
36
|
+
tenantId,
|
|
37
|
+
id,
|
|
38
|
+
appSummary,
|
|
39
|
+
sequenceNumber,
|
|
40
|
+
documentAttributes.term ?? 1,
|
|
41
|
+
defaultHash,
|
|
42
|
+
resolvedUrl.endpoints.ordererUrl ?? "",
|
|
43
|
+
resolvedUrl.endpoints.storageUrl ?? "",
|
|
44
|
+
resolvedUrl.endpoints.deltaStorageUrl ?? "",
|
|
45
|
+
quorumValues,
|
|
46
|
+
false /* enableDiscovery */,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -57,6 +57,8 @@ export class LocalDocumentService implements IDocumentService {
|
|
|
57
57
|
minBlobSize: 2048, // Test blob aggregation
|
|
58
58
|
maximumCacheDurationMs: 432_000_000, // 5 days in ms. Not actually enforced but shouldn't matter for any local driver scenario
|
|
59
59
|
},
|
|
60
|
+
this.localDeltaConnectionServer,
|
|
61
|
+
this.resolvedUrl,
|
|
60
62
|
);
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -12,26 +12,17 @@ import {
|
|
|
12
12
|
} from "@fluidframework/driver-definitions";
|
|
13
13
|
import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
|
|
14
14
|
import { DefaultTokenProvider } from "@fluidframework/routerlicious-driver";
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
LocalDeltaConnectionServer,
|
|
18
|
-
} from "@fluidframework/server-local-server";
|
|
19
|
-
import {
|
|
20
|
-
ensureFluidResolvedUrl,
|
|
21
|
-
getDocAttributesFromProtocolSummary,
|
|
22
|
-
getQuorumValuesFromProtocolSummary,
|
|
23
|
-
} from "@fluidframework/driver-utils";
|
|
15
|
+
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
16
|
+
import { ensureFluidResolvedUrl } from "@fluidframework/driver-utils";
|
|
24
17
|
import { ISummaryTree, NackErrorType } from "@fluidframework/protocol-definitions";
|
|
25
|
-
import { defaultHash } from "@fluidframework/server-services-client";
|
|
26
18
|
import { LocalDocumentDeltaConnection } from "./localDocumentDeltaConnection";
|
|
27
19
|
import { createLocalDocumentService } from "./localDocumentService";
|
|
20
|
+
import { createDocument } from "./localCreateDocument";
|
|
28
21
|
|
|
29
22
|
/**
|
|
30
23
|
* Implementation of document service factory for local use.
|
|
31
24
|
*/
|
|
32
25
|
export class LocalDocumentServiceFactory implements IDocumentServiceFactory {
|
|
33
|
-
public readonly protocolName = "fluid-test:";
|
|
34
|
-
|
|
35
26
|
// A map of clientId to LocalDocumentService.
|
|
36
27
|
private readonly documentDeltaConnectionsMap: Map<string, LocalDocumentDeltaConnection> =
|
|
37
28
|
new Map();
|
|
@@ -51,41 +42,13 @@ export class LocalDocumentServiceFactory implements IDocumentServiceFactory {
|
|
|
51
42
|
logger?: ITelemetryBaseLogger,
|
|
52
43
|
clientIsSummarizer?: boolean,
|
|
53
44
|
): Promise<IDocumentService> {
|
|
54
|
-
ensureFluidResolvedUrl(resolvedUrl);
|
|
55
|
-
if (createNewSummary === undefined) {
|
|
56
|
-
throw new Error("Empty file summary creation isn't supported in this driver.");
|
|
57
|
-
}
|
|
58
|
-
const pathName = new URL(resolvedUrl.url).pathname;
|
|
59
|
-
const pathArr = pathName.split("/");
|
|
60
|
-
const tenantId = pathArr[pathArr.length - 2];
|
|
61
|
-
const id = pathArr[pathArr.length - 1];
|
|
62
45
|
if (!this.localDeltaConnectionServer) {
|
|
63
46
|
throw new Error("Provide the localDeltaConnectionServer!!");
|
|
64
47
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const protocolSummary = createNewSummary.tree[".protocol"] as ISummaryTree;
|
|
69
|
-
const appSummary = createNewSummary.tree[".app"] as ISummaryTree;
|
|
70
|
-
if (!(protocolSummary && appSummary)) {
|
|
71
|
-
throw new Error("Protocol and App Summary required in the full summary");
|
|
48
|
+
if (createNewSummary !== undefined) {
|
|
49
|
+
ensureFluidResolvedUrl(resolvedUrl);
|
|
50
|
+
await createDocument(this.localDeltaConnectionServer, resolvedUrl, createNewSummary);
|
|
72
51
|
}
|
|
73
|
-
const documentAttributes = getDocAttributesFromProtocolSummary(protocolSummary);
|
|
74
|
-
const quorumValues = getQuorumValuesFromProtocolSummary(protocolSummary);
|
|
75
|
-
const sequenceNumber = documentAttributes.sequenceNumber;
|
|
76
|
-
await documentStorage.createDocument(
|
|
77
|
-
tenantId,
|
|
78
|
-
id,
|
|
79
|
-
appSummary,
|
|
80
|
-
sequenceNumber,
|
|
81
|
-
documentAttributes.term ?? 1,
|
|
82
|
-
defaultHash,
|
|
83
|
-
resolvedUrl.endpoints.ordererUrl ?? "",
|
|
84
|
-
resolvedUrl.endpoints.storageUrl ?? "",
|
|
85
|
-
resolvedUrl.endpoints.deltaStorageUrl ?? "",
|
|
86
|
-
quorumValues,
|
|
87
|
-
false /* enableDiscovery */,
|
|
88
|
-
);
|
|
89
52
|
return this.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
|
|
90
53
|
}
|
|
91
54
|
|
|
@@ -7,6 +7,7 @@ import { stringToBuffer, Uint8ArrayToString } from "@fluidframework/common-utils
|
|
|
7
7
|
import {
|
|
8
8
|
IDocumentStorageService,
|
|
9
9
|
IDocumentStorageServicePolicies,
|
|
10
|
+
IResolvedUrl,
|
|
10
11
|
ISummaryContext,
|
|
11
12
|
} from "@fluidframework/driver-definitions";
|
|
12
13
|
import {
|
|
@@ -22,6 +23,9 @@ import {
|
|
|
22
23
|
ISummaryUploadManager,
|
|
23
24
|
SummaryTreeUploadManager,
|
|
24
25
|
} from "@fluidframework/server-services-client";
|
|
26
|
+
import { ILocalDeltaConnectionServer } from "@fluidframework/server-local-server";
|
|
27
|
+
import { ensureFluidResolvedUrl } from "@fluidframework/driver-utils";
|
|
28
|
+
import { createDocument } from "./localCreateDocument";
|
|
25
29
|
|
|
26
30
|
export class LocalDocumentStorageService implements IDocumentStorageService {
|
|
27
31
|
// The values of this cache is useless. We only need the keys. So we are always putting
|
|
@@ -37,6 +41,8 @@ export class LocalDocumentStorageService implements IDocumentStorageService {
|
|
|
37
41
|
private readonly id: string,
|
|
38
42
|
private readonly manager: GitManager,
|
|
39
43
|
public readonly policies: IDocumentStorageServicePolicies,
|
|
44
|
+
private readonly localDeltaConnectionServer?: ILocalDeltaConnectionServer,
|
|
45
|
+
private readonly resolvedUrl?: IResolvedUrl,
|
|
40
46
|
) {
|
|
41
47
|
this.summaryTreeUploadManager = new SummaryTreeUploadManager(
|
|
42
48
|
manager,
|
|
@@ -82,6 +88,17 @@ export class LocalDocumentStorageService implements IDocumentStorageService {
|
|
|
82
88
|
summary: ISummaryTree,
|
|
83
89
|
context: ISummaryContext,
|
|
84
90
|
): Promise<string> {
|
|
91
|
+
if (context.referenceSequenceNumber === 0) {
|
|
92
|
+
if (this.localDeltaConnectionServer === undefined || this.resolvedUrl === undefined) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
"Insufficient constructor parameters. An ILocalDeltaConnectionServer and IResolvedUrl required",
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
ensureFluidResolvedUrl(this.resolvedUrl);
|
|
98
|
+
await createDocument(this.localDeltaConnectionServer, this.resolvedUrl, summary);
|
|
99
|
+
const version = await this.getVersions(this.id, 1);
|
|
100
|
+
return version[0].id;
|
|
101
|
+
}
|
|
85
102
|
return this.summaryTreeUploadManager.writeSummaryTree(
|
|
86
103
|
summary,
|
|
87
104
|
context.ackHandle ?? "",
|
|
@@ -27,6 +27,9 @@ class LocalSessionStorageCollection<T> implements ICollection<T> {
|
|
|
27
27
|
public async distinct(key: any, query: any): Promise<any> {
|
|
28
28
|
throw new Error("Method Not Implemented");
|
|
29
29
|
}
|
|
30
|
+
public async findAndUpdate(query: any, value: T): Promise<{ value: T; existing: boolean }> {
|
|
31
|
+
throw new Error("Method not implemented.");
|
|
32
|
+
}
|
|
30
33
|
|
|
31
34
|
/**
|
|
32
35
|
* {@inheritDoc @fluidframework/server-services-core#ICollection.find}
|
package/src/packageVersion.ts
CHANGED