@fluidframework/driver-utils 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/dist/fluidResolvedUrl.d.ts +8 -0
- package/dist/fluidResolvedUrl.d.ts.map +1 -1
- package/dist/fluidResolvedUrl.js +8 -0
- package/dist/fluidResolvedUrl.js.map +1 -1
- package/dist/index.d.ts +4 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -21
- package/dist/index.js.map +1 -1
- package/dist/messageRecognition.d.ts +0 -20
- package/dist/messageRecognition.d.ts.map +1 -1
- package/dist/messageRecognition.js +1 -37
- package/dist/messageRecognition.js.map +1 -1
- package/dist/network.d.ts +0 -15
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js.map +1 -1
- package/dist/networkUtils.d.ts +0 -10
- package/dist/networkUtils.d.ts.map +1 -1
- package/dist/networkUtils.js +1 -32
- package/dist/networkUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/parallelRequests.d.ts.map +1 -1
- package/dist/parallelRequests.js +33 -14
- package/dist/parallelRequests.js.map +1 -1
- package/dist/summaryForCreateNew.d.ts +21 -1
- package/dist/summaryForCreateNew.d.ts.map +1 -1
- package/dist/summaryForCreateNew.js +26 -1
- package/dist/summaryForCreateNew.js.map +1 -1
- package/dist/treeConversions.d.ts.map +1 -1
- package/dist/treeConversions.js +8 -9
- package/dist/treeConversions.js.map +1 -1
- package/lib/fluidResolvedUrl.d.ts +8 -0
- package/lib/fluidResolvedUrl.d.ts.map +1 -1
- package/lib/fluidResolvedUrl.js +8 -0
- package/lib/fluidResolvedUrl.js.map +1 -1
- package/lib/index.d.ts +4 -11
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -10
- package/lib/index.js.map +1 -1
- package/lib/messageRecognition.d.ts +0 -20
- package/lib/messageRecognition.d.ts.map +1 -1
- package/lib/messageRecognition.js +0 -35
- package/lib/messageRecognition.js.map +1 -1
- package/lib/network.d.ts +0 -15
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js.map +1 -1
- package/lib/networkUtils.d.ts +0 -10
- package/lib/networkUtils.d.ts.map +1 -1
- package/lib/networkUtils.js +0 -30
- package/lib/networkUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/parallelRequests.d.ts.map +1 -1
- package/lib/parallelRequests.js +34 -15
- package/lib/parallelRequests.js.map +1 -1
- package/lib/summaryForCreateNew.d.ts +21 -1
- package/lib/summaryForCreateNew.d.ts.map +1 -1
- package/lib/summaryForCreateNew.js +24 -0
- package/lib/summaryForCreateNew.js.map +1 -1
- package/lib/treeConversions.d.ts.map +1 -1
- package/lib/treeConversions.js +8 -9
- package/lib/treeConversions.js.map +1 -1
- package/package.json +52 -75
- package/src/fluidResolvedUrl.ts +8 -0
- package/src/index.ts +4 -19
- package/src/messageRecognition.ts +0 -36
- package/src/network.ts +0 -16
- package/src/networkUtils.ts +0 -32
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +37 -18
- package/src/summaryForCreateNew.ts +48 -2
- package/src/treeConversions.ts +8 -9
- package/dist/blobAggregationStorage.d.ts +0 -43
- package/dist/blobAggregationStorage.d.ts.map +0 -1
- package/dist/blobAggregationStorage.js +0 -323
- package/dist/blobAggregationStorage.js.map +0 -1
- package/dist/blobCacheStorageService.d.ts +0 -16
- package/dist/blobCacheStorageService.d.ts.map +0 -1
- package/dist/blobCacheStorageService.js +0 -29
- package/dist/blobCacheStorageService.js.map +0 -1
- package/dist/emptyDocumentDeltaStorageService.d.ts +0 -13
- package/dist/emptyDocumentDeltaStorageService.d.ts.map +0 -1
- package/dist/emptyDocumentDeltaStorageService.js +0 -20
- package/dist/emptyDocumentDeltaStorageService.js.map +0 -1
- package/dist/mapWithExpiration.d.ts +0 -34
- package/dist/mapWithExpiration.d.ts.map +0 -1
- package/dist/mapWithExpiration.js +0 -105
- package/dist/mapWithExpiration.js.map +0 -1
- package/dist/multiDocumentServiceFactory.d.ts +0 -16
- package/dist/multiDocumentServiceFactory.d.ts.map +0 -1
- package/dist/multiDocumentServiceFactory.js +0 -63
- package/dist/multiDocumentServiceFactory.js.map +0 -1
- package/dist/multiUrlResolver.d.ts +0 -20
- package/dist/multiUrlResolver.d.ts.map +0 -1
- package/dist/multiUrlResolver.js +0 -45
- package/dist/multiUrlResolver.js.map +0 -1
- package/dist/treeUtils.d.ts +0 -51
- package/dist/treeUtils.d.ts.map +0 -1
- package/dist/treeUtils.js +0 -85
- package/dist/treeUtils.js.map +0 -1
- package/lib/blobAggregationStorage.d.ts +0 -43
- package/lib/blobAggregationStorage.d.ts.map +0 -1
- package/lib/blobAggregationStorage.js +0 -318
- package/lib/blobAggregationStorage.js.map +0 -1
- package/lib/blobCacheStorageService.d.ts +0 -16
- package/lib/blobCacheStorageService.d.ts.map +0 -1
- package/lib/blobCacheStorageService.js +0 -25
- package/lib/blobCacheStorageService.js.map +0 -1
- package/lib/emptyDocumentDeltaStorageService.d.ts +0 -13
- package/lib/emptyDocumentDeltaStorageService.d.ts.map +0 -1
- package/lib/emptyDocumentDeltaStorageService.js +0 -16
- package/lib/emptyDocumentDeltaStorageService.js.map +0 -1
- package/lib/mapWithExpiration.d.ts +0 -34
- package/lib/mapWithExpiration.d.ts.map +0 -1
- package/lib/mapWithExpiration.js +0 -101
- package/lib/mapWithExpiration.js.map +0 -1
- package/lib/multiDocumentServiceFactory.d.ts +0 -16
- package/lib/multiDocumentServiceFactory.d.ts.map +0 -1
- package/lib/multiDocumentServiceFactory.js +0 -59
- package/lib/multiDocumentServiceFactory.js.map +0 -1
- package/lib/multiUrlResolver.d.ts +0 -20
- package/lib/multiUrlResolver.d.ts.map +0 -1
- package/lib/multiUrlResolver.js +0 -40
- package/lib/multiUrlResolver.js.map +0 -1
- package/lib/treeUtils.d.ts +0 -51
- package/lib/treeUtils.d.ts.map +0 -1
- package/lib/treeUtils.js +0 -80
- package/lib/treeUtils.js.map +0 -1
- package/src/blobAggregationStorage.ts +0 -420
- package/src/blobCacheStorageService.ts +0 -35
- package/src/emptyDocumentDeltaStorageService.ts +0 -25
- package/src/mapWithExpiration.ts +0 -124
- package/src/multiDocumentServiceFactory.ts +0 -91
- package/src/multiUrlResolver.ts +0 -48
- package/src/treeUtils.ts +0 -107
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeConversions.js","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAAmC,WAAW,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"treeConversions.js","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAAmC,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACpG,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,iCAAiC,CAAC,WAAyB;IAC1E,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,+BAA+B,CAAC,WAAW,CAAC,CAAC;IACtE,MAAM,iBAAiB,GAAG,gBAAgB;QACzC,CAAC,CAAC;YACA,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,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B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;aAC/D;YAED;gBACC,eAAe,CAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC;SACxD;KACD;IACD,OAAO;QACN,OAAO;QACP,YAAY,EAAE,WAAW,CAAC,YAAY;KACtC,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Uint8ArrayToString, unreachableCase } from \"@fluidframework/common-utils\";\nimport { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from \"@fluidframework/protocol-base\";\nimport { ISummaryTree, ITree, ITreeEntry, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { isCombinedAppAndProtocolSummary } from \"./summaryForCreateNew\";\n\n/**\n * Converts ISummaryTree to ITree format.\n * @param summaryTree - summary tree in ISummaryTree format\n */\nexport function convertSummaryTreeToSnapshotITree(summaryTree: ISummaryTree): ITree {\n\tconst entries: ITreeEntry[] = [];\n\tconst adaptSummaryTree = isCombinedAppAndProtocolSummary(summaryTree);\n\tconst allSummaryEntries = adaptSummaryTree\n\t\t? [\n\t\t\t\t...Object.entries(summaryTree.tree[\".protocol\"].tree),\n\t\t\t\t...Object.entries(summaryTree.tree[\".app\"].tree),\n\t\t ]\n\t\t: Object.entries(summaryTree.tree);\n\n\tfor (const [key, value] of allSummaryEntries) {\n\t\tconst k = adaptSummaryTree && key === \"attributes\" ? \".attributes\" : key;\n\t\tswitch (value.type) {\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tlet parsedContent: string;\n\t\t\t\tlet encoding: \"utf-8\" | \"base64\" = \"utf-8\";\n\t\t\t\tif (typeof value.content === \"string\") {\n\t\t\t\t\tparsedContent = value.content;\n\t\t\t\t} else {\n\t\t\t\t\tparsedContent = Uint8ArrayToString(value.content, \"base64\");\n\t\t\t\t\tencoding = \"base64\";\n\t\t\t\t}\n\t\t\t\tentries.push(new BlobTreeEntry(k, parsedContent, encoding));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\tentries.push(new TreeTreeEntry(k, convertSummaryTreeToSnapshotITree(value)));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Attachment: {\n\t\t\t\tentries.push(new AttachmentTreeEntry(k, value.id));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tthrow new Error(\"Should not have Handle type in summary tree\");\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tunreachableCase(value, \"Unexpected summary tree type\");\n\t\t}\n\t}\n\treturn {\n\t\tentries,\n\t\tunreferenced: summaryTree.unreferenced,\n\t};\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-utils",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.4.1.0.148229",
|
|
4
4
|
"description": "Collection of utility functions for Fluid drivers",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -14,33 +14,6 @@
|
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
19
|
-
"build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
|
|
20
|
-
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
21
|
-
"build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
22
|
-
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
23
|
-
"build:full": "npm run build",
|
|
24
|
-
"build:full:compile": "npm run build:compile",
|
|
25
|
-
"build:genver": "gen-version",
|
|
26
|
-
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
27
|
-
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
|
|
28
|
-
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
29
|
-
"eslint": "eslint --format stylish src",
|
|
30
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
31
|
-
"format": "npm run prettier:fix",
|
|
32
|
-
"lint": "npm run prettier && npm run eslint",
|
|
33
|
-
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
34
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
35
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
36
|
-
"test": "npm run test:mocha",
|
|
37
|
-
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
38
|
-
"test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
39
|
-
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
40
|
-
"tsc": "tsc",
|
|
41
|
-
"typetests:gen": "flub generate typetests --generate --dir .",
|
|
42
|
-
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
43
|
-
},
|
|
44
17
|
"nyc": {
|
|
45
18
|
"all": true,
|
|
46
19
|
"cache-dir": "nyc/.cache",
|
|
@@ -63,68 +36,72 @@
|
|
|
63
36
|
},
|
|
64
37
|
"dependencies": {
|
|
65
38
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
66
|
-
"@fluidframework/common-utils": "^1.
|
|
67
|
-
"@fluidframework/core-interfaces": "
|
|
68
|
-
"@fluidframework/driver-definitions": "
|
|
69
|
-
"@fluidframework/gitresources": "^0.
|
|
70
|
-
"@fluidframework/protocol-base": "^0.
|
|
39
|
+
"@fluidframework/common-utils": "^1.1.1",
|
|
40
|
+
"@fluidframework/core-interfaces": "2.0.0-dev.4.1.0.148229",
|
|
41
|
+
"@fluidframework/driver-definitions": "2.0.0-dev.4.1.0.148229",
|
|
42
|
+
"@fluidframework/gitresources": "^0.1039.1000",
|
|
43
|
+
"@fluidframework/protocol-base": "^0.1039.1000",
|
|
71
44
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
72
|
-
"@fluidframework/telemetry-utils": "
|
|
45
|
+
"@fluidframework/telemetry-utils": "2.0.0-dev.4.1.0.148229",
|
|
73
46
|
"axios": "^0.26.0",
|
|
74
47
|
"url": "^0.11.0",
|
|
75
48
|
"uuid": "^8.3.1"
|
|
76
49
|
},
|
|
77
50
|
"devDependencies": {
|
|
78
|
-
"@fluid-tools/build-cli": "^0.
|
|
51
|
+
"@fluid-tools/build-cli": "^0.13.1",
|
|
79
52
|
"@fluidframework/build-common": "^1.1.0",
|
|
80
|
-
"@fluidframework/build-tools": "^0.
|
|
81
|
-
"@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.0.0-internal.
|
|
53
|
+
"@fluidframework/build-tools": "^0.13.1",
|
|
54
|
+
"@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.0.0-internal.4.0.0",
|
|
82
55
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
83
|
-
"@fluidframework/mocha-test-setup": "
|
|
84
|
-
"@fluidframework/runtime-utils": "
|
|
85
|
-
"@microsoft/api-extractor": "^7.
|
|
86
|
-
"@rushstack/eslint-config": "^2.5.1",
|
|
56
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev.4.1.0.148229",
|
|
57
|
+
"@fluidframework/runtime-utils": "2.0.0-dev.4.1.0.148229",
|
|
58
|
+
"@microsoft/api-extractor": "^7.34.4",
|
|
87
59
|
"@types/mocha": "^9.1.1",
|
|
88
|
-
"@types/node": "^14.18.
|
|
60
|
+
"@types/node": "^14.18.38",
|
|
89
61
|
"@types/sinon": "^7.0.13",
|
|
90
|
-
"concurrently": "^6.
|
|
62
|
+
"concurrently": "^7.6.0",
|
|
91
63
|
"copyfiles": "^2.4.1",
|
|
92
|
-
"cross-env": "^7.0.
|
|
64
|
+
"cross-env": "^7.0.3",
|
|
93
65
|
"eslint": "~8.6.0",
|
|
94
|
-
"mocha": "^10.
|
|
95
|
-
"
|
|
66
|
+
"mocha": "^10.2.0",
|
|
67
|
+
"mocha-json-output-reporter": "^2.0.1",
|
|
68
|
+
"mocha-multi-reporters": "^1.5.1",
|
|
69
|
+
"moment": "^2.21.0",
|
|
70
|
+
"nyc": "^15.1.0",
|
|
96
71
|
"prettier": "~2.6.2",
|
|
97
|
-
"rimraf": "^
|
|
72
|
+
"rimraf": "^4.4.0",
|
|
98
73
|
"sinon": "^7.4.2",
|
|
99
74
|
"typescript": "~4.5.5"
|
|
100
75
|
},
|
|
101
76
|
"typeValidation": {
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
77
|
+
"broken": {}
|
|
78
|
+
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
81
|
+
"build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
|
|
82
|
+
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
83
|
+
"build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
84
|
+
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
85
|
+
"build:full": "npm run build",
|
|
86
|
+
"build:full:compile": "npm run build:compile",
|
|
87
|
+
"build:genver": "gen-version",
|
|
88
|
+
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
89
|
+
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
|
|
90
|
+
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
91
|
+
"eslint": "eslint --format stylish src",
|
|
92
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
93
|
+
"format": "npm run prettier:fix",
|
|
94
|
+
"lint": "npm run prettier && npm run eslint",
|
|
95
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
96
|
+
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
97
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
98
|
+
"test": "npm run test:mocha",
|
|
99
|
+
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
100
|
+
"test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
101
|
+
"test:mocha:multireport": "cross-env FLUID_TEST_MULTIREPORT=1 npm run test:mocha",
|
|
102
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
103
|
+
"tsc": "tsc",
|
|
104
|
+
"typetests:gen": "fluid-type-test-generator",
|
|
105
|
+
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
129
106
|
}
|
|
130
|
-
}
|
|
107
|
+
}
|
package/src/fluidResolvedUrl.ts
CHANGED
|
@@ -5,10 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
import { IResolvedUrl, IFluidResolvedUrl } from "@fluidframework/driver-definitions";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
10
|
+
* so this method is no longer necessary.
|
|
11
|
+
*/
|
|
8
12
|
export const isFluidResolvedUrl = (
|
|
9
13
|
resolved: IResolvedUrl | undefined,
|
|
10
14
|
): resolved is IFluidResolvedUrl => resolved?.type === "fluid";
|
|
11
15
|
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated In the next major release all IResolvedUrl will be IFluidResolvedUrl,
|
|
18
|
+
* so this method is no longer necessary.
|
|
19
|
+
*/
|
|
12
20
|
export function ensureFluidResolvedUrl(
|
|
13
21
|
resolved: IResolvedUrl | undefined,
|
|
14
22
|
): asserts resolved is IFluidResolvedUrl {
|
package/src/index.ts
CHANGED
|
@@ -3,23 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export { BlobAggregationStorage, SnapshotExtractor } from "./blobAggregationStorage";
|
|
7
|
-
export { BlobCacheStorageService } from "./blobCacheStorageService";
|
|
8
6
|
export { buildSnapshotTree } from "./buildSnapshotTree";
|
|
9
7
|
export { DocumentStorageServiceProxy } from "./documentStorageServiceProxy";
|
|
10
|
-
export { EmptyDocumentDeltaStorageService } from "./emptyDocumentDeltaStorageService";
|
|
11
8
|
export { UsageError } from "./error";
|
|
12
9
|
export { ensureFluidResolvedUrl, isFluidResolvedUrl } from "./fluidResolvedUrl";
|
|
13
10
|
export { InsecureUrlResolver } from "./insecureUrlResolver";
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
canBeCoalescedByService,
|
|
17
|
-
isRuntimeMessage,
|
|
18
|
-
isUnpackedRuntimeMessage,
|
|
19
|
-
MessageType2,
|
|
20
|
-
} from "./messageRecognition";
|
|
21
|
-
export { MultiDocumentServiceFactory } from "./multiDocumentServiceFactory";
|
|
22
|
-
export { configurableUrlResolver, MultiUrlResolver } from "./multiUrlResolver";
|
|
11
|
+
export { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from "./messageRecognition";
|
|
23
12
|
export {
|
|
24
13
|
AuthorizationError,
|
|
25
14
|
canRetryOnError,
|
|
@@ -31,7 +20,6 @@ export {
|
|
|
31
20
|
GenericNetworkError,
|
|
32
21
|
getRetryDelayFromError,
|
|
33
22
|
getRetryDelaySecondsFromError,
|
|
34
|
-
IAnyDriverError,
|
|
35
23
|
isOnline,
|
|
36
24
|
LocationRedirectionError,
|
|
37
25
|
NetworkErrorBasic,
|
|
@@ -40,7 +28,7 @@ export {
|
|
|
40
28
|
RetryableError,
|
|
41
29
|
ThrottlingError,
|
|
42
30
|
} from "./network";
|
|
43
|
-
export { logNetworkFailure
|
|
31
|
+
export { logNetworkFailure } from "./networkUtils";
|
|
44
32
|
export {
|
|
45
33
|
emptyMessageStream,
|
|
46
34
|
ParallelRequests,
|
|
@@ -55,12 +43,9 @@ export { readAndParse } from "./readAndParse";
|
|
|
55
43
|
export { IProgress, runWithRetry } from "./runWithRetry";
|
|
56
44
|
export {
|
|
57
45
|
combineAppAndProtocolSummary,
|
|
46
|
+
CombinedAppAndProtocolSummary,
|
|
58
47
|
getDocAttributesFromProtocolSummary,
|
|
59
48
|
getQuorumValuesFromProtocolSummary,
|
|
49
|
+
isCombinedAppAndProtocolSummary,
|
|
60
50
|
} from "./summaryForCreateNew";
|
|
61
51
|
export { convertSummaryTreeToSnapshotITree } from "./treeConversions";
|
|
62
|
-
export {
|
|
63
|
-
convertSnapshotAndBlobsToSummaryTree,
|
|
64
|
-
ISummaryTreeAssemblerProps,
|
|
65
|
-
SummaryTreeAssembler,
|
|
66
|
-
} from "./treeUtils";
|
|
@@ -17,42 +17,6 @@ export function isRuntimeMessage(message: { type: string }): boolean {
|
|
|
17
17
|
return message.type === MessageType.Operation;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
enum RuntimeMessage {
|
|
21
|
-
FluidDataStoreOp = "component",
|
|
22
|
-
Attach = "attach",
|
|
23
|
-
ChunkedOp = "chunkedOp",
|
|
24
|
-
BlobAttach = "blobAttach",
|
|
25
|
-
Rejoin = "rejoin",
|
|
26
|
-
Alias = "alias",
|
|
27
|
-
Operation = "op",
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Determines whether or not the message type is one of the following: (legacy)
|
|
32
|
-
*
|
|
33
|
-
* - "component"
|
|
34
|
-
*
|
|
35
|
-
* - "attach"
|
|
36
|
-
*
|
|
37
|
-
* - "chunkedOp"
|
|
38
|
-
*
|
|
39
|
-
* - "blobAttach"
|
|
40
|
-
*
|
|
41
|
-
* - "rejoin"
|
|
42
|
-
*
|
|
43
|
-
* - "alias"
|
|
44
|
-
*
|
|
45
|
-
* - "op"
|
|
46
|
-
*
|
|
47
|
-
* @deprecated This API should not be used.
|
|
48
|
-
*/
|
|
49
|
-
export function isUnpackedRuntimeMessage(message: ISequencedDocumentMessage): boolean {
|
|
50
|
-
if ((Object.values(RuntimeMessage) as string[]).includes(message.type)) {
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
20
|
// ADO #1385: staging code changes across layers.
|
|
57
21
|
// Eventually to be replaced by MessageType.accept
|
|
58
22
|
export enum MessageType2 {
|
package/src/network.ts
CHANGED
|
@@ -34,22 +34,6 @@ export function isOnline(): OnlineStatus {
|
|
|
34
34
|
return OnlineStatus.Unknown;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* Interface describing errors and warnings raised by any driver code.
|
|
39
|
-
* Not expected to be implemented by a class or an object literal, but rather used in place of
|
|
40
|
-
* any or unknown in various function signatures that pass errors around.
|
|
41
|
-
*
|
|
42
|
-
* "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
|
|
43
|
-
* It will be either DriverErrorType or the specific driver's specialized error type enum,
|
|
44
|
-
* but we can't reference a specific driver's error type enum in this code.
|
|
45
|
-
*
|
|
46
|
-
* @deprecated - In favour of {@link @fluidframework/driver-definitions#IAnyDriverError} so that
|
|
47
|
-
* it can used from the base to upper layers.
|
|
48
|
-
*/
|
|
49
|
-
export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
50
|
-
readonly errorType: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
37
|
/** Telemetry props with driver-specific required properties */
|
|
54
38
|
export type DriverErrorTelemetryProps = ITelemetryProperties & {
|
|
55
39
|
driverVersion: string | undefined;
|
package/src/networkUtils.ts
CHANGED
|
@@ -29,35 +29,3 @@ export function logNetworkFailure(
|
|
|
29
29
|
newEvent.category = canRetryOnError(error) ? "generic" : "error";
|
|
30
30
|
logger.sendTelemetryEvent(newEvent, error);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Wait for browser to get to connected state.
|
|
35
|
-
* If connected, waits minimum of minDelay anyway (between network retries)
|
|
36
|
-
* If disconnected, polls every 30 seconds anyway, to make sure we are not getting stuck because of wrong signal
|
|
37
|
-
* Note that browsers will have false positives (like having Hyper-V adapter on machine,
|
|
38
|
-
* or machine connected to router that is not connected to internet)
|
|
39
|
-
* But there should be no false negatives.
|
|
40
|
-
* The only exception - Opera returns false when user enters "Work Offline" mode, regardless of actual connectivity.
|
|
41
|
-
*/
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
43
|
-
export function waitForConnectedState(minDelay: number): Promise<void> {
|
|
44
|
-
// Use this frequency to poll even when we are offline and able to setup online/offline listener
|
|
45
|
-
// This is mostly safety net
|
|
46
|
-
const offlinePollFrequency = 30000;
|
|
47
|
-
|
|
48
|
-
return new Promise((resolve) => {
|
|
49
|
-
let listener: () => void = resolve;
|
|
50
|
-
let delay = minDelay;
|
|
51
|
-
if (isOnline() === OnlineStatus.Offline) {
|
|
52
|
-
if (window?.addEventListener !== undefined) {
|
|
53
|
-
listener = () => {
|
|
54
|
-
resolve();
|
|
55
|
-
window.removeEventListener("online", listener);
|
|
56
|
-
};
|
|
57
|
-
window.addEventListener("online", listener, false);
|
|
58
|
-
delay = Math.max(minDelay, offlinePollFrequency);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
setTimeout(listener, delay);
|
|
62
|
-
});
|
|
63
|
-
}
|
package/src/packageVersion.ts
CHANGED
package/src/parallelRequests.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { PerformanceEvent } from "@fluidframework/telemetry-utils";
|
|
|
8
8
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
9
9
|
import { IDeltasFetchResult, IStream, IStreamResult } from "@fluidframework/driver-definitions";
|
|
10
10
|
import { getRetryDelayFromError, canRetryOnError, createGenericNetworkError } from "./network";
|
|
11
|
-
import {
|
|
11
|
+
import { logNetworkFailure } from "./networkUtils";
|
|
12
12
|
// For now, this package is versioned and released in unison with the specific drivers
|
|
13
13
|
import { pkgVersion as driverVersion } from "./packageVersion";
|
|
14
14
|
|
|
@@ -379,6 +379,19 @@ export class Queue<T> implements IStream<T> {
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
+
const waitForOnline = async (): Promise<void> => {
|
|
383
|
+
// Only wait if we have a strong signal that we're offline - otherwise assume we're online.
|
|
384
|
+
if (globalThis.navigator?.onLine === false && globalThis.addEventListener !== undefined) {
|
|
385
|
+
return new Promise<void>((resolve) => {
|
|
386
|
+
const resolveAndRemoveListener = () => {
|
|
387
|
+
resolve();
|
|
388
|
+
globalThis.removeEventListener("online", resolveAndRemoveListener);
|
|
389
|
+
};
|
|
390
|
+
globalThis.addEventListener("online", resolveAndRemoveListener);
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
|
|
382
395
|
/**
|
|
383
396
|
* Retrieve single batch of ops
|
|
384
397
|
* @param request - request index
|
|
@@ -403,7 +416,6 @@ async function getSingleOpBatch(
|
|
|
403
416
|
let lastSuccessTime: number | undefined;
|
|
404
417
|
|
|
405
418
|
let retry: number = 0;
|
|
406
|
-
const deltas: ISequencedDocumentMessage[] = [];
|
|
407
419
|
const nothing = { partial: false, cancel: true, payload: [] };
|
|
408
420
|
|
|
409
421
|
while (signal?.aborted !== true) {
|
|
@@ -412,23 +424,22 @@ async function getSingleOpBatch(
|
|
|
412
424
|
const startTime = performance.now();
|
|
413
425
|
|
|
414
426
|
try {
|
|
415
|
-
// Issue async request for deltas
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
deltas.push(...messages);
|
|
420
|
-
|
|
421
|
-
const deltasRetrievedLast = messages.length;
|
|
427
|
+
// Issue async request for deltas
|
|
428
|
+
const { messages, partialResult } = await get(
|
|
429
|
+
{ ...props, retry } /* telemetry props */,
|
|
430
|
+
);
|
|
422
431
|
|
|
423
|
-
|
|
424
|
-
|
|
432
|
+
// If we got messages back, return them. Return regardless of whether we got messages back if we didn't
|
|
433
|
+
// specify a "to", since we don't have an expectation of how many to receive.
|
|
434
|
+
if (messages.length !== 0 || !strongTo) {
|
|
435
|
+
return { payload: messages, cancel: false, partial: partialResult };
|
|
425
436
|
}
|
|
426
437
|
|
|
427
|
-
//
|
|
428
|
-
// Attempt to fetch more deltas. If we didn't receive any in the previous call we up our retry
|
|
429
|
-
// count since something prevented us from seeing those deltas
|
|
438
|
+
// Otherwise, the storage gave us back an empty set of ops but we were expecting a non-empty set.
|
|
430
439
|
|
|
431
440
|
if (lastSuccessTime === undefined) {
|
|
441
|
+
// Take timestamp of the first time server responded successfully, even though it wasn't with the ops we asked for.
|
|
442
|
+
// If we keep getting empty responses we'll eventually fail out below.
|
|
432
443
|
lastSuccessTime = performance.now();
|
|
433
444
|
} else if (performance.now() - lastSuccessTime > 30000) {
|
|
434
445
|
// If we are connected and receiving proper responses from server, but can't get any ops back,
|
|
@@ -449,8 +460,6 @@ async function getSingleOpBatch(
|
|
|
449
460
|
} catch (error) {
|
|
450
461
|
const canRetry = canRetryOnError(error);
|
|
451
462
|
|
|
452
|
-
lastSuccessTime = undefined;
|
|
453
|
-
|
|
454
463
|
const retryAfter = getRetryDelayFromError(error);
|
|
455
464
|
|
|
456
465
|
// This will log to error table only if the error is non-retryable
|
|
@@ -472,12 +481,22 @@ async function getSingleOpBatch(
|
|
|
472
481
|
throw error;
|
|
473
482
|
}
|
|
474
483
|
|
|
475
|
-
if (retryAfter !== undefined
|
|
484
|
+
if (retryAfter !== undefined) {
|
|
485
|
+
// If the error told us to wait, then we will wait for that specific amount rather than the default.
|
|
476
486
|
delay = retryAfter;
|
|
477
487
|
}
|
|
478
488
|
}
|
|
479
489
|
|
|
480
|
-
|
|
490
|
+
// If we get here something has gone wrong - either got an unexpected empty set of messages back or a real error.
|
|
491
|
+
// Either way we will wait a little bit before retrying.
|
|
492
|
+
await new Promise<void>((resolve) => {
|
|
493
|
+
setTimeout(resolve, delay);
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
// If we believe we're offline, we assume there's no point in trying until we at least think we're online.
|
|
497
|
+
// NOTE: This isn't strictly true for drivers that don't require network (e.g. local driver). Really this logic
|
|
498
|
+
// should probably live in the driver.
|
|
499
|
+
await waitForOnline();
|
|
481
500
|
}
|
|
482
501
|
|
|
483
502
|
return nothing;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { assert } from "@fluidframework/common-utils";
|
|
6
7
|
import {
|
|
7
8
|
ISummaryTree,
|
|
8
9
|
SummaryType,
|
|
@@ -11,16 +12,61 @@ import {
|
|
|
11
12
|
IDocumentAttributes,
|
|
12
13
|
} from "@fluidframework/protocol-definitions";
|
|
13
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Defines the current layout of an .app + .protocol summary tree
|
|
17
|
+
* this is used internally for create new, and single commit summary
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export interface CombinedAppAndProtocolSummary extends ISummaryTree {
|
|
21
|
+
tree: {
|
|
22
|
+
[".app"]: ISummaryTree;
|
|
23
|
+
[".protocol"]: ISummaryTree;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Validates the current layout of an .app + .protocol summary tree
|
|
29
|
+
* this is used internally for create new, and single commit summary
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export function isCombinedAppAndProtocolSummary(
|
|
33
|
+
summary: ISummaryTree | undefined,
|
|
34
|
+
): summary is CombinedAppAndProtocolSummary {
|
|
35
|
+
if (
|
|
36
|
+
summary?.tree === undefined ||
|
|
37
|
+
summary.tree?.[".app"]?.type !== SummaryType.Tree ||
|
|
38
|
+
summary.tree?.[".protocol"]?.type !== SummaryType.Tree
|
|
39
|
+
) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
const treeKeys = Object.keys(summary.tree);
|
|
43
|
+
if (treeKeys.length !== 2) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
14
49
|
/**
|
|
15
50
|
* Combine the app summary and protocol summary in 1 tree.
|
|
16
51
|
* @param appSummary - Summary of the app.
|
|
17
52
|
* @param protocolSummary - Summary of the protocol.
|
|
53
|
+
* @internal
|
|
54
|
+
*
|
|
55
|
+
* @deprecated 2.0.0-internal.3.4.0 - Not intended for public use. Will be moved to container-loader and no longer exported in an upcoming release.
|
|
18
56
|
*/
|
|
19
57
|
export function combineAppAndProtocolSummary(
|
|
20
58
|
appSummary: ISummaryTree,
|
|
21
59
|
protocolSummary: ISummaryTree,
|
|
22
|
-
):
|
|
23
|
-
|
|
60
|
+
): CombinedAppAndProtocolSummary {
|
|
61
|
+
assert(
|
|
62
|
+
!isCombinedAppAndProtocolSummary(appSummary),
|
|
63
|
+
0x5a8 /* app summary is already a combined tree! */,
|
|
64
|
+
);
|
|
65
|
+
assert(
|
|
66
|
+
!isCombinedAppAndProtocolSummary(protocolSummary),
|
|
67
|
+
0x5a9 /* protocol summary is already a combined tree! */,
|
|
68
|
+
);
|
|
69
|
+
const createNewSummary: CombinedAppAndProtocolSummary = {
|
|
24
70
|
type: SummaryType.Tree,
|
|
25
71
|
tree: {
|
|
26
72
|
".protocol": protocolSummary,
|
package/src/treeConversions.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { Uint8ArrayToString, unreachableCase } from "@fluidframework/common-utils";
|
|
7
7
|
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "@fluidframework/protocol-base";
|
|
8
8
|
import { ISummaryTree, ITree, ITreeEntry, SummaryType } from "@fluidframework/protocol-definitions";
|
|
9
|
+
import { isCombinedAppAndProtocolSummary } from "./summaryForCreateNew";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Converts ISummaryTree to ITree format.
|
|
@@ -13,18 +14,16 @@ import { ISummaryTree, ITree, ITreeEntry, SummaryType } from "@fluidframework/pr
|
|
|
13
14
|
*/
|
|
14
15
|
export function convertSummaryTreeToSnapshotITree(summaryTree: ISummaryTree): ITree {
|
|
15
16
|
const entries: ITreeEntry[] = [];
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
? [...Object.entries(protocolSummary.tree), ...Object.entries(appSummary.tree)]
|
|
17
|
+
const adaptSummaryTree = isCombinedAppAndProtocolSummary(summaryTree);
|
|
18
|
+
const allSummaryEntries = adaptSummaryTree
|
|
19
|
+
? [
|
|
20
|
+
...Object.entries(summaryTree.tree[".protocol"].tree),
|
|
21
|
+
...Object.entries(summaryTree.tree[".app"].tree),
|
|
22
|
+
]
|
|
23
23
|
: Object.entries(summaryTree.tree);
|
|
24
24
|
|
|
25
25
|
for (const [key, value] of allSummaryEntries) {
|
|
26
|
-
|
|
27
|
-
const k = adaptSumaryTree && ["attributes"].includes(key) ? `.${key}` : key;
|
|
26
|
+
const k = adaptSummaryTree && key === "attributes" ? ".attributes" : key;
|
|
28
27
|
switch (value.type) {
|
|
29
28
|
case SummaryType.Blob: {
|
|
30
29
|
let parsedContent: string;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IDocumentStorageService, IDocumentStorageServicePolicies, ISummaryContext } from "@fluidframework/driver-definitions";
|
|
6
|
-
import { ICreateBlobResponse, ISnapshotTree, ISummaryHandle, ISummaryTree, IVersion } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
8
|
-
export declare abstract class SnapshotExtractor {
|
|
9
|
-
protected readonly aggregatedBlobName = "__big";
|
|
10
|
-
protected readonly virtualIdPrefix = "__";
|
|
11
|
-
protected virtualIdCounter: number;
|
|
12
|
-
protected getNextVirtualId(): string;
|
|
13
|
-
abstract getBlob(id: string, tree: ISnapshotTree): Promise<ArrayBufferLike>;
|
|
14
|
-
abstract setBlob(id: string, tree: ISnapshotTree, content: string): any;
|
|
15
|
-
unpackSnapshotCore(snapshot: ISnapshotTree, level?: number): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
export declare class BlobAggregationStorage extends SnapshotExtractor implements IDocumentStorageService {
|
|
18
|
-
private readonly storage;
|
|
19
|
-
private readonly logger;
|
|
20
|
-
private readonly allowPacking;
|
|
21
|
-
private readonly packingLevel;
|
|
22
|
-
private readonly blobCutOffSize?;
|
|
23
|
-
static readonly fullDataStoreSummaries = true;
|
|
24
|
-
protected loadedFromSummary: boolean;
|
|
25
|
-
protected virtualBlobs: Map<string, ArrayBufferLike>;
|
|
26
|
-
static wrap(storage: IDocumentStorageService, logger: ITelemetryLogger, allowPacking?: boolean, packingLevel?: number): BlobAggregationStorage;
|
|
27
|
-
static unpackSnapshot(snapshot: ISnapshotTree): Promise<void>;
|
|
28
|
-
get policies(): IDocumentStorageServicePolicies | undefined;
|
|
29
|
-
unpackSnapshot(snapshot: ISnapshotTree): Promise<void>;
|
|
30
|
-
protected constructor(storage: IDocumentStorageService, logger: ITelemetryLogger, allowPacking: boolean, packingLevel: number, blobCutOffSize?: number | undefined);
|
|
31
|
-
setBlob(id: string, tree: ISnapshotTree, content: string): void;
|
|
32
|
-
getBlob(id: string, tree: ISnapshotTree): Promise<ArrayBufferLike>;
|
|
33
|
-
get repositoryUrl(): string;
|
|
34
|
-
getVersions(versionId: string | null, count: number): Promise<IVersion[]>;
|
|
35
|
-
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
|
|
36
|
-
createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
|
|
37
|
-
getSnapshotTree(version?: IVersion): Promise<ISnapshotTree | null>;
|
|
38
|
-
readBlob(id: string): Promise<ArrayBufferLike>;
|
|
39
|
-
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
|
|
40
|
-
private compressSmallBlobs;
|
|
41
|
-
protected isRealStorageId(id: string): boolean;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=blobAggregationStorage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blobAggregationStorage.d.ts","sourceRoot":"","sources":["../src/blobAggregationStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,uBAAuB,EACvB,+BAA+B,EAC/B,eAAe,EACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EAER,MAAM,sCAAsC,CAAC;AAS9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AA0CtE,8BAAsB,iBAAiB;IACtC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,WAAW;IAChD,SAAS,CAAC,QAAQ,CAAC,eAAe,QAAQ;IAG1C,SAAS,CAAC,gBAAgB,SAAK;IAC/B,SAAS,CAAC,gBAAgB;IA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