@fluidframework/driver-utils 2.0.0-internal.4.3.1 → 2.0.0-internal.4.4.1
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 +6 -0
- package/dist/blob.d.ts +53 -0
- package/dist/blob.d.ts.map +1 -0
- package/dist/blob.js +62 -0
- package/dist/blob.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.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/treeConversions.d.ts.map +1 -1
- package/dist/treeConversions.js +4 -4
- package/dist/treeConversions.js.map +1 -1
- package/lib/blob.d.ts +53 -0
- package/lib/blob.d.ts.map +1 -0
- package/lib/blob.js +56 -0
- package/lib/blob.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.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/treeConversions.d.ts.map +1 -1
- package/lib/treeConversions.js +1 -1
- package/lib/treeConversions.js.map +1 -1
- package/package.json +5 -6
- package/src/blob.ts +68 -0
- package/src/index.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/treeConversions.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @fluidframework/driver-utils
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.4.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- The following classes have been moved from `@fluidframework/protocol-base` to `@fluidframework/driver-utils`: `BlobTreeEntry`, `TreeTreeEntry` and `AttachmentTreeEntry`. ([#15687](https://github.com/microsoft/FluidFramework/pull/15687)) [c0d2f364e8](https://github.com/microsoft/FluidFramework/commits/c0d2f364e830a7b62ec42999df8c45941f7f0a2c)
|
|
8
|
+
|
|
3
9
|
## 2.0.0-internal.4.1.0
|
|
4
10
|
|
|
5
11
|
Dependency updates only.
|
package/dist/blob.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { FileMode, IBlob, IAttachment, ITree, TreeEntry } from "@fluidframework/protocol-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* Basic implementation of a blob ITreeEntry
|
|
8
|
+
*/
|
|
9
|
+
export declare class BlobTreeEntry {
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly mode = FileMode.File;
|
|
12
|
+
readonly type = TreeEntry.Blob;
|
|
13
|
+
readonly value: IBlob;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a blob ITreeEntry
|
|
16
|
+
* @param path - path of entry
|
|
17
|
+
* @param contents - blob contents
|
|
18
|
+
* @param encoding - encoding of contents; defaults to utf-8
|
|
19
|
+
*/
|
|
20
|
+
constructor(path: string, contents: string, encoding?: "utf-8" | "base64");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Basic implementation of a tree ITreeEntry
|
|
24
|
+
*/
|
|
25
|
+
export declare class TreeTreeEntry {
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly value: ITree;
|
|
28
|
+
readonly mode = FileMode.Directory;
|
|
29
|
+
readonly type = TreeEntry.Tree;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a tree ITreeEntry
|
|
32
|
+
* @param path - path of entry
|
|
33
|
+
* @param value - subtree
|
|
34
|
+
*/
|
|
35
|
+
constructor(path: string, value: ITree);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Basic implementation of an attachment ITreeEntry
|
|
39
|
+
*/
|
|
40
|
+
export declare class AttachmentTreeEntry {
|
|
41
|
+
readonly path: string;
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly mode = FileMode.File;
|
|
44
|
+
readonly type = TreeEntry.Attachment;
|
|
45
|
+
readonly value: IAttachment;
|
|
46
|
+
/**
|
|
47
|
+
* Creates an attachment ITreeEntry
|
|
48
|
+
* @param path - path of entry
|
|
49
|
+
* @param id - id of external blob attachment
|
|
50
|
+
*/
|
|
51
|
+
constructor(path: string, id: string);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=blob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,SAAS,EACT,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,qBAAa,aAAa;aAYR,IAAI,EAAE,MAAM;IAX7B,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,IAAI,kBAAkB;IACtC,SAAgB,KAAK,EAAE,KAAK,CAAC;IAE7B;;;;;OAKG;gBAEc,IAAI,EAAE,MAAM,EAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,OAAO,GAAG,QAAkB;CAIvC;AAED;;GAEG;AACH,qBAAa,aAAa;aASG,IAAI,EAAE,MAAM;aAAkB,KAAK,EAAE,KAAK;IARtE,SAAgB,IAAI,sBAAsB;IAC1C,SAAgB,IAAI,kBAAkB;IAEtC;;;;OAIG;gBACyB,IAAI,EAAE,MAAM,EAAkB,KAAK,EAAE,KAAK;CACtE;AAED;;GAEG;AACH,qBAAa,mBAAmB;aAUH,IAAI,EAAE,MAAM;aAAkB,EAAE,EAAE,MAAM;IATpE,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,IAAI,wBAAwB;IAC5C,SAAgB,KAAK,EAAE,WAAW,CAAC;IAEnC;;;;OAIG;gBACyB,IAAI,EAAE,MAAM,EAAkB,EAAE,EAAE,MAAM;CAGpE"}
|
package/dist/blob.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
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.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = void 0;
|
|
8
|
+
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
9
|
+
/**
|
|
10
|
+
* Basic implementation of a blob ITreeEntry
|
|
11
|
+
*/
|
|
12
|
+
class BlobTreeEntry {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a blob ITreeEntry
|
|
15
|
+
* @param path - path of entry
|
|
16
|
+
* @param contents - blob contents
|
|
17
|
+
* @param encoding - encoding of contents; defaults to utf-8
|
|
18
|
+
*/
|
|
19
|
+
constructor(path, contents, encoding = "utf-8") {
|
|
20
|
+
this.path = path;
|
|
21
|
+
this.mode = protocol_definitions_1.FileMode.File;
|
|
22
|
+
this.type = protocol_definitions_1.TreeEntry.Blob;
|
|
23
|
+
this.value = { contents, encoding };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.BlobTreeEntry = BlobTreeEntry;
|
|
27
|
+
/**
|
|
28
|
+
* Basic implementation of a tree ITreeEntry
|
|
29
|
+
*/
|
|
30
|
+
class TreeTreeEntry {
|
|
31
|
+
/**
|
|
32
|
+
* Creates a tree ITreeEntry
|
|
33
|
+
* @param path - path of entry
|
|
34
|
+
* @param value - subtree
|
|
35
|
+
*/
|
|
36
|
+
constructor(path, value) {
|
|
37
|
+
this.path = path;
|
|
38
|
+
this.value = value;
|
|
39
|
+
this.mode = protocol_definitions_1.FileMode.Directory;
|
|
40
|
+
this.type = protocol_definitions_1.TreeEntry.Tree;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.TreeTreeEntry = TreeTreeEntry;
|
|
44
|
+
/**
|
|
45
|
+
* Basic implementation of an attachment ITreeEntry
|
|
46
|
+
*/
|
|
47
|
+
class AttachmentTreeEntry {
|
|
48
|
+
/**
|
|
49
|
+
* Creates an attachment ITreeEntry
|
|
50
|
+
* @param path - path of entry
|
|
51
|
+
* @param id - id of external blob attachment
|
|
52
|
+
*/
|
|
53
|
+
constructor(path, id) {
|
|
54
|
+
this.path = path;
|
|
55
|
+
this.id = id;
|
|
56
|
+
this.mode = protocol_definitions_1.FileMode.File;
|
|
57
|
+
this.type = protocol_definitions_1.TreeEntry.Attachment;
|
|
58
|
+
this.value = { id };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.AttachmentTreeEntry = AttachmentTreeEntry;
|
|
62
|
+
//# sourceMappingURL=blob.js.map
|
package/dist/blob.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob.js","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+EAM8C;AAE9C;;GAEG;AACH,MAAa,aAAa;IAKzB;;;;;OAKG;IACH,YACiB,IAAY,EAC5B,QAAgB,EAChB,WAA+B,OAAO;QAFtB,SAAI,GAAJ,IAAI,CAAQ;QAXb,SAAI,GAAG,+BAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,gCAAS,CAAC,IAAI,CAAC;QAcrC,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrC,CAAC;CACD;AAlBD,sCAkBC;AAED;;GAEG;AACH,MAAa,aAAa;IAIzB;;;;OAIG;IACH,YAA4B,IAAY,EAAkB,KAAY;QAA1C,SAAI,GAAJ,IAAI,CAAQ;QAAkB,UAAK,GAAL,KAAK,CAAO;QARtD,SAAI,GAAG,+BAAQ,CAAC,SAAS,CAAC;QAC1B,SAAI,GAAG,gCAAS,CAAC,IAAI,CAAC;IAOmC,CAAC;CAC1E;AAVD,sCAUC;AAED;;GAEG;AACH,MAAa,mBAAmB;IAK/B;;;;OAIG;IACH,YAA4B,IAAY,EAAkB,EAAU;QAAxC,SAAI,GAAJ,IAAI,CAAQ;QAAkB,OAAE,GAAF,EAAE,CAAQ;QATpD,SAAI,GAAG,+BAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,gCAAS,CAAC,UAAU,CAAC;QAS3C,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;IACrB,CAAC;CACD;AAbD,kDAaC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFileMode,\n\tIBlob,\n\tIAttachment,\n\tITree,\n\tTreeEntry,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Basic implementation of a blob ITreeEntry\n */\nexport class BlobTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Blob;\n\tpublic readonly value: IBlob;\n\n\t/**\n\t * Creates a blob ITreeEntry\n\t * @param path - path of entry\n\t * @param contents - blob contents\n\t * @param encoding - encoding of contents; defaults to utf-8\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tcontents: string,\n\t\tencoding: \"utf-8\" | \"base64\" = \"utf-8\",\n\t) {\n\t\tthis.value = { contents, encoding };\n\t}\n}\n\n/**\n * Basic implementation of a tree ITreeEntry\n */\nexport class TreeTreeEntry {\n\tpublic readonly mode = FileMode.Directory;\n\tpublic readonly type = TreeEntry.Tree;\n\n\t/**\n\t * Creates a tree ITreeEntry\n\t * @param path - path of entry\n\t * @param value - subtree\n\t */\n\tconstructor(public readonly path: string, public readonly value: ITree) {}\n}\n\n/**\n * Basic implementation of an attachment ITreeEntry\n */\nexport class AttachmentTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Attachment;\n\tpublic readonly value: IAttachment;\n\n\t/**\n\t * Creates an attachment ITreeEntry\n\t * @param path - path of entry\n\t * @param id - id of external blob attachment\n\t */\n\tconstructor(public readonly path: string, public readonly id: string) {\n\t\tthis.value = { id };\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { buildSnapshotTree } from "./buildSnapshotTree";
|
|
6
|
+
export { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from "./blob";
|
|
6
7
|
export { DocumentStorageServiceProxy } from "./documentStorageServiceProxy";
|
|
7
8
|
export { UsageError } from "./error";
|
|
8
9
|
export { ensureFluidResolvedUrl, isFluidResolvedUrl } from "./fluidResolvedUrl";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,mCAAmC,EACnC,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,QAAQ,EACR,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE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AiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EACN,4BAA4B,EAC5B,6BAA6B,EAC7B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.combineAppAndProtocolSummary = exports.runWithRetry = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.MessageType2 = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.isFluidResolvedUrl = exports.ensureFluidResolvedUrl = exports.UsageError = exports.DocumentStorageServiceProxy = exports.buildSnapshotTree = void 0;
|
|
7
|
+
exports.convertSummaryTreeToSnapshotITree = exports.isCombinedAppAndProtocolSummary = exports.getQuorumValuesFromProtocolSummary = exports.getDocAttributesFromProtocolSummary = exports.combineAppAndProtocolSummary = exports.runWithRetry = exports.readAndParse = exports.RateLimiter = exports.PrefetchDocumentStorageService = exports.streamObserver = exports.streamFromMessages = exports.requestOps = exports.Queue = exports.ParallelRequests = exports.emptyMessageStream = exports.logNetworkFailure = exports.ThrottlingError = exports.RetryableError = exports.OnlineStatus = exports.NonRetryableError = exports.NetworkErrorBasic = exports.LocationRedirectionError = exports.isOnline = exports.getRetryDelaySecondsFromError = exports.getRetryDelayFromError = exports.GenericNetworkError = exports.FluidInvalidSchemaError = exports.DeltaStreamConnectionForbiddenError = exports.createWriteError = exports.createGenericNetworkError = exports.canRetryOnError = exports.AuthorizationError = exports.MessageType2 = exports.isRuntimeMessage = exports.canBeCoalescedByService = exports.InsecureUrlResolver = exports.isFluidResolvedUrl = exports.ensureFluidResolvedUrl = exports.UsageError = exports.DocumentStorageServiceProxy = exports.AttachmentTreeEntry = exports.TreeTreeEntry = exports.BlobTreeEntry = exports.buildSnapshotTree = void 0;
|
|
8
8
|
var buildSnapshotTree_1 = require("./buildSnapshotTree");
|
|
9
9
|
Object.defineProperty(exports, "buildSnapshotTree", { enumerable: true, get: function () { return buildSnapshotTree_1.buildSnapshotTree; } });
|
|
10
|
+
var blob_1 = require("./blob");
|
|
11
|
+
Object.defineProperty(exports, "BlobTreeEntry", { enumerable: true, get: function () { return blob_1.BlobTreeEntry; } });
|
|
12
|
+
Object.defineProperty(exports, "TreeTreeEntry", { enumerable: true, get: function () { return blob_1.TreeTreeEntry; } });
|
|
13
|
+
Object.defineProperty(exports, "AttachmentTreeEntry", { enumerable: true, get: function () { return blob_1.AttachmentTreeEntry; } });
|
|
10
14
|
var documentStorageServiceProxy_1 = require("./documentStorageServiceProxy");
|
|
11
15
|
Object.defineProperty(exports, "DocumentStorageServiceProxy", { enumerable: true, get: function () { return documentStorageServiceProxy_1.DocumentStorageServiceProxy; } });
|
|
12
16
|
var error_1 = require("./error");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AACnB,uDAAgF;AAAvE,0HAAA,sBAAsB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AACnD,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2DAA+F;AAAtF,6HAAA,uBAAuB,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAAE,kHAAA,YAAY,OAAA;AAChE,qCAkBmB;AAjBlB,6GAAA,kBAAkB,OAAA;AAClB,0GAAA,eAAe,OAAA;AACf,oHAAA,yBAAyB,OAAA;AACzB,2GAAA,gBAAgB,OAAA;AAChB,8HAAA,mCAAmC,OAAA;AAEnC,kHAAA,uBAAuB,OAAA;AACvB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,wHAAA,6BAA6B,OAAA;AAC7B,mGAAA,QAAQ,OAAA;AACR,mHAAA,wBAAwB,OAAA;AACxB,4GAAA,iBAAiB,OAAA;AACjB,4GAAA,iBAAiB,OAAA;AACjB,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AAEhB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,uDAO4B;AAN3B,sHAAA,kBAAkB,OAAA;AAClB,oHAAA,gBAAgB,OAAA;AAChB,yGAAA,KAAK,OAAA;AACL,8GAAA,UAAU,OAAA;AACV,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AAEf,mFAAkF;AAAzE,gJAAA,8BAA8B,OAAA;AACvC,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+CAAyD;AAArC,4GAAA,YAAY,OAAA;AAChC,6DAM+B;AAL9B,mIAAA,4BAA4B,OAAA;AAE5B,0IAAA,mCAAmC,OAAA;AACnC,yIAAA,kCAAkC,OAAA;AAClC,sIAAA,+BAA+B,OAAA;AAEhC,qDAAsE;AAA7D,oIAAA,iCAAiC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy\";\nexport { UsageError } from \"./error\";\nexport { ensureFluidResolvedUrl, isFluidResolvedUrl } from \"./fluidResolvedUrl\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver\";\nexport { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from \"./messageRecognition\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network\";\nexport { logNetworkFailure } from \"./networkUtils\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService\";\nexport { RateLimiter } from \"./rateLimiter\";\nexport { readAndParse } from \"./readAndParse\";\nexport { IProgress, runWithRetry } from \"./runWithRetry\";\nexport {\n\tcombineAppAndProtocolSummary,\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,+BAA2E;AAAlE,qGAAA,aAAa,OAAA;AAAE,qGAAA,aAAa,OAAA;AAAE,2GAAA,mBAAmB,OAAA;AAC1D,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AACnB,uDAAgF;AAAvE,0HAAA,sBAAsB,OAAA;AAAE,sHAAA,kBAAkB,OAAA;AACnD,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2DAA+F;AAAtF,6HAAA,uBAAuB,OAAA;AAAE,sHAAA,gBAAgB,OAAA;AAAE,kHAAA,YAAY,OAAA;AAChE,qCAkBmB;AAjBlB,6GAAA,kBAAkB,OAAA;AAClB,0GAAA,eAAe,OAAA;AACf,oHAAA,yBAAyB,OAAA;AACzB,2GAAA,gBAAgB,OAAA;AAChB,8HAAA,mCAAmC,OAAA;AAEnC,kHAAA,uBAAuB,OAAA;AACvB,8GAAA,mBAAmB,OAAA;AACnB,iHAAA,sBAAsB,OAAA;AACtB,wHAAA,6BAA6B,OAAA;AAC7B,mGAAA,QAAQ,OAAA;AACR,mHAAA,wBAAwB,OAAA;AACxB,4GAAA,iBAAiB,OAAA;AACjB,4GAAA,iBAAiB,OAAA;AACjB,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AACd,0GAAA,eAAe,OAAA;AAEhB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,uDAO4B;AAN3B,sHAAA,kBAAkB,OAAA;AAClB,oHAAA,gBAAgB,OAAA;AAChB,yGAAA,KAAK,OAAA;AACL,8GAAA,UAAU,OAAA;AACV,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AAEf,mFAAkF;AAAzE,gJAAA,8BAA8B,OAAA;AACvC,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+CAAyD;AAArC,4GAAA,YAAY,OAAA;AAChC,6DAM+B;AAL9B,mIAAA,4BAA4B,OAAA;AAE5B,0IAAA,mCAAmC,OAAA;AACnC,yIAAA,kCAAkC,OAAA;AAClC,sIAAA,+BAA+B,OAAA;AAEhC,qDAAsE;AAA7D,oIAAA,iCAAiC,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree\";\nexport { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from \"./blob\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy\";\nexport { UsageError } from \"./error\";\nexport { ensureFluidResolvedUrl, isFluidResolvedUrl } from \"./fluidResolvedUrl\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver\";\nexport { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from \"./messageRecognition\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network\";\nexport { logNetworkFailure } from \"./networkUtils\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService\";\nexport { RateLimiter } from \"./rateLimiter\";\nexport { readAndParse } from \"./readAndParse\";\nexport { IProgress, runWithRetry } from \"./runWithRetry\";\nexport {\n\tcombineAppAndProtocolSummary,\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions\";\n"]}
|
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/driver-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.4.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.4.4.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
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/driver-utils";
|
|
11
|
-
exports.pkgVersion = "2.0.0-internal.4.
|
|
11
|
+
exports.pkgVersion = "2.0.0-internal.4.4.1";
|
|
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,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,sBAAsB,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/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.4.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,sBAAsB,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/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.4.4.1\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeConversions.d.ts","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"treeConversions.d.ts","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,KAAK,EAA2B,MAAM,sCAAsC,CAAC;AAIpG;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,YAAY,GAAG,KAAK,CAgDlF"}
|
package/dist/treeConversions.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.convertSummaryTreeToSnapshotITree = void 0;
|
|
8
8
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
9
|
-
const protocol_base_1 = require("@fluidframework/protocol-base");
|
|
10
9
|
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
10
|
+
const blob_1 = require("./blob");
|
|
11
11
|
const summaryForCreateNew_1 = require("./summaryForCreateNew");
|
|
12
12
|
/**
|
|
13
13
|
* Converts ISummaryTree to ITree format.
|
|
@@ -35,15 +35,15 @@ function convertSummaryTreeToSnapshotITree(summaryTree) {
|
|
|
35
35
|
parsedContent = (0, common_utils_1.Uint8ArrayToString)(value.content, "base64");
|
|
36
36
|
encoding = "base64";
|
|
37
37
|
}
|
|
38
|
-
entries.push(new
|
|
38
|
+
entries.push(new blob_1.BlobTreeEntry(k, parsedContent, encoding));
|
|
39
39
|
break;
|
|
40
40
|
}
|
|
41
41
|
case protocol_definitions_1.SummaryType.Tree: {
|
|
42
|
-
entries.push(new
|
|
42
|
+
entries.push(new blob_1.TreeTreeEntry(k, convertSummaryTreeToSnapshotITree(value)));
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
case protocol_definitions_1.SummaryType.Attachment: {
|
|
46
|
-
entries.push(new
|
|
46
|
+
entries.push(new blob_1.AttachmentTreeEntry(k, value.id));
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
case protocol_definitions_1.SummaryType.Handle: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeConversions.js","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAmF;AACnF
|
|
1
|
+
{"version":3,"file":"treeConversions.js","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAmF;AACnF,+EAAoG;AACpG,iCAA2E;AAC3E,+DAAwE;AAExE;;;GAGG;AACH,SAAgB,iCAAiC,CAAC,WAAyB;IAC1E,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,IAAA,qDAA+B,E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gBAC5B,OAAO,CAAC,IAAI,CAAC,IAAI,0BAAmB,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;gBACnD,MAAM;aACN;YAED,KAAK,kCAAW,CAAC,MAAM,CAAC,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;aAC/D;YAED;gBACC,IAAA,8BAAe,EAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC;SACxD;KACD;IACD,OAAO;QACN,OAAO;QACP,YAAY,EAAE,WAAW,CAAC,YAAY;KACtC,CAAC;AACH,CAAC;AAhDD,8EAgDC","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 { ISummaryTree, ITree, ITreeEntry, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from \"./blob\";\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/lib/blob.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { FileMode, IBlob, IAttachment, ITree, TreeEntry } from "@fluidframework/protocol-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* Basic implementation of a blob ITreeEntry
|
|
8
|
+
*/
|
|
9
|
+
export declare class BlobTreeEntry {
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly mode = FileMode.File;
|
|
12
|
+
readonly type = TreeEntry.Blob;
|
|
13
|
+
readonly value: IBlob;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a blob ITreeEntry
|
|
16
|
+
* @param path - path of entry
|
|
17
|
+
* @param contents - blob contents
|
|
18
|
+
* @param encoding - encoding of contents; defaults to utf-8
|
|
19
|
+
*/
|
|
20
|
+
constructor(path: string, contents: string, encoding?: "utf-8" | "base64");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Basic implementation of a tree ITreeEntry
|
|
24
|
+
*/
|
|
25
|
+
export declare class TreeTreeEntry {
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly value: ITree;
|
|
28
|
+
readonly mode = FileMode.Directory;
|
|
29
|
+
readonly type = TreeEntry.Tree;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a tree ITreeEntry
|
|
32
|
+
* @param path - path of entry
|
|
33
|
+
* @param value - subtree
|
|
34
|
+
*/
|
|
35
|
+
constructor(path: string, value: ITree);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Basic implementation of an attachment ITreeEntry
|
|
39
|
+
*/
|
|
40
|
+
export declare class AttachmentTreeEntry {
|
|
41
|
+
readonly path: string;
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly mode = FileMode.File;
|
|
44
|
+
readonly type = TreeEntry.Attachment;
|
|
45
|
+
readonly value: IAttachment;
|
|
46
|
+
/**
|
|
47
|
+
* Creates an attachment ITreeEntry
|
|
48
|
+
* @param path - path of entry
|
|
49
|
+
* @param id - id of external blob attachment
|
|
50
|
+
*/
|
|
51
|
+
constructor(path: string, id: string);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=blob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,SAAS,EACT,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,qBAAa,aAAa;aAYR,IAAI,EAAE,MAAM;IAX7B,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,IAAI,kBAAkB;IACtC,SAAgB,KAAK,EAAE,KAAK,CAAC;IAE7B;;;;;OAKG;gBAEc,IAAI,EAAE,MAAM,EAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,OAAO,GAAG,QAAkB;CAIvC;AAED;;GAEG;AACH,qBAAa,aAAa;aASG,IAAI,EAAE,MAAM;aAAkB,KAAK,EAAE,KAAK;IARtE,SAAgB,IAAI,sBAAsB;IAC1C,SAAgB,IAAI,kBAAkB;IAEtC;;;;OAIG;gBACyB,IAAI,EAAE,MAAM,EAAkB,KAAK,EAAE,KAAK;CACtE;AAED;;GAEG;AACH,qBAAa,mBAAmB;aAUH,IAAI,EAAE,MAAM;aAAkB,EAAE,EAAE,MAAM;IATpE,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,IAAI,wBAAwB;IAC5C,SAAgB,KAAK,EAAE,WAAW,CAAC;IAEnC;;;;OAIG;gBACyB,IAAI,EAAE,MAAM,EAAkB,EAAE,EAAE,MAAM;CAGpE"}
|
package/lib/blob.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { FileMode, TreeEntry, } from "@fluidframework/protocol-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* Basic implementation of a blob ITreeEntry
|
|
8
|
+
*/
|
|
9
|
+
export class BlobTreeEntry {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a blob ITreeEntry
|
|
12
|
+
* @param path - path of entry
|
|
13
|
+
* @param contents - blob contents
|
|
14
|
+
* @param encoding - encoding of contents; defaults to utf-8
|
|
15
|
+
*/
|
|
16
|
+
constructor(path, contents, encoding = "utf-8") {
|
|
17
|
+
this.path = path;
|
|
18
|
+
this.mode = FileMode.File;
|
|
19
|
+
this.type = TreeEntry.Blob;
|
|
20
|
+
this.value = { contents, encoding };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Basic implementation of a tree ITreeEntry
|
|
25
|
+
*/
|
|
26
|
+
export class TreeTreeEntry {
|
|
27
|
+
/**
|
|
28
|
+
* Creates a tree ITreeEntry
|
|
29
|
+
* @param path - path of entry
|
|
30
|
+
* @param value - subtree
|
|
31
|
+
*/
|
|
32
|
+
constructor(path, value) {
|
|
33
|
+
this.path = path;
|
|
34
|
+
this.value = value;
|
|
35
|
+
this.mode = FileMode.Directory;
|
|
36
|
+
this.type = TreeEntry.Tree;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Basic implementation of an attachment ITreeEntry
|
|
41
|
+
*/
|
|
42
|
+
export class AttachmentTreeEntry {
|
|
43
|
+
/**
|
|
44
|
+
* Creates an attachment ITreeEntry
|
|
45
|
+
* @param path - path of entry
|
|
46
|
+
* @param id - id of external blob attachment
|
|
47
|
+
*/
|
|
48
|
+
constructor(path, id) {
|
|
49
|
+
this.path = path;
|
|
50
|
+
this.id = id;
|
|
51
|
+
this.mode = FileMode.File;
|
|
52
|
+
this.type = TreeEntry.Attachment;
|
|
53
|
+
this.value = { id };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=blob.js.map
|
package/lib/blob.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob.js","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EAIR,SAAS,GACT,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAO,aAAa;IAKzB;;;;;OAKG;IACH,YACiB,IAAY,EAC5B,QAAgB,EAChB,WAA+B,OAAO;QAFtB,SAAI,GAAJ,IAAI,CAAQ;QAXb,SAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,SAAS,CAAC,IAAI,CAAC;QAcrC,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrC,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,aAAa;IAIzB;;;;OAIG;IACH,YAA4B,IAAY,EAAkB,KAAY;QAA1C,SAAI,GAAJ,IAAI,CAAQ;QAAkB,UAAK,GAAL,KAAK,CAAO;QARtD,SAAI,GAAG,QAAQ,CAAC,SAAS,CAAC;QAC1B,SAAI,GAAG,SAAS,CAAC,IAAI,CAAC;IAOmC,CAAC;CAC1E;AAED;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAK/B;;;;OAIG;IACH,YAA4B,IAAY,EAAkB,EAAU;QAAxC,SAAI,GAAJ,IAAI,CAAQ;QAAkB,OAAE,GAAF,EAAE,CAAQ;QATpD,SAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QACrB,SAAI,GAAG,SAAS,CAAC,UAAU,CAAC;QAS3C,IAAI,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;IACrB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFileMode,\n\tIBlob,\n\tIAttachment,\n\tITree,\n\tTreeEntry,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Basic implementation of a blob ITreeEntry\n */\nexport class BlobTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Blob;\n\tpublic readonly value: IBlob;\n\n\t/**\n\t * Creates a blob ITreeEntry\n\t * @param path - path of entry\n\t * @param contents - blob contents\n\t * @param encoding - encoding of contents; defaults to utf-8\n\t */\n\tconstructor(\n\t\tpublic readonly path: string,\n\t\tcontents: string,\n\t\tencoding: \"utf-8\" | \"base64\" = \"utf-8\",\n\t) {\n\t\tthis.value = { contents, encoding };\n\t}\n}\n\n/**\n * Basic implementation of a tree ITreeEntry\n */\nexport class TreeTreeEntry {\n\tpublic readonly mode = FileMode.Directory;\n\tpublic readonly type = TreeEntry.Tree;\n\n\t/**\n\t * Creates a tree ITreeEntry\n\t * @param path - path of entry\n\t * @param value - subtree\n\t */\n\tconstructor(public readonly path: string, public readonly value: ITree) {}\n}\n\n/**\n * Basic implementation of an attachment ITreeEntry\n */\nexport class AttachmentTreeEntry {\n\tpublic readonly mode = FileMode.File;\n\tpublic readonly type = TreeEntry.Attachment;\n\tpublic readonly value: IAttachment;\n\n\t/**\n\t * Creates an attachment ITreeEntry\n\t * @param path - path of entry\n\t * @param id - id of external blob attachment\n\t */\n\tconstructor(public readonly path: string, public readonly id: string) {\n\t\tthis.value = { id };\n\t}\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { buildSnapshotTree } from "./buildSnapshotTree";
|
|
6
|
+
export { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from "./blob";
|
|
6
7
|
export { DocumentStorageServiceProxy } from "./documentStorageServiceProxy";
|
|
7
8
|
export { UsageError } from "./error";
|
|
8
9
|
export { ensureFluidResolvedUrl, isFluidResolvedUrl } from "./fluidResolvedUrl";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,mCAAmC,EACnC,yBAAyB,EACzB,uB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AAC;AAC/F,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,mCAAmC,EACnC,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,QAAQ,EACR,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EACN,4BAA4B,EAC5B,6BAA6B,EAC7B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { buildSnapshotTree } from "./buildSnapshotTree";
|
|
6
|
+
export { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from "./blob";
|
|
6
7
|
export { DocumentStorageServiceProxy } from "./documentStorageServiceProxy";
|
|
7
8
|
export { UsageError } from "./error";
|
|
8
9
|
export { ensureFluidResolvedUrl, isFluidResolvedUrl } from "./fluidResolvedUrl";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,mCAAmC,EAEnC,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,QAAQ,EACR,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAa,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EACN,4BAA4B,EAE5B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy\";\nexport { UsageError } from \"./error\";\nexport { ensureFluidResolvedUrl, isFluidResolvedUrl } from \"./fluidResolvedUrl\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver\";\nexport { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from \"./messageRecognition\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network\";\nexport { logNetworkFailure } from \"./networkUtils\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService\";\nexport { RateLimiter } from \"./rateLimiter\";\nexport { readAndParse } from \"./readAndParse\";\nexport { IProgress, runWithRetry } from \"./runWithRetry\";\nexport {\n\tcombineAppAndProtocolSummary,\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,mCAAmC,EAEnC,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,QAAQ,EACR,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAa,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EACN,4BAA4B,EAE5B,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { buildSnapshotTree } from \"./buildSnapshotTree\";\nexport { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from \"./blob\";\nexport { DocumentStorageServiceProxy } from \"./documentStorageServiceProxy\";\nexport { UsageError } from \"./error\";\nexport { ensureFluidResolvedUrl, isFluidResolvedUrl } from \"./fluidResolvedUrl\";\nexport { InsecureUrlResolver } from \"./insecureUrlResolver\";\nexport { canBeCoalescedByService, isRuntimeMessage, MessageType2 } from \"./messageRecognition\";\nexport {\n\tAuthorizationError,\n\tcanRetryOnError,\n\tcreateGenericNetworkError,\n\tcreateWriteError,\n\tDeltaStreamConnectionForbiddenError,\n\tDriverErrorTelemetryProps,\n\tFluidInvalidSchemaError,\n\tGenericNetworkError,\n\tgetRetryDelayFromError,\n\tgetRetryDelaySecondsFromError,\n\tisOnline,\n\tLocationRedirectionError,\n\tNetworkErrorBasic,\n\tNonRetryableError,\n\tOnlineStatus,\n\tRetryableError,\n\tThrottlingError,\n} from \"./network\";\nexport { logNetworkFailure } from \"./networkUtils\";\nexport {\n\temptyMessageStream,\n\tParallelRequests,\n\tQueue,\n\trequestOps,\n\tstreamFromMessages,\n\tstreamObserver,\n} from \"./parallelRequests\";\nexport { PrefetchDocumentStorageService } from \"./prefetchDocumentStorageService\";\nexport { RateLimiter } from \"./rateLimiter\";\nexport { readAndParse } from \"./readAndParse\";\nexport { IProgress, runWithRetry } from \"./runWithRetry\";\nexport {\n\tcombineAppAndProtocolSummary,\n\tCombinedAppAndProtocolSummary,\n\tgetDocAttributesFromProtocolSummary,\n\tgetQuorumValuesFromProtocolSummary,\n\tisCombinedAppAndProtocolSummary,\n} from \"./summaryForCreateNew\";\nexport { convertSummaryTreeToSnapshotITree } from \"./treeConversions\";\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/driver-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.4.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.4.4.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/driver-utils";
|
|
8
|
-
export const pkgVersion = "2.0.0-internal.4.
|
|
8
|
+
export const pkgVersion = "2.0.0-internal.4.4.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,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/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.4.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,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/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.4.4.1\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeConversions.d.ts","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"treeConversions.d.ts","sourceRoot":"","sources":["../src/treeConversions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,KAAK,EAA2B,MAAM,sCAAsC,CAAC;AAIpG;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,YAAY,GAAG,KAAK,CAgDlF"}
|
package/lib/treeConversions.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { Uint8ArrayToString, unreachableCase } from "@fluidframework/common-utils";
|
|
6
|
-
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "@fluidframework/protocol-base";
|
|
7
6
|
import { SummaryType } from "@fluidframework/protocol-definitions";
|
|
7
|
+
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "./blob";
|
|
8
8
|
import { isCombinedAppAndProtocolSummary } from "./summaryForCreateNew";
|
|
9
9
|
/**
|
|
10
10
|
* Converts ISummaryTree to ITree format.
|
|
@@ -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,
|
|
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,EAAmC,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,QAAQ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AAC,CAAC;gBACtB,OAAO,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,CAAC,EAAE,iCAAiC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC7E,MAAM;aACN;YAED,KAAK,WAAW,CAAC,UAAU,CAAC,CAAC;gBAC5B,OAAO,CAAC,IAAI,CAAC,IAAI,mBAAmB,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;gBACnD,MAAM;aACN;YAED,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC;gBACxB,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 { ISummaryTree, ITree, ITreeEntry, SummaryType } from \"@fluidframework/protocol-definitions\";\nimport { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from \"./blob\";\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-internal.4.
|
|
3
|
+
"version": "2.0.0-internal.4.4.1",
|
|
4
4
|
"description": "Collection of utility functions for Fluid drivers",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
39
39
|
"@fluidframework/common-utils": "^1.1.1",
|
|
40
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.4.
|
|
41
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.4.
|
|
40
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.4.4.1 <2.0.0-internal.4.5.0",
|
|
41
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.4.4.1 <2.0.0-internal.4.5.0",
|
|
42
42
|
"@fluidframework/gitresources": "^0.1039.1000",
|
|
43
43
|
"@fluidframework/protocol-base": "^0.1039.1000",
|
|
44
44
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
45
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-internal.4.
|
|
45
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-internal.4.4.1 <2.0.0-internal.4.5.0",
|
|
46
46
|
"axios": "^0.26.0",
|
|
47
47
|
"url": "^0.11.0",
|
|
48
48
|
"uuid": "^8.3.1"
|
|
@@ -53,8 +53,7 @@
|
|
|
53
53
|
"@fluidframework/build-tools": "^0.18.2",
|
|
54
54
|
"@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.0.0-internal.4.1.0",
|
|
55
55
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
56
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.4.
|
|
57
|
-
"@fluidframework/runtime-utils": ">=2.0.0-internal.4.3.1 <2.0.0-internal.4.4.0",
|
|
56
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.4.4.1 <2.0.0-internal.4.5.0",
|
|
58
57
|
"@microsoft/api-extractor": "^7.34.4",
|
|
59
58
|
"@types/mocha": "^9.1.1",
|
|
60
59
|
"@types/node": "^14.18.38",
|
package/src/blob.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
FileMode,
|
|
8
|
+
IBlob,
|
|
9
|
+
IAttachment,
|
|
10
|
+
ITree,
|
|
11
|
+
TreeEntry,
|
|
12
|
+
} from "@fluidframework/protocol-definitions";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Basic implementation of a blob ITreeEntry
|
|
16
|
+
*/
|
|
17
|
+
export class BlobTreeEntry {
|
|
18
|
+
public readonly mode = FileMode.File;
|
|
19
|
+
public readonly type = TreeEntry.Blob;
|
|
20
|
+
public readonly value: IBlob;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Creates a blob ITreeEntry
|
|
24
|
+
* @param path - path of entry
|
|
25
|
+
* @param contents - blob contents
|
|
26
|
+
* @param encoding - encoding of contents; defaults to utf-8
|
|
27
|
+
*/
|
|
28
|
+
constructor(
|
|
29
|
+
public readonly path: string,
|
|
30
|
+
contents: string,
|
|
31
|
+
encoding: "utf-8" | "base64" = "utf-8",
|
|
32
|
+
) {
|
|
33
|
+
this.value = { contents, encoding };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Basic implementation of a tree ITreeEntry
|
|
39
|
+
*/
|
|
40
|
+
export class TreeTreeEntry {
|
|
41
|
+
public readonly mode = FileMode.Directory;
|
|
42
|
+
public readonly type = TreeEntry.Tree;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Creates a tree ITreeEntry
|
|
46
|
+
* @param path - path of entry
|
|
47
|
+
* @param value - subtree
|
|
48
|
+
*/
|
|
49
|
+
constructor(public readonly path: string, public readonly value: ITree) {}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Basic implementation of an attachment ITreeEntry
|
|
54
|
+
*/
|
|
55
|
+
export class AttachmentTreeEntry {
|
|
56
|
+
public readonly mode = FileMode.File;
|
|
57
|
+
public readonly type = TreeEntry.Attachment;
|
|
58
|
+
public readonly value: IAttachment;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Creates an attachment ITreeEntry
|
|
62
|
+
* @param path - path of entry
|
|
63
|
+
* @param id - id of external blob attachment
|
|
64
|
+
*/
|
|
65
|
+
constructor(public readonly path: string, public readonly id: string) {
|
|
66
|
+
this.value = { id };
|
|
67
|
+
}
|
|
68
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export { buildSnapshotTree } from "./buildSnapshotTree";
|
|
7
|
+
export { BlobTreeEntry, TreeTreeEntry, AttachmentTreeEntry } from "./blob";
|
|
7
8
|
export { DocumentStorageServiceProxy } from "./documentStorageServiceProxy";
|
|
8
9
|
export { UsageError } from "./error";
|
|
9
10
|
export { ensureFluidResolvedUrl, isFluidResolvedUrl } from "./fluidResolvedUrl";
|
package/src/packageVersion.ts
CHANGED
package/src/treeConversions.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { Uint8ArrayToString, unreachableCase } from "@fluidframework/common-utils";
|
|
7
|
-
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "@fluidframework/protocol-base";
|
|
8
7
|
import { ISummaryTree, ITree, ITreeEntry, SummaryType } from "@fluidframework/protocol-definitions";
|
|
8
|
+
import { AttachmentTreeEntry, BlobTreeEntry, TreeTreeEntry } from "./blob";
|
|
9
9
|
import { isCombinedAppAndProtocolSummary } from "./summaryForCreateNew";
|
|
10
10
|
|
|
11
11
|
/**
|