@fluidframework/driver-utils 2.0.0-dev.3.1.0.125672 → 2.0.0-dev.4.2.0.153917
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 +5 -0
- package/README.md +68 -1
- 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 +45 -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 +27 -5
- 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 +46 -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 +25 -4
- 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 +54 -19
- package/src/summaryForCreateNew.ts +49 -5
- 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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emptyDocumentDeltaStorageService.js","sourceRoot":"","sources":["../src/emptyDocumentDeltaStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,yDAA2C;AAE3C;;GAEG;AACH,MAAa,gCAAgC;IACrC,aAAa,CACnB,IAAY,EACZ,GAAuB,EACvB,YAA0B,EAC1B,WAAqB,EACrB,YAAqB;QAErB,MAAM,KAAK,GAAG,IAAI,wBAAK,EAA+B,CAAC;QACvD,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AAZD,4EAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentDeltaStorageService, IStream } from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { Queue } from \"./parallelRequests\";\n\n/**\n * Implementation of IDocumentDeltaStorageService that will always return an empty message queue when fetching messages\n */\nexport class EmptyDocumentDeltaStorageService implements IDocumentDeltaStorageService {\n\tpublic fetchMessages(\n\t\tfrom: number,\n\t\t_to: number | undefined,\n\t\t_abortSignal?: AbortSignal,\n\t\t_cachedOnly?: boolean,\n\t\t_fetchReason?: string,\n\t): IStream<ISequencedDocumentMessage[]> {\n\t\tconst queue = new Queue<ISequencedDocumentMessage[]>();\n\t\tqueue.pushDone();\n\t\treturn queue;\n\t}\n}\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* An extension of Map that expires (deletes) entries after a period of inactivity.
|
|
7
|
-
* The policy is based on the last time a key was written to.
|
|
8
|
-
*/
|
|
9
|
-
export declare class MapWithExpiration<TKey = any, TValue = any> extends Map<TKey, TValue> {
|
|
10
|
-
private readonly expiryMs;
|
|
11
|
-
/** Timestamps (as epoch ms numbers) of when each key was last refreshed */
|
|
12
|
-
private readonly lastRefreshedTimes;
|
|
13
|
-
constructor(expiryMs: number);
|
|
14
|
-
private refresh;
|
|
15
|
-
/**
|
|
16
|
-
* Returns true if the key is present and expired, false if it's not expired, and undefined if it's not found
|
|
17
|
-
* If cleanUp is passed as true, then delete any expired entry before returning.
|
|
18
|
-
*/
|
|
19
|
-
private checkExpiry;
|
|
20
|
-
private clearExpiredEntries;
|
|
21
|
-
get size(): number;
|
|
22
|
-
has(key: TKey): boolean;
|
|
23
|
-
get(key: TKey): TValue | undefined;
|
|
24
|
-
set(key: TKey, value: TValue): this;
|
|
25
|
-
delete(key: TKey): boolean;
|
|
26
|
-
clear(): void;
|
|
27
|
-
forEach(callbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void, thisArg?: any): void;
|
|
28
|
-
entries(): IterableIterator<[TKey, TValue]>;
|
|
29
|
-
keys(): IterableIterator<TKey>;
|
|
30
|
-
values(): IterableIterator<TValue>;
|
|
31
|
-
[Symbol.iterator](): IterableIterator<[TKey, TValue]>;
|
|
32
|
-
valueOf(): Object;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=mapWithExpiration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapWithExpiration.d.ts","sourceRoot":"","sources":["../src/mapWith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c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.MapWithExpiration = void 0;
|
|
8
|
-
const common_utils_1 = require("@fluidframework/common-utils");
|
|
9
|
-
/**
|
|
10
|
-
* An extension of Map that expires (deletes) entries after a period of inactivity.
|
|
11
|
-
* The policy is based on the last time a key was written to.
|
|
12
|
-
*/
|
|
13
|
-
class MapWithExpiration extends Map {
|
|
14
|
-
constructor(expiryMs) {
|
|
15
|
-
super();
|
|
16
|
-
this.expiryMs = expiryMs;
|
|
17
|
-
/** Timestamps (as epoch ms numbers) of when each key was last refreshed */
|
|
18
|
-
this.lastRefreshedTimes = new Map();
|
|
19
|
-
}
|
|
20
|
-
refresh(key) {
|
|
21
|
-
this.lastRefreshedTimes.set(key, new Date().valueOf());
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Returns true if the key is present and expired, false if it's not expired, and undefined if it's not found
|
|
25
|
-
* If cleanUp is passed as true, then delete any expired entry before returning.
|
|
26
|
-
*/
|
|
27
|
-
checkExpiry(key, cleanUp = false) {
|
|
28
|
-
const refreshTime = this.lastRefreshedTimes.get(key);
|
|
29
|
-
(0, common_utils_1.assert)((refreshTime !== undefined) === super.has(key), 0x50c /* freshness map out of sync */);
|
|
30
|
-
if (refreshTime === undefined) {
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
const expired = new Date().valueOf() - refreshTime >= this.expiryMs;
|
|
34
|
-
if (expired && cleanUp) {
|
|
35
|
-
this.delete(key);
|
|
36
|
-
}
|
|
37
|
-
return expired;
|
|
38
|
-
}
|
|
39
|
-
clearExpiredEntries() {
|
|
40
|
-
// forEach clears out any expired entries
|
|
41
|
-
this.forEach(() => { });
|
|
42
|
-
}
|
|
43
|
-
get size() {
|
|
44
|
-
this.clearExpiredEntries();
|
|
45
|
-
return super.size;
|
|
46
|
-
}
|
|
47
|
-
has(key) {
|
|
48
|
-
this.checkExpiry(key, true /* cleanUp */);
|
|
49
|
-
return super.has(key);
|
|
50
|
-
}
|
|
51
|
-
get(key) {
|
|
52
|
-
this.checkExpiry(key, true /* cleanUp */);
|
|
53
|
-
return super.get(key);
|
|
54
|
-
}
|
|
55
|
-
set(key, value) {
|
|
56
|
-
// Sliding window expiration policy (on write)
|
|
57
|
-
this.refresh(key);
|
|
58
|
-
return super.set(key, value);
|
|
59
|
-
}
|
|
60
|
-
delete(key) {
|
|
61
|
-
this.lastRefreshedTimes.delete(key);
|
|
62
|
-
return super.delete(key);
|
|
63
|
-
}
|
|
64
|
-
clear() {
|
|
65
|
-
this.lastRefreshedTimes.clear();
|
|
66
|
-
super.clear();
|
|
67
|
-
}
|
|
68
|
-
forEach(callbackfn, thisArg) {
|
|
69
|
-
const expiredKeys = [];
|
|
70
|
-
super.forEach((v, k, m) => {
|
|
71
|
-
if (this.checkExpiry(k) === true) {
|
|
72
|
-
expiredKeys.push(k);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
callbackfn.bind(thisArg)(v, k, m);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
// Clean up keys we know are expired now that we're done iterating
|
|
79
|
-
expiredKeys.forEach((key) => {
|
|
80
|
-
this.delete(key);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
entries() {
|
|
84
|
-
this.clearExpiredEntries();
|
|
85
|
-
return super.entries();
|
|
86
|
-
}
|
|
87
|
-
keys() {
|
|
88
|
-
this.clearExpiredEntries();
|
|
89
|
-
return super.keys();
|
|
90
|
-
}
|
|
91
|
-
values() {
|
|
92
|
-
this.clearExpiredEntries();
|
|
93
|
-
return super.values();
|
|
94
|
-
}
|
|
95
|
-
[Symbol.iterator]() {
|
|
96
|
-
this.clearExpiredEntries();
|
|
97
|
-
return super[Symbol.iterator]();
|
|
98
|
-
}
|
|
99
|
-
valueOf() {
|
|
100
|
-
this.clearExpiredEntries();
|
|
101
|
-
return super.valueOf();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.MapWithExpiration = MapWithExpiration;
|
|
105
|
-
//# sourceMappingURL=mapWithExpiration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapWithExpiration.js","sourceRoot":"","sources":["../src/mapWithExpiration.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAEtD;;;GAGG;AACH,MAAa,iBAA4C,SAAQ,GAAiB;IAIjF,YAA6B,QAAgB;QAC5C,KAAK,EAAE,CAAC;QADoB,aAAQ,GAAR,QAAQ,CAAQ;QAH7C,2EAA2E;QAC1D,uBAAkB,GAAG,IAAI,GAAG,EAAgB,CAAC;IAI9D,CAAC;IAEO,OAAO,CAAC,GAAS;QACxB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACK,WAAW,CAAC,GAAS,EAAE,UAAmB,KAAK;QACtD,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrD,IAAA,qBAAM,EACL,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAC9C,KAAK,CAAC,+BAA+B,CACrC,CAAC;QAEF,IAAI,WAAW,KAAK,SAAS,EAAE;YAC9B,OAAO,SAAS,CAAC;SACjB;QACD,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC;QACpE,IAAI,OAAO,IAAI,OAAO,EAAE;YACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjB;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;IAEO,mBAAmB;QAC1B,yCAAyC;QACzC,IAAI,CAAC,OAAO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AAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;aAClC;QACF,CAAC,CAED,CAAC;QAEF,kEAAkE;QAClE,WAAW,CAAC,OAAO,CAAC,CAAC,GAAS,EAAE,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IACD,IAAI;QACH,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IACD,MAAM;QACL,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjC,CAAC;IAED,OAAO;QACN,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACD;AAhHD,8CAgHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\n\n/**\n * An extension of Map that expires (deletes) entries after a period of inactivity.\n * The policy is based on the last time a key was written to.\n */\nexport class MapWithExpiration<TKey = any, TValue = any> extends Map<TKey, TValue> {\n\t/** Timestamps (as epoch ms numbers) of when each key was last refreshed */\n\tprivate readonly lastRefreshedTimes = new Map<TKey, number>();\n\n\tconstructor(private readonly expiryMs: number) {\n\t\tsuper();\n\t}\n\n\tprivate refresh(key: TKey): void {\n\t\tthis.lastRefreshedTimes.set(key, new Date().valueOf());\n\t}\n\n\t/**\n\t * Returns true if the key is present and expired, false if it's not expired, and undefined if it's not found\n\t * If cleanUp is passed as true, then delete any expired entry before returning.\n\t */\n\tprivate checkExpiry(key: TKey, cleanUp: boolean = false): boolean | undefined {\n\t\tconst refreshTime = this.lastRefreshedTimes.get(key);\n\t\tassert(\n\t\t\t(refreshTime !== undefined) === super.has(key),\n\t\t\t0x50c /* freshness map out of sync */,\n\t\t);\n\n\t\tif (refreshTime === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst expired = new Date().valueOf() - refreshTime >= this.expiryMs;\n\t\tif (expired && cleanUp) {\n\t\t\tthis.delete(key);\n\t\t}\n\t\treturn expired;\n\t}\n\n\tprivate clearExpiredEntries() {\n\t\t// forEach clears out any expired entries\n\t\tthis.forEach(() => {});\n\t}\n\n\tget size(): number {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.size;\n\t}\n\n\thas(key: TKey): boolean {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.has(key);\n\t}\n\n\tget(key: TKey): TValue | undefined {\n\t\tthis.checkExpiry(key, true /* cleanUp */);\n\t\treturn super.get(key);\n\t}\n\n\tset(key: TKey, value: TValue): this {\n\t\t// Sliding window expiration policy (on write)\n\t\tthis.refresh(key);\n\t\treturn super.set(key, value);\n\t}\n\n\tdelete(key: TKey): boolean {\n\t\tthis.lastRefreshedTimes.delete(key);\n\t\treturn super.delete(key);\n\t}\n\n\tclear(): void {\n\t\tthis.lastRefreshedTimes.clear();\n\t\tsuper.clear();\n\t}\n\n\tforEach(\n\t\tcallbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void,\n\t\tthisArg?: any,\n\t): void {\n\t\tconst expiredKeys: TKey[] = [];\n\t\tsuper.forEach(\n\t\t\t(v, k, m) => {\n\t\t\t\tif (this.checkExpiry(k) === true) {\n\t\t\t\t\texpiredKeys.push(k);\n\t\t\t\t} else {\n\t\t\t\t\tcallbackfn.bind(thisArg)(v, k, m);\n\t\t\t\t}\n\t\t\t},\n\t\t\t// Note we don't pass thisArg here, since we bind it directly to callbackFn and don't need it otherwise\n\t\t);\n\n\t\t// Clean up keys we know are expired now that we're done iterating\n\t\texpiredKeys.forEach((key: TKey) => {\n\t\t\tthis.delete(key);\n\t\t});\n\t}\n\n\tentries(): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.entries();\n\t}\n\tkeys(): IterableIterator<TKey> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.keys();\n\t}\n\tvalues(): IterableIterator<TValue> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.values();\n\t}\n\t[Symbol.iterator](): IterableIterator<[TKey, TValue]> {\n\t\tthis.clearExpiredEntries();\n\t\treturn super[Symbol.iterator]();\n\t}\n\n\tvalueOf() {\n\t\tthis.clearExpiredEntries();\n\t\treturn super.valueOf();\n\t}\n}\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IDocumentServiceFactory, IResolvedUrl, IDocumentService } from "@fluidframework/driver-definitions";
|
|
6
|
-
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
|
|
8
|
-
export declare class MultiDocumentServiceFactory implements IDocumentServiceFactory {
|
|
9
|
-
static create(documentServiceFactory: IDocumentServiceFactory | IDocumentServiceFactory[]): IDocumentServiceFactory;
|
|
10
|
-
private readonly protocolToDocumentFactoryMap;
|
|
11
|
-
constructor(documentServiceFactories: IDocumentServiceFactory[]);
|
|
12
|
-
readonly protocolName = "none:";
|
|
13
|
-
createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
14
|
-
createContainer(createNewSummary: ISummaryTree, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=multiDocumentServiceFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiDocumentServiceFactory.d.ts","sourceRoot":"","sources":["../src/multiDocumentServiceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,qBAAa,2BAA4B,YAAW,uBAAuB;WAC5D,MAAM,CACnB,sBAAsB,EAAE,uBAAuB,GAAG,uBAAuB,EAAE;IAoB5E,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAuC;gBAExE,wBAAwB,EAAE,uBAAuB,EAAE;IAM/D,SAAgB,YAAY,WAAW;IACjC,qBAAqB,CAC1B,WAAW,EAAE,YAAY,EACzB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;IAgBf,eAAe,CAC3B,gBAAgB,EAAE,YAAY,EAC9B,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC;CAmB5B"}
|
|
@@ -1,63 +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.MultiDocumentServiceFactory = void 0;
|
|
8
|
-
const url_1 = require("url");
|
|
9
|
-
const fluidResolvedUrl_1 = require("./fluidResolvedUrl");
|
|
10
|
-
class MultiDocumentServiceFactory {
|
|
11
|
-
constructor(documentServiceFactories) {
|
|
12
|
-
this.protocolName = "none:";
|
|
13
|
-
this.protocolToDocumentFactoryMap = new Map();
|
|
14
|
-
documentServiceFactories.forEach((factory) => {
|
|
15
|
-
this.protocolToDocumentFactoryMap.set(factory.protocolName, factory);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
static create(documentServiceFactory) {
|
|
19
|
-
if (Array.isArray(documentServiceFactory)) {
|
|
20
|
-
const factories = [];
|
|
21
|
-
documentServiceFactory.forEach((factory) => {
|
|
22
|
-
const maybeMulti = factory;
|
|
23
|
-
if (maybeMulti.protocolToDocumentFactoryMap !== undefined) {
|
|
24
|
-
factories.push(...maybeMulti.protocolToDocumentFactoryMap.values());
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
factories.push(factory);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
if (factories.length === 1) {
|
|
31
|
-
return factories[0];
|
|
32
|
-
}
|
|
33
|
-
return new MultiDocumentServiceFactory(factories);
|
|
34
|
-
}
|
|
35
|
-
return documentServiceFactory;
|
|
36
|
-
}
|
|
37
|
-
async createDocumentService(resolvedUrl, logger, clientIsSummarizer) {
|
|
38
|
-
(0, fluidResolvedUrl_1.ensureFluidResolvedUrl)(resolvedUrl);
|
|
39
|
-
const urlObj = (0, url_1.parse)(resolvedUrl.url);
|
|
40
|
-
if (urlObj.protocol === undefined || urlObj.protocol === null) {
|
|
41
|
-
throw new Error("No protocol provided");
|
|
42
|
-
}
|
|
43
|
-
const factory = this.protocolToDocumentFactoryMap.get(urlObj.protocol);
|
|
44
|
-
if (factory === undefined) {
|
|
45
|
-
throw new Error("Unknown Fluid protocol");
|
|
46
|
-
}
|
|
47
|
-
return factory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
|
|
48
|
-
}
|
|
49
|
-
async createContainer(createNewSummary, createNewResolvedUrl, logger, clientIsSummarizer) {
|
|
50
|
-
(0, fluidResolvedUrl_1.ensureFluidResolvedUrl)(createNewResolvedUrl);
|
|
51
|
-
const urlObj = (0, url_1.parse)(createNewResolvedUrl.url);
|
|
52
|
-
if (urlObj.protocol === undefined || urlObj.protocol === null) {
|
|
53
|
-
throw new Error("No protocol provided");
|
|
54
|
-
}
|
|
55
|
-
const factory = this.protocolToDocumentFactoryMap.get(urlObj.protocol);
|
|
56
|
-
if (factory === undefined) {
|
|
57
|
-
throw new Error("Unknown Fluid protocol");
|
|
58
|
-
}
|
|
59
|
-
return factory.createContainer(createNewSummary, createNewResolvedUrl, logger, clientIsSummarizer);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.MultiDocumentServiceFactory = MultiDocumentServiceFactory;
|
|
63
|
-
//# sourceMappingURL=multiDocumentServiceFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiDocumentServiceFactory.js","sourceRoot":"","sources":["../src/multiDocumentServiceFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAA4B;AAQ5B,yDAA4D;AAE5D,MAAa,2BAA2B;IAwBvC,YAAY,wBAAmD;QAM/C,iBAAY,GAAG,OAAO,CAAC;QALtC,IAAI,CAAC,4BAA4B,GAAG,IAAI,GAAG,EAAE,CAAC;QAC9C,wBAAwB,CAAC,OAAO,CAAC,CAAC,OAAgC,EAAE,EAAE;YACrE,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACJ,CAAC;IA5BM,MAAM,CAAC,MAAM,CACnB,sBAA2E;QAE3E,IAAI,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAAE;YAC1C,MAAM,SAAS,GAA8B,EAAE,CAAC;YAChD,sBAAsB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBA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,IAAA,WAAK,EAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE;YAC9D,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;SACxC;QACD,MAAM,OAAO,GAAwC,IAAI,CAAC,4BAA4B,CAAC,GAAG,CACzF,MAAM,CAAC,QAAQ,CACf,CAAC;QACF,IAAI,OAAO,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC1C;QACD,OAAO,OAAO,CAAC,eAAe,CAC7B,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,EACN,kBAAkB,CAClB,CAAC;IACH,CAAC;CACD;AA3ED,kEA2EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { parse } from \"url\";\nimport {\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n\tIDocumentService,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { ensureFluidResolvedUrl } from \"./fluidResolvedUrl\";\n\nexport class MultiDocumentServiceFactory implements IDocumentServiceFactory {\n\tpublic static create(\n\t\tdocumentServiceFactory: IDocumentServiceFactory | IDocumentServiceFactory[],\n\t) {\n\t\tif (Array.isArray(documentServiceFactory)) {\n\t\t\tconst factories: IDocumentServiceFactory[] = [];\n\t\t\tdocumentServiceFactory.forEach((factory) => {\n\t\t\t\tconst maybeMulti = factory as MultiDocumentServiceFactory;\n\t\t\t\tif (maybeMulti.protocolToDocumentFactoryMap !== undefined) {\n\t\t\t\t\tfactories.push(...maybeMulti.protocolToDocumentFactoryMap.values());\n\t\t\t\t} else {\n\t\t\t\t\tfactories.push(factory);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (factories.length === 1) {\n\t\t\t\treturn factories[0];\n\t\t\t}\n\t\t\treturn new MultiDocumentServiceFactory(factories);\n\t\t}\n\t\treturn documentServiceFactory;\n\t}\n\n\tprivate readonly protocolToDocumentFactoryMap: Map<string, IDocumentServiceFactory>;\n\n\tconstructor(documentServiceFactories: IDocumentServiceFactory[]) {\n\t\tthis.protocolToDocumentFactoryMap = new Map();\n\t\tdocumentServiceFactories.forEach((factory: IDocumentServiceFactory) => {\n\t\t\tthis.protocolToDocumentFactoryMap.set(factory.protocolName, factory);\n\t\t});\n\t}\n\tpublic readonly protocolName = \"none:\";\n\tasync createDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tensureFluidResolvedUrl(resolvedUrl);\n\t\tconst urlObj = parse(resolvedUrl.url);\n\t\tif (urlObj.protocol === undefined || urlObj.protocol === null) {\n\t\t\tthrow new Error(\"No protocol provided\");\n\t\t}\n\t\tconst factory: IDocumentServiceFactory | undefined = this.protocolToDocumentFactoryMap.get(\n\t\t\turlObj.protocol,\n\t\t);\n\t\tif (factory === undefined) {\n\t\t\tthrow new Error(\"Unknown Fluid protocol\");\n\t\t}\n\n\t\treturn factory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);\n\t}\n\n\tpublic async createContainer(\n\t\tcreateNewSummary: ISummaryTree,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> {\n\t\tensureFluidResolvedUrl(createNewResolvedUrl);\n\t\tconst urlObj = parse(createNewResolvedUrl.url);\n\t\tif (urlObj.protocol === undefined || urlObj.protocol === null) {\n\t\t\tthrow new Error(\"No protocol provided\");\n\t\t}\n\t\tconst factory: IDocumentServiceFactory | undefined = this.protocolToDocumentFactoryMap.get(\n\t\t\turlObj.protocol,\n\t\t);\n\t\tif (factory === undefined) {\n\t\t\tthrow new Error(\"Unknown Fluid protocol\");\n\t\t}\n\t\treturn factory.createContainer(\n\t\t\tcreateNewSummary,\n\t\t\tcreateNewResolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IRequest } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IResolvedUrl, IUrlResolver } from "@fluidframework/driver-definitions";
|
|
7
|
-
/**
|
|
8
|
-
* Resolver that takes a list of url resolvers and then try each of them to resolve the url.
|
|
9
|
-
* @param resolversList - List of url resolvers to be used to resolve the request.
|
|
10
|
-
* @param request - Request to be resolved.
|
|
11
|
-
*/
|
|
12
|
-
export declare function configurableUrlResolver(resolversList: IUrlResolver[], request: IRequest): Promise<IResolvedUrl | undefined>;
|
|
13
|
-
export declare class MultiUrlResolver implements IUrlResolver {
|
|
14
|
-
private readonly urlResolvers;
|
|
15
|
-
static create(urlResolver: IUrlResolver | IUrlResolver[]): IUrlResolver;
|
|
16
|
-
private constructor();
|
|
17
|
-
resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
|
|
18
|
-
getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=multiUrlResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiUrlResolver.d.ts","sourceRoot":"","sources":["../src/multiUrlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEhF;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC5C,aAAa,EAAE,YAAY,EAAE,EAC7B,OAAO,EAAE,QAAQ,GACf,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CASnC;AAED,qBAAa,gBAAiB,YAAW,YAAY;IAWhC,OAAO,CAAC,QAAQ,CAAC,YAAY;WAVnC,MAAM,CAAC,WAAW,EAAE,YAAY,GAAG,YAAY,EAAE;IAU/D,OAAO;IAED,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAItD,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG5F"}
|
package/dist/multiUrlResolver.js
DELETED
|
@@ -1,45 +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.MultiUrlResolver = exports.configurableUrlResolver = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* Resolver that takes a list of url resolvers and then try each of them to resolve the url.
|
|
10
|
-
* @param resolversList - List of url resolvers to be used to resolve the request.
|
|
11
|
-
* @param request - Request to be resolved.
|
|
12
|
-
*/
|
|
13
|
-
async function configurableUrlResolver(resolversList, request) {
|
|
14
|
-
let resolved;
|
|
15
|
-
for (const resolver of resolversList) {
|
|
16
|
-
resolved = await resolver.resolve(Object.assign({}, request));
|
|
17
|
-
if (resolved !== undefined) {
|
|
18
|
-
return resolved;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
exports.configurableUrlResolver = configurableUrlResolver;
|
|
24
|
-
class MultiUrlResolver {
|
|
25
|
-
constructor(urlResolvers) {
|
|
26
|
-
this.urlResolvers = urlResolvers;
|
|
27
|
-
}
|
|
28
|
-
static create(urlResolver) {
|
|
29
|
-
if (Array.isArray(urlResolver)) {
|
|
30
|
-
if (urlResolver.length === 1) {
|
|
31
|
-
return urlResolver[0];
|
|
32
|
-
}
|
|
33
|
-
return new MultiUrlResolver(urlResolver);
|
|
34
|
-
}
|
|
35
|
-
return urlResolver;
|
|
36
|
-
}
|
|
37
|
-
async resolve(request) {
|
|
38
|
-
return configurableUrlResolver(this.urlResolvers, request);
|
|
39
|
-
}
|
|
40
|
-
async getAbsoluteUrl(resolvedUrl, relativeUrl) {
|
|
41
|
-
throw new Error("Not implmented");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.MultiUrlResolver = MultiUrlResolver;
|
|
45
|
-
//# sourceMappingURL=multiUrlResolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiUrlResolver.js","sourceRoot":"","sources":["../src/multiUrlResolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;;;GAIG;AACI,KAAK,UAAU,uBAAuB,CAC5C,aAA6B,EAC7B,OAAiB;IAEjB,IAAI,QAAkC,CAAC;IACvC,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE;QACrC,QAAQ,GAAG,MAAM,QAAQ,CAAC,OAAO,mBAAM,OAAO,EAAG,CAAC;QAClD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC3B,OAAO,QAAQ,CAAC;SAChB;KACD;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAZD,0DAYC;AAED,MAAa,gBAAgB;IAW5B,YAAqC,YAA4B;QAA5B,iBAAY,GAAZ,YAAY,CAAgB;IAAG,CAAC;IAV9D,MAAM,CAAC,MAAM,CAAC,WAA0C;QAC9D,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAC/B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC7B,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;aACtB;YACD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;SACzC;QACD,OAAO,WAAW,CAAC;IACpB,CAAC;IAID,KAAK,CAAC,OAAO,CAAC,OAAiB;QAC9B,OAAO,uBAAuB,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,WAAyB,EAAE,WAAmB;QACzE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACnC,CAAC;CACD;AApBD,4CAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\n\n/**\n * Resolver that takes a list of url resolvers and then try each of them to resolve the url.\n * @param resolversList - List of url resolvers to be used to resolve the request.\n * @param request - Request to be resolved.\n */\nexport async function configurableUrlResolver(\n\tresolversList: IUrlResolver[],\n\trequest: IRequest,\n): Promise<IResolvedUrl | undefined> {\n\tlet resolved: IResolvedUrl | undefined;\n\tfor (const resolver of resolversList) {\n\t\tresolved = await resolver.resolve({ ...request });\n\t\tif (resolved !== undefined) {\n\t\t\treturn resolved;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nexport class MultiUrlResolver implements IUrlResolver {\n\tpublic static create(urlResolver: IUrlResolver | IUrlResolver[]) {\n\t\tif (Array.isArray(urlResolver)) {\n\t\t\tif (urlResolver.length === 1) {\n\t\t\t\treturn urlResolver[0];\n\t\t\t}\n\t\t\treturn new MultiUrlResolver(urlResolver);\n\t\t}\n\t\treturn urlResolver;\n\t}\n\n\tprivate constructor(private readonly urlResolvers: IUrlResolver[]) {}\n\n\tasync resolve(request: IRequest): Promise<IResolvedUrl | undefined> {\n\t\treturn configurableUrlResolver(this.urlResolvers, request);\n\t}\n\n\tpublic async getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string): Promise<string> {\n\t\tthrow new Error(\"Not implmented\");\n\t}\n}\n"]}
|
package/dist/treeUtils.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { SummaryType, ISnapshotTree, ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
6
|
-
/**
|
|
7
|
-
* Summary tree assembler props
|
|
8
|
-
*/
|
|
9
|
-
export interface ISummaryTreeAssemblerProps {
|
|
10
|
-
/**
|
|
11
|
-
* Indicates that this tree is unreferenced. If this is not present, the tree is considered referenced.
|
|
12
|
-
*/
|
|
13
|
-
unreferenced?: true;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Summary tree assembler (without stats collection).
|
|
17
|
-
*/
|
|
18
|
-
export declare class SummaryTreeAssembler {
|
|
19
|
-
private readonly props?;
|
|
20
|
-
private attachmentCounter;
|
|
21
|
-
private readonly summaryTree;
|
|
22
|
-
constructor(props?: ISummaryTreeAssemblerProps | undefined);
|
|
23
|
-
/**
|
|
24
|
-
* Get final summary
|
|
25
|
-
*/
|
|
26
|
-
get summary(): ISummaryTree;
|
|
27
|
-
/**
|
|
28
|
-
* Add blob to summary
|
|
29
|
-
*/
|
|
30
|
-
addBlob(key: string, content: string | Uint8Array): void;
|
|
31
|
-
/**
|
|
32
|
-
* Add handle to summary
|
|
33
|
-
*/
|
|
34
|
-
addHandle(key: string, handleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment, handle: string): void;
|
|
35
|
-
/**
|
|
36
|
-
* Add tree to summary
|
|
37
|
-
*/
|
|
38
|
-
addTree(key: string, summary: ISummaryTree): void;
|
|
39
|
-
/**
|
|
40
|
-
* Add attachment to summary
|
|
41
|
-
*/
|
|
42
|
-
addAttachment(id: string): void;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Helper function that converts ISnapshotTree and blobs to ISummaryTree
|
|
46
|
-
* @param snapshot - Source snapshot tree
|
|
47
|
-
* @param blobs - Blobs cache
|
|
48
|
-
* @returns Converted snapshot in ISummaryTree format
|
|
49
|
-
*/
|
|
50
|
-
export declare function convertSnapshotAndBlobsToSummaryTree(snapshot: ISnapshotTree, blobs: Map<string, ArrayBuffer>): ISummaryTree;
|
|
51
|
-
//# sourceMappingURL=treeUtils.d.ts.map
|
package/dist/treeUtils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"treeUtils.d.ts","sourceRoot":"","sources":["../src/treeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,WAAW,EACX,aAAa,EACb,YAAY,EAEZ,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,oBAAoB;IAIpB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAHnC,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyC;gBAExC,KAAK,CAAC,wCAA4B;IAE/D;;OAEG;IACH,IAAW,OAAO,IAAI,YAAY,CAMjC;IAED;;OAEG;IACI,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAO/D;;OAEG;IACI,SAAS,CACf,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,UAAU,EACxE,MAAM,EAAE,MAAM,GACZ,IAAI;IAQP;;OAEG;IACI,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAIxD;;OAEG;IACI,aAAa,CAAC,EAAE,EAAE,MAAM;CAG/B;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CACnD,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAC7B,YAAY,CAcd"}
|
package/dist/treeUtils.js
DELETED
|
@@ -1,85 +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.convertSnapshotAndBlobsToSummaryTree = exports.SummaryTreeAssembler = void 0;
|
|
8
|
-
const common_utils_1 = require("@fluidframework/common-utils");
|
|
9
|
-
const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
|
|
10
|
-
/**
|
|
11
|
-
* Summary tree assembler (without stats collection).
|
|
12
|
-
*/
|
|
13
|
-
class SummaryTreeAssembler {
|
|
14
|
-
constructor(props) {
|
|
15
|
-
this.props = props;
|
|
16
|
-
this.attachmentCounter = 0;
|
|
17
|
-
this.summaryTree = {};
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get final summary
|
|
21
|
-
*/
|
|
22
|
-
get summary() {
|
|
23
|
-
var _a;
|
|
24
|
-
return {
|
|
25
|
-
type: protocol_definitions_1.SummaryType.Tree,
|
|
26
|
-
tree: Object.assign({}, this.summaryTree),
|
|
27
|
-
unreferenced: (_a = this.props) === null || _a === void 0 ? void 0 : _a.unreferenced,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Add blob to summary
|
|
32
|
-
*/
|
|
33
|
-
addBlob(key, content) {
|
|
34
|
-
this.summaryTree[key] = {
|
|
35
|
-
type: protocol_definitions_1.SummaryType.Blob,
|
|
36
|
-
content,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Add handle to summary
|
|
41
|
-
*/
|
|
42
|
-
addHandle(key, handleType, handle) {
|
|
43
|
-
this.summaryTree[key] = {
|
|
44
|
-
type: protocol_definitions_1.SummaryType.Handle,
|
|
45
|
-
handleType,
|
|
46
|
-
handle,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Add tree to summary
|
|
51
|
-
*/
|
|
52
|
-
addTree(key, summary) {
|
|
53
|
-
this.summaryTree[key] = summary;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Add attachment to summary
|
|
57
|
-
*/
|
|
58
|
-
addAttachment(id) {
|
|
59
|
-
this.summaryTree[this.attachmentCounter++] = { id, type: protocol_definitions_1.SummaryType.Attachment };
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.SummaryTreeAssembler = SummaryTreeAssembler;
|
|
63
|
-
/**
|
|
64
|
-
* Helper function that converts ISnapshotTree and blobs to ISummaryTree
|
|
65
|
-
* @param snapshot - Source snapshot tree
|
|
66
|
-
* @param blobs - Blobs cache
|
|
67
|
-
* @returns Converted snapshot in ISummaryTree format
|
|
68
|
-
*/
|
|
69
|
-
function convertSnapshotAndBlobsToSummaryTree(snapshot, blobs) {
|
|
70
|
-
const assembler = new SummaryTreeAssembler({
|
|
71
|
-
unreferenced: snapshot.unreferenced,
|
|
72
|
-
});
|
|
73
|
-
for (const [path, id] of Object.entries(snapshot.blobs)) {
|
|
74
|
-
const blob = blobs.get(id);
|
|
75
|
-
(0, common_utils_1.assert)(blob !== undefined, 0x2dd /* "Cannot find blob for a given id" */);
|
|
76
|
-
assembler.addBlob(path, common_utils_1.IsoBuffer.from(blob).toString("utf-8"));
|
|
77
|
-
}
|
|
78
|
-
for (const [key, tree] of Object.entries(snapshot.trees)) {
|
|
79
|
-
const subtree = convertSnapshotAndBlobsToSummaryTree(tree, blobs);
|
|
80
|
-
assembler.addTree(key, subtree);
|
|
81
|
-
}
|
|
82
|
-
return assembler.summary;
|
|
83
|
-
}
|
|
84
|
-
exports.convertSnapshotAndBlobsToSummaryTree = convertSnapshotAndBlobsToSummaryTree;
|
|
85
|
-
//# sourceMappingURL=treeUtils.js.map
|
package/dist/treeUtils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"treeUtils.js","sourceRoot":"","sources":["../src/treeUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AACjE,+EAK8C;AAY9C;;GAEG;AACH,MAAa,oBAAoB;IAIhC,YAA6B,KAAkC;QAAlC,UAAK,GAAL,KAAK,CAA6B;QAHvD,sBAAiB,GAAW,CAAC,CAAC;QACrB,gBAAW,GAAsC,EAAE,CAAC;IAEH,CAAC;IAEnE;;OAEG;IACH,IAAW,OAAO;;QACjB,OAAO;YACN,IAAI,EAAE,kCAAW,CAAC,IAAI;YACtB,IAAI,oBAAO,IAAI,CAAC,WAAW,CAAE;YAC7B,YAAY,EAAE,MAAA,IAAI,CAAC,KAAK,0CAAE,YAAY;SACtC,CAAC;IACH,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,GAAW,EAAE,OAA4B;QACvD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG;YACvB,IAAI,EAAE,kCAAW,CAAC,IAAI;YACtB,OAAO;SACP,CAAC;IACH,CAAC;IAED;;OAEG;IACI,SAAS,CACf,GAAW,EACX,UAAwE,EACxE,MAAc;QAEd,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG;YACvB,IAAI,EAAE,kCAAW,CAAC,MAAM;YACxB,UAAU;YACV,MAAM;SACN,CAAC;IACH,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,GAAW,EAAE,OAAqB;QAChD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,EAAU;QAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,kCAAW,CAAC,UAAU,EAAE,CAAC;IACnF,CAAC;CACD;AAvDD,oDAuDC;AAED;;;;;GAKG;AACH,SAAgB,oCAAoC,CACnD,QAAuB,EACvB,KAA+B;IAE/B,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC;QAC1C,YAAY,EAAE,QAAQ,CAAC,YAAY;KACnC,CAAC,CAAC;IACH,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACxD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC3B,IAAA,qBAAM,EAAC,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC1E,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,wBAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;KAChE;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACzD,MAAM,OAAO,GAAG,oCAAoC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAClE,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAChC;IACD,OAAO,SAAS,CAAC,OAAO,CAAC;AAC1B,CAAC;AAjBD,oFAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, IsoBuffer } from \"@fluidframework/common-utils\";\nimport {\n\tSummaryType,\n\tISnapshotTree,\n\tISummaryTree,\n\tSummaryObject,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Summary tree assembler props\n */\nexport interface ISummaryTreeAssemblerProps {\n\t/**\n\t * Indicates that this tree is unreferenced. If this is not present, the tree is considered referenced.\n\t */\n\tunreferenced?: true;\n}\n\n/**\n * Summary tree assembler (without stats collection).\n */\nexport class SummaryTreeAssembler {\n\tprivate attachmentCounter: number = 0;\n\tprivate readonly summaryTree: { [path: string]: SummaryObject } = {};\n\n\tconstructor(private readonly props?: ISummaryTreeAssemblerProps) {}\n\n\t/**\n\t * Get final summary\n\t */\n\tpublic get summary(): ISummaryTree {\n\t\treturn {\n\t\t\ttype: SummaryType.Tree,\n\t\t\ttree: { ...this.summaryTree },\n\t\t\tunreferenced: this.props?.unreferenced,\n\t\t};\n\t}\n\n\t/**\n\t * Add blob to summary\n\t */\n\tpublic addBlob(key: string, content: string | Uint8Array): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Blob,\n\t\t\tcontent,\n\t\t};\n\t}\n\n\t/**\n\t * Add handle to summary\n\t */\n\tpublic addHandle(\n\t\tkey: string,\n\t\thandleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment,\n\t\thandle: string,\n\t): void {\n\t\tthis.summaryTree[key] = {\n\t\t\ttype: SummaryType.Handle,\n\t\t\thandleType,\n\t\t\thandle,\n\t\t};\n\t}\n\n\t/**\n\t * Add tree to summary\n\t */\n\tpublic addTree(key: string, summary: ISummaryTree): void {\n\t\tthis.summaryTree[key] = summary;\n\t}\n\n\t/**\n\t * Add attachment to summary\n\t */\n\tpublic addAttachment(id: string) {\n\t\tthis.summaryTree[this.attachmentCounter++] = { id, type: SummaryType.Attachment };\n\t}\n}\n\n/**\n * Helper function that converts ISnapshotTree and blobs to ISummaryTree\n * @param snapshot - Source snapshot tree\n * @param blobs - Blobs cache\n * @returns Converted snapshot in ISummaryTree format\n */\nexport function convertSnapshotAndBlobsToSummaryTree(\n\tsnapshot: ISnapshotTree,\n\tblobs: Map<string, ArrayBuffer>,\n): ISummaryTree {\n\tconst assembler = new SummaryTreeAssembler({\n\t\tunreferenced: snapshot.unreferenced,\n\t});\n\tfor (const [path, id] of Object.entries(snapshot.blobs)) {\n\t\tconst blob = blobs.get(id);\n\t\tassert(blob !== undefined, 0x2dd /* \"Cannot find blob for a given id\" */);\n\t\tassembler.addBlob(path, IsoBuffer.from(blob).toString(\"utf-8\"));\n\t}\n\tfor (const [key, tree] of Object.entries(snapshot.trees)) {\n\t\tconst subtree = convertSnapshotAndBlobsToSummaryTree(tree, blobs);\n\t\tassembler.addTree(key, subtree);\n\t}\n\treturn assembler.summary;\n}\n"]}
|
|
@@ -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,8B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