@fluidframework/routerlicious-driver 2.116.0-416006 → 2.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +5 -3
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +14 -14
- package/src/packageVersion.ts +1 -1
- package/dist/createNewUtils.d.ts +0 -12
- package/dist/createNewUtils.d.ts.map +0 -1
- package/dist/createNewUtils.js +0 -40
- package/dist/createNewUtils.js.map +0 -1
- package/lib/createNewUtils.d.ts +0 -12
- package/lib/createNewUtils.d.ts.map +0 -1
- package/lib/createNewUtils.js +0 -36
- package/lib/createNewUtils.js.map +0 -1
- package/src/createNewUtils.ts +0 -39
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ There are many ways to [contribute](https://github.com/microsoft/FluidFramework/
|
|
|
101
101
|
- Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
|
|
102
102
|
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
|
|
103
103
|
|
|
104
|
-
Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/
|
|
104
|
+
Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md).
|
|
105
105
|
|
|
106
106
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
107
107
|
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
@@ -112,9 +112,11 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
|
|
|
112
112
|
|
|
113
113
|
## Help
|
|
114
114
|
|
|
115
|
-
Not finding what you're looking for in this README?
|
|
115
|
+
Not finding what you're looking for in this README?
|
|
116
|
+
Check out [fluidframework.com](https://fluidframework.com/docs/).
|
|
116
117
|
|
|
117
|
-
Still not finding what you're looking for?
|
|
118
|
+
Still not finding what you're looking for?
|
|
119
|
+
Please [file an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
|
|
118
120
|
|
|
119
121
|
Thank you!
|
|
120
122
|
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/routerlicious-driver";
|
|
8
|
-
export declare const pkgVersion = "2.116.0
|
|
8
|
+
export declare const pkgVersion = "2.116.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,YAAY,CAAC"}
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/routerlicious-driver";
|
|
11
|
-
exports.pkgVersion = "2.116.0
|
|
11
|
+
exports.pkgVersion = "2.116.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/routerlicious-driver\";\nexport const pkgVersion = \"2.116.0\";\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/routerlicious-driver";
|
|
8
|
-
export declare const pkgVersion = "2.116.0
|
|
8
|
+
export declare const pkgVersion = "2.116.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,YAAY,CAAC"}
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/routerlicious-driver\";\nexport const pkgVersion = \"2.116.0\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/routerlicious-driver",
|
|
3
|
-
"version": "2.116.0
|
|
3
|
+
"version": "2.116.0",
|
|
4
4
|
"description": "Socket.IO + Git implementation of Fluid service API",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -69,26 +69,26 @@
|
|
|
69
69
|
"temp-directory": "nyc/.nyc_output"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@fluid-internal/client-utils": "2.116.0
|
|
73
|
-
"@fluidframework/core-interfaces": "2.116.0
|
|
74
|
-
"@fluidframework/core-utils": "2.116.0
|
|
75
|
-
"@fluidframework/driver-base": "2.116.0
|
|
76
|
-
"@fluidframework/driver-definitions": "2.116.0
|
|
77
|
-
"@fluidframework/driver-utils": "2.116.0
|
|
72
|
+
"@fluid-internal/client-utils": "~2.116.0",
|
|
73
|
+
"@fluidframework/core-interfaces": "~2.116.0",
|
|
74
|
+
"@fluidframework/core-utils": "~2.116.0",
|
|
75
|
+
"@fluidframework/driver-base": "~2.116.0",
|
|
76
|
+
"@fluidframework/driver-definitions": "~2.116.0",
|
|
77
|
+
"@fluidframework/driver-utils": "~2.116.0",
|
|
78
78
|
"@fluidframework/server-services-client": "^7.0.1",
|
|
79
|
-
"@fluidframework/telemetry-utils": "2.116.0
|
|
79
|
+
"@fluidframework/telemetry-utils": "~2.116.0",
|
|
80
80
|
"json-stringify-safe": "5.0.1",
|
|
81
81
|
"socket.io-client": "^4.8.3"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@arethetypeswrong/cli": "^0.18.
|
|
84
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
85
85
|
"@biomejs/biome": "~2.4.5",
|
|
86
|
-
"@fluid-internal/mocha-test-setup": "2.116.0
|
|
87
|
-
"@fluid-tools/build-cli": "^0.
|
|
86
|
+
"@fluid-internal/mocha-test-setup": "~2.116.0",
|
|
87
|
+
"@fluid-tools/build-cli": "^0.67.0",
|
|
88
88
|
"@fluidframework/build-common": "^2.0.3",
|
|
89
|
-
"@fluidframework/build-tools": "^0.
|
|
90
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
91
|
-
"@fluidframework/routerlicious-driver-previous": "npm:@fluidframework/routerlicious-driver@2.
|
|
89
|
+
"@fluidframework/build-tools": "^0.67.0",
|
|
90
|
+
"@fluidframework/eslint-config-fluid": "^14.0.0",
|
|
91
|
+
"@fluidframework/routerlicious-driver-previous": "npm:@fluidframework/routerlicious-driver@2.114.0",
|
|
92
92
|
"@microsoft/api-extractor": "7.58.1",
|
|
93
93
|
"@types/mocha": "^10.0.10",
|
|
94
94
|
"@types/node": "~22.19.17",
|
package/src/packageVersion.ts
CHANGED
package/dist/createNewUtils.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
6
|
-
/**
|
|
7
|
-
* Utility api to convert ISummaryTree to a summary tree where blob contents are only utf8 strings.
|
|
8
|
-
* @param summary - Summary supplied by the runtime to upload.
|
|
9
|
-
* @returns Modified summary tree where the blob contents could be utf8 string only.
|
|
10
|
-
*/
|
|
11
|
-
export declare function convertSummaryToCreateNewSummary(summary: ISummaryTree): ISummaryTree;
|
|
12
|
-
//# sourceMappingURL=createNewUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createNewUtils.d.ts","sourceRoot":"","sources":["../src/createNewUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAGvE;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAwBpF"}
|
package/dist/createNewUtils.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.convertSummaryToCreateNewSummary = void 0;
|
|
8
|
-
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
|
-
const driver_definitions_1 = require("@fluidframework/driver-definitions");
|
|
10
|
-
/**
|
|
11
|
-
* Utility api to convert ISummaryTree to a summary tree where blob contents are only utf8 strings.
|
|
12
|
-
* @param summary - Summary supplied by the runtime to upload.
|
|
13
|
-
* @returns Modified summary tree where the blob contents could be utf8 string only.
|
|
14
|
-
*/
|
|
15
|
-
function convertSummaryToCreateNewSummary(summary) {
|
|
16
|
-
for (const [key, summaryObject] of Object.entries(summary.tree)) {
|
|
17
|
-
switch (summaryObject.type) {
|
|
18
|
-
case driver_definitions_1.SummaryType.Tree: {
|
|
19
|
-
summary.tree[key] = convertSummaryToCreateNewSummary(summaryObject);
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
case driver_definitions_1.SummaryType.Blob: {
|
|
23
|
-
summaryObject.content =
|
|
24
|
-
typeof summaryObject.content === "string"
|
|
25
|
-
? summaryObject.content
|
|
26
|
-
: (0, client_utils_1.Uint8ArrayToString)(summaryObject.content, "utf8");
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
case driver_definitions_1.SummaryType.Handle: {
|
|
30
|
-
throw new Error("No handle should be present for first summary!!");
|
|
31
|
-
}
|
|
32
|
-
default: {
|
|
33
|
-
throw new Error(`Unknown tree type ${summaryObject.type}`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return summary;
|
|
38
|
-
}
|
|
39
|
-
exports.convertSummaryToCreateNewSummary = convertSummaryToCreateNewSummary;
|
|
40
|
-
//# sourceMappingURL=createNewUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createNewUtils.js","sourceRoot":"","sources":["../src/createNewUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAkE;AAElE,2EAAiE;AAEjE;;;;GAIG;AACH,SAAgB,gCAAgC,CAAC,OAAqB;IACrE,KAAK,MAAM,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACjE,QAAQ,aAAa,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,gCAAW,CAAC,IAAI,CAAC,CAAC,CAAC;gBACvB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,gCAAgC,CAAC,aAAa,CAAC,CAAC;gBACpE,MAAM;YACP,CAAC;YACD,KAAK,gCAAW,CAAC,IAAI,CAAC,CAAC,CAAC;gBACvB,aAAa,CAAC,OAAO;oBACpB,OAAO,aAAa,CAAC,OAAO,KAAK,QAAQ;wBACxC,CAAC,CAAC,aAAa,CAAC,OAAO;wBACvB,CAAC,CAAC,IAAA,iCAAkB,EAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACtD,MAAM;YACP,CAAC;YACD,KAAK,gCAAW,CAAC,MAAM,CAAC,CAAC,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACpE,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,qBAAqB,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5D,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAxBD,4EAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport type { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport { SummaryType } from \"@fluidframework/driver-definitions\";\n\n/**\n * Utility api to convert ISummaryTree to a summary tree where blob contents are only utf8 strings.\n * @param summary - Summary supplied by the runtime to upload.\n * @returns Modified summary tree where the blob contents could be utf8 string only.\n */\nexport function convertSummaryToCreateNewSummary(summary: ISummaryTree): ISummaryTree {\n\tfor (const [key, summaryObject] of Object.entries(summary.tree)) {\n\t\tswitch (summaryObject.type) {\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\tsummary.tree[key] = convertSummaryToCreateNewSummary(summaryObject);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tsummaryObject.content =\n\t\t\t\t\ttypeof summaryObject.content === \"string\"\n\t\t\t\t\t\t? summaryObject.content\n\t\t\t\t\t\t: Uint8ArrayToString(summaryObject.content, \"utf8\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tthrow new Error(\"No handle should be present for first summary!!\");\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unknown tree type ${summaryObject.type}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn summary;\n}\n"]}
|
package/lib/createNewUtils.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
6
|
-
/**
|
|
7
|
-
* Utility api to convert ISummaryTree to a summary tree where blob contents are only utf8 strings.
|
|
8
|
-
* @param summary - Summary supplied by the runtime to upload.
|
|
9
|
-
* @returns Modified summary tree where the blob contents could be utf8 string only.
|
|
10
|
-
*/
|
|
11
|
-
export declare function convertSummaryToCreateNewSummary(summary: ISummaryTree): ISummaryTree;
|
|
12
|
-
//# sourceMappingURL=createNewUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createNewUtils.d.ts","sourceRoot":"","sources":["../src/createNewUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAGvE;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAwBpF"}
|
package/lib/createNewUtils.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
6
|
-
import { SummaryType } from "@fluidframework/driver-definitions";
|
|
7
|
-
/**
|
|
8
|
-
* Utility api to convert ISummaryTree to a summary tree where blob contents are only utf8 strings.
|
|
9
|
-
* @param summary - Summary supplied by the runtime to upload.
|
|
10
|
-
* @returns Modified summary tree where the blob contents could be utf8 string only.
|
|
11
|
-
*/
|
|
12
|
-
export function convertSummaryToCreateNewSummary(summary) {
|
|
13
|
-
for (const [key, summaryObject] of Object.entries(summary.tree)) {
|
|
14
|
-
switch (summaryObject.type) {
|
|
15
|
-
case SummaryType.Tree: {
|
|
16
|
-
summary.tree[key] = convertSummaryToCreateNewSummary(summaryObject);
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
case SummaryType.Blob: {
|
|
20
|
-
summaryObject.content =
|
|
21
|
-
typeof summaryObject.content === "string"
|
|
22
|
-
? summaryObject.content
|
|
23
|
-
: Uint8ArrayToString(summaryObject.content, "utf8");
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
case SummaryType.Handle: {
|
|
27
|
-
throw new Error("No handle should be present for first summary!!");
|
|
28
|
-
}
|
|
29
|
-
default: {
|
|
30
|
-
throw new Error(`Unknown tree type ${summaryObject.type}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return summary;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=createNewUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createNewUtils.js","sourceRoot":"","sources":["../src/createNewUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAAC,OAAqB;IACrE,KAAK,MAAM,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACjE,QAAQ,aAAa,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;gBACvB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,gCAAgC,CAAC,aAAa,CAAC,CAAC;gBACpE,MAAM;YACP,CAAC;YACD,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;gBACvB,aAAa,CAAC,OAAO;oBACpB,OAAO,aAAa,CAAC,OAAO,KAAK,QAAQ;wBACxC,CAAC,CAAC,aAAa,CAAC,OAAO;wBACvB,CAAC,CAAC,kBAAkB,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACtD,MAAM;YACP,CAAC;YACD,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACpE,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,qBAAqB,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5D,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Uint8ArrayToString } from \"@fluid-internal/client-utils\";\nimport type { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport { SummaryType } from \"@fluidframework/driver-definitions\";\n\n/**\n * Utility api to convert ISummaryTree to a summary tree where blob contents are only utf8 strings.\n * @param summary - Summary supplied by the runtime to upload.\n * @returns Modified summary tree where the blob contents could be utf8 string only.\n */\nexport function convertSummaryToCreateNewSummary(summary: ISummaryTree): ISummaryTree {\n\tfor (const [key, summaryObject] of Object.entries(summary.tree)) {\n\t\tswitch (summaryObject.type) {\n\t\t\tcase SummaryType.Tree: {\n\t\t\t\tsummary.tree[key] = convertSummaryToCreateNewSummary(summaryObject);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Blob: {\n\t\t\t\tsummaryObject.content =\n\t\t\t\t\ttypeof summaryObject.content === \"string\"\n\t\t\t\t\t\t? summaryObject.content\n\t\t\t\t\t\t: Uint8ArrayToString(summaryObject.content, \"utf8\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SummaryType.Handle: {\n\t\t\t\tthrow new Error(\"No handle should be present for first summary!!\");\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unknown tree type ${summaryObject.type}`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn summary;\n}\n"]}
|
package/src/createNewUtils.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
7
|
-
import type { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
|
-
import { SummaryType } from "@fluidframework/driver-definitions";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Utility api to convert ISummaryTree to a summary tree where blob contents are only utf8 strings.
|
|
12
|
-
* @param summary - Summary supplied by the runtime to upload.
|
|
13
|
-
* @returns Modified summary tree where the blob contents could be utf8 string only.
|
|
14
|
-
*/
|
|
15
|
-
export function convertSummaryToCreateNewSummary(summary: ISummaryTree): ISummaryTree {
|
|
16
|
-
for (const [key, summaryObject] of Object.entries(summary.tree)) {
|
|
17
|
-
switch (summaryObject.type) {
|
|
18
|
-
case SummaryType.Tree: {
|
|
19
|
-
summary.tree[key] = convertSummaryToCreateNewSummary(summaryObject);
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
case SummaryType.Blob: {
|
|
23
|
-
summaryObject.content =
|
|
24
|
-
typeof summaryObject.content === "string"
|
|
25
|
-
? summaryObject.content
|
|
26
|
-
: Uint8ArrayToString(summaryObject.content, "utf8");
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
case SummaryType.Handle: {
|
|
30
|
-
throw new Error("No handle should be present for first summary!!");
|
|
31
|
-
}
|
|
32
|
-
default: {
|
|
33
|
-
throw new Error(`Unknown tree type ${summaryObject.type}`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return summary;
|
|
39
|
-
}
|