@fluidframework/runtime-utils 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +3 -3
- package/api-report/runtime-utils.api.md +31 -35
- package/dist/dataStoreHandleContextUtils.d.ts +1 -0
- package/dist/dataStoreHandleContextUtils.d.ts.map +1 -1
- package/dist/dataStoreHandleContextUtils.js +1 -0
- package/dist/dataStoreHandleContextUtils.js.map +1 -1
- package/dist/dataStoreHelpers.d.ts +17 -3
- package/dist/dataStoreHelpers.d.ts.map +1 -1
- package/dist/dataStoreHelpers.js +14 -14
- package/dist/dataStoreHelpers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/objectstoragepartition.d.ts +1 -0
- package/dist/objectstoragepartition.d.ts.map +1 -1
- package/dist/objectstoragepartition.js +1 -0
- package/dist/objectstoragepartition.js.map +1 -1
- package/dist/objectstorageutils.d.ts +6 -0
- package/dist/objectstorageutils.d.ts.map +1 -1
- package/dist/objectstorageutils.js +6 -0
- package/dist/objectstorageutils.js.map +1 -1
- package/dist/requestParser.d.ts +1 -0
- package/dist/requestParser.d.ts.map +1 -1
- package/dist/requestParser.js +1 -0
- package/dist/requestParser.js.map +1 -1
- package/dist/runtime-utils-alpha.d.ts +134 -0
- package/dist/runtime-utils-beta.d.ts +121 -0
- package/dist/runtime-utils-public.d.ts +121 -0
- package/dist/runtime-utils-untrimmed.d.ts +306 -0
- package/dist/runtimeFactoryHelper.d.ts +3 -0
- package/dist/runtimeFactoryHelper.d.ts.map +1 -1
- package/dist/runtimeFactoryHelper.js +3 -0
- package/dist/runtimeFactoryHelper.js.map +1 -1
- package/dist/summaryUtils.d.ts +32 -2
- package/dist/summaryUtils.d.ts.map +1 -1
- package/dist/summaryUtils.js +29 -0
- package/dist/summaryUtils.js.map +1 -1
- package/dist/unpackUsedRoutes.d.ts +2 -1
- package/dist/unpackUsedRoutes.d.ts.map +1 -1
- package/dist/unpackUsedRoutes.js +1 -0
- package/dist/unpackUsedRoutes.js.map +1 -1
- package/dist/utils.d.ts +6 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -1
- package/lib/dataStoreHandleContextUtils.d.ts +1 -0
- package/lib/dataStoreHandleContextUtils.d.ts.map +1 -1
- package/lib/dataStoreHandleContextUtils.js +1 -0
- package/lib/dataStoreHandleContextUtils.js.map +1 -1
- package/lib/dataStoreHelpers.d.ts +17 -3
- package/lib/dataStoreHelpers.d.ts.map +1 -1
- package/lib/dataStoreHelpers.js +13 -12
- package/lib/dataStoreHelpers.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/objectstoragepartition.d.ts +1 -0
- package/lib/objectstoragepartition.d.ts.map +1 -1
- package/lib/objectstoragepartition.js +1 -0
- package/lib/objectstoragepartition.js.map +1 -1
- package/lib/objectstorageutils.d.ts +6 -0
- package/lib/objectstorageutils.d.ts.map +1 -1
- package/lib/objectstorageutils.js +6 -0
- package/lib/objectstorageutils.js.map +1 -1
- package/lib/requestParser.d.ts +1 -0
- package/lib/requestParser.d.ts.map +1 -1
- package/lib/requestParser.js +1 -0
- package/lib/requestParser.js.map +1 -1
- package/lib/runtime-utils-alpha.d.ts +134 -0
- package/lib/runtime-utils-beta.d.ts +121 -0
- package/lib/runtime-utils-public.d.ts +121 -0
- package/lib/runtime-utils-untrimmed.d.ts +306 -0
- package/lib/runtimeFactoryHelper.d.ts +3 -0
- package/lib/runtimeFactoryHelper.d.ts.map +1 -1
- package/lib/runtimeFactoryHelper.js +3 -0
- package/lib/runtimeFactoryHelper.js.map +1 -1
- package/lib/summaryUtils.d.ts +32 -2
- package/lib/summaryUtils.d.ts.map +1 -1
- package/lib/summaryUtils.js +29 -0
- package/lib/summaryUtils.js.map +1 -1
- package/lib/unpackUsedRoutes.d.ts +2 -1
- package/lib/unpackUsedRoutes.d.ts.map +1 -1
- package/lib/unpackUsedRoutes.js +1 -0
- package/lib/unpackUsedRoutes.js.map +1 -1
- package/lib/utils.d.ts +6 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -0
- package/lib/utils.js.map +1 -1
- package/package.json +41 -17
- package/src/dataStoreHandleContextUtils.ts +1 -0
- package/src/dataStoreHelpers.ts +17 -19
- package/src/index.ts +0 -1
- package/src/objectstoragepartition.ts +1 -0
- package/src/objectstorageutils.ts +6 -0
- package/src/requestParser.ts +1 -0
- package/src/runtimeFactoryHelper.ts +3 -0
- package/src/summaryUtils.ts +35 -4
- package/src/unpackUsedRoutes.ts +2 -1
- package/src/utils.ts +6 -1
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { IChannelStorageService } from '@fluidframework/datastore-definitions';
|
|
2
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
3
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
4
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
5
|
+
import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
|
|
6
|
+
import { IFluidHandleContext } from '@fluidframework/core-interfaces';
|
|
7
|
+
import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
|
|
8
|
+
import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
|
|
9
|
+
import { IRequest } from '@fluidframework/core-interfaces';
|
|
10
|
+
import { IRequestHeader } from '@fluidframework/core-interfaces';
|
|
11
|
+
import { IResponse } from '@fluidframework/core-interfaces';
|
|
12
|
+
import { IRuntime } from '@fluidframework/container-definitions';
|
|
13
|
+
import { IRuntimeFactory } from '@fluidframework/container-definitions';
|
|
14
|
+
import { ISnapshotTree } from '@fluidframework/protocol-definitions';
|
|
15
|
+
import { ISnapshotTreeWithBlobContents } from '@fluidframework/container-definitions';
|
|
16
|
+
import { ISummarizeResult } from '@fluidframework/runtime-definitions';
|
|
17
|
+
import { ISummaryBlob } from '@fluidframework/protocol-definitions';
|
|
18
|
+
import { ISummaryStats } from '@fluidframework/runtime-definitions';
|
|
19
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
20
|
+
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
21
|
+
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
|
|
22
|
+
import { ITree } from '@fluidframework/protocol-definitions';
|
|
23
|
+
import { SummaryObject } from '@fluidframework/protocol-definitions';
|
|
24
|
+
import { SummaryType } from '@fluidframework/protocol-definitions';
|
|
25
|
+
import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare function addBlobToSummary(summary: ISummaryTreeWithStats, key: string, content: string | Uint8Array): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function addSummarizeResultToSummary(summary: ISummaryTreeWithStats, key: string, summarizeResult: ISummarizeResult): void;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare function addTreeToSummary(summary: ISummaryTreeWithStats, key: string, summarizeResult: ISummarizeResult): void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function calculateStats(summary: SummaryObject): ISummaryStats;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Converts ISnapshotTree to ISummaryTree format and tracks stats. This snapshot tree was
|
|
49
|
+
* was taken by serialize api in detached container.
|
|
50
|
+
* @param snapshot - snapshot in ISnapshotTree format
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function convertSnapshotTreeToSummaryTree(snapshot: ISnapshotTreeWithBlobContents): ISummaryTreeWithStats;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Converts ISummaryTree to ITree format. This is needed for back-compat while we get rid of snapshot.
|
|
57
|
+
* @param summaryTree - summary tree in ISummaryTree format
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
export declare function convertSummaryTreeToITree(summaryTree: ISummaryTree): ITree;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
64
|
+
* @param snapshot - snapshot in ITree format
|
|
65
|
+
* @param fullTree - true to never use handles, even if id is specified
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare function convertToSummaryTree(snapshot: ITree, fullTree?: boolean): ISummarizeResult;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
72
|
+
* @param snapshot - snapshot in ITree format
|
|
73
|
+
* @param fullTree - true to never use handles, even if id is specified
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
export declare function convertToSummaryTreeWithStats(snapshot: ITree, fullTree?: boolean): ISummaryTreeWithStats;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export declare const create404Response: (request: IRequest) => IResponse;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
export declare function createDataStoreFactory(type: string, factory: Factory | Promise<Factory>): IFluidDataStoreFactory & IFluidDataStoreRegistry;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export declare function createResponseError(status: number, value: string, request: IRequest, headers?: {
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
}): IResponse;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
export declare function exceptionToResponse(err: any): IResponse;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
export declare type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Helper class to build the garbage collection data of a node by combining the data from multiple nodes.
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
export declare class GCDataBuilder implements IGarbageCollectionData {
|
|
110
|
+
private readonly gcNodesSet;
|
|
111
|
+
get gcNodes(): {
|
|
112
|
+
[id: string]: string[];
|
|
113
|
+
};
|
|
114
|
+
addNode(id: string, outboundRoutes: string[]): void;
|
|
115
|
+
/**
|
|
116
|
+
* Adds the given GC nodes. It does the following:
|
|
117
|
+
* - Normalizes the ids of the given nodes.
|
|
118
|
+
* - Prefixes the given `prefixId` to the given nodes' ids.
|
|
119
|
+
* - Adds the outbound routes of the nodes against the normalized and prefixed id.
|
|
120
|
+
*/
|
|
121
|
+
prefixAndAddNodes(prefixId: string, gcNodes: {
|
|
122
|
+
[id: string]: string[];
|
|
123
|
+
}): void;
|
|
124
|
+
addNodes(gcNodes: {
|
|
125
|
+
[id: string]: string[];
|
|
126
|
+
}): void;
|
|
127
|
+
/**
|
|
128
|
+
* Adds the given outbound route to the outbound routes of all GC nodes.
|
|
129
|
+
*/
|
|
130
|
+
addRouteToAllNodes(outboundRoute: string): void;
|
|
131
|
+
getGCData(): IGarbageCollectionData;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Generates the absolute path for a Fluid object given its path and its parent routeContext.
|
|
136
|
+
* @param path - The path to the Fluid object relative to the route context.
|
|
137
|
+
* @param routeContext - The route context that contains the Fluid object.
|
|
138
|
+
* @returns The absolute path to the Fluid object from the root of the Container.
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
141
|
+
export declare function generateHandleContextPath(path: string, routeContext?: IFluidHandleContext): string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
export declare function getBlobSize(content: ISummaryBlob["content"]): number;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @internal
|
|
150
|
+
*/
|
|
151
|
+
export declare function getNormalizedObjectStoragePathParts(path: string): string[];
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
export declare function listBlobsAtTreePath(inputTree: ITree | undefined, path: string): Promise<string[]>;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Combines summary stats by adding their totals together.
|
|
160
|
+
* Returns empty stats if called without args.
|
|
161
|
+
* @param stats - stats to merge
|
|
162
|
+
* @internal
|
|
163
|
+
*/
|
|
164
|
+
export declare function mergeStats(...stats: ISummaryStats[]): ISummaryStats;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Returns a new IChannelStorageService that resolves the given `path` as root.
|
|
168
|
+
* @internal
|
|
169
|
+
*/
|
|
170
|
+
export declare class ObjectStoragePartition implements IChannelStorageService {
|
|
171
|
+
private readonly storage;
|
|
172
|
+
private readonly path;
|
|
173
|
+
constructor(storage: IChannelStorageService, path: string);
|
|
174
|
+
readBlob(path: string): Promise<ArrayBufferLike>;
|
|
175
|
+
contains(path: string): Promise<boolean>;
|
|
176
|
+
list(path: string): Promise<string[]>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Reads a blob from storage and parses it from JSON.
|
|
181
|
+
*
|
|
182
|
+
* @internal
|
|
183
|
+
*/
|
|
184
|
+
export declare type ReadAndParseBlob = <T>(id: string) => Promise<T>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* The Request Parser takes an IRequest provides parsing and sub request creation
|
|
188
|
+
* @alpha
|
|
189
|
+
*/
|
|
190
|
+
export declare class RequestParser implements IRequest {
|
|
191
|
+
private readonly request;
|
|
192
|
+
/**
|
|
193
|
+
* Splits the path of the url and decodes each path part
|
|
194
|
+
* @param url - the url to get path parts of
|
|
195
|
+
*/
|
|
196
|
+
static getPathParts(url: string): readonly string[];
|
|
197
|
+
private requestPathParts;
|
|
198
|
+
readonly query: string;
|
|
199
|
+
static create(request: Readonly<IRequest>): RequestParser;
|
|
200
|
+
protected constructor(request: Readonly<IRequest>);
|
|
201
|
+
get url(): string;
|
|
202
|
+
get headers(): IRequestHeader | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* Returns the decoded path parts of the request's url
|
|
205
|
+
*/
|
|
206
|
+
get pathParts(): readonly string[];
|
|
207
|
+
/**
|
|
208
|
+
* Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.
|
|
209
|
+
* @param elements - number of elements in path
|
|
210
|
+
*/
|
|
211
|
+
isLeaf(elements: number): boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Creates a sub request starting at a specific path part of this request's url
|
|
214
|
+
* The sub request url always has a leading slash, and always include query params if original url has any
|
|
215
|
+
* e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams
|
|
216
|
+
* createSubRequest(1) is /b/?queryParams
|
|
217
|
+
* createSubRequest(2) is /?queryParams
|
|
218
|
+
* createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception
|
|
219
|
+
*
|
|
220
|
+
* note: query params are not counted towards path parts.
|
|
221
|
+
*
|
|
222
|
+
* @param startingPathIndex - The index of the first path part of the sub request
|
|
223
|
+
*/
|
|
224
|
+
createSubRequest(startingPathIndex: number): IRequest;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @internal
|
|
229
|
+
*/
|
|
230
|
+
export declare function responseToException(response: IResponse, request: IRequest): Error;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @alpha
|
|
234
|
+
*/
|
|
235
|
+
export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
|
|
236
|
+
get IRuntimeFactory(): this;
|
|
237
|
+
instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
|
|
238
|
+
abstract preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & T>;
|
|
239
|
+
instantiateFirstTime(_runtime: T): Promise<void>;
|
|
240
|
+
instantiateFromExisting(_runtime: T): Promise<void>;
|
|
241
|
+
hasInitialized(_runtime: T): Promise<void>;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Fetches the sequence number of the snapshot tree by examining the protocol.
|
|
246
|
+
* @param tree - snapshot tree to examine
|
|
247
|
+
* @param readAndParseBlob - function to read blob contents from storage
|
|
248
|
+
* and parse the result from JSON.
|
|
249
|
+
* @internal
|
|
250
|
+
*/
|
|
251
|
+
export declare function seqFromTree(tree: ISnapshotTree, readAndParseBlob: ReadAndParseBlob): Promise<number>;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @internal
|
|
255
|
+
*/
|
|
256
|
+
export declare class SummaryTreeBuilder implements ISummaryTreeWithStats {
|
|
257
|
+
private attachmentCounter;
|
|
258
|
+
get summary(): ISummaryTree;
|
|
259
|
+
get stats(): Readonly<ISummaryStats>;
|
|
260
|
+
constructor();
|
|
261
|
+
private readonly summaryTree;
|
|
262
|
+
private summaryStats;
|
|
263
|
+
addBlob(key: string, content: string | Uint8Array): void;
|
|
264
|
+
addHandle(key: string, handleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment, handle: string): void;
|
|
265
|
+
addWithStats(key: string, summarizeResult: ISummarizeResult): void;
|
|
266
|
+
addAttachment(id: string): void;
|
|
267
|
+
getSummaryTree(): ISummaryTreeWithStats;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @internal
|
|
272
|
+
*/
|
|
273
|
+
export declare class TelemetryContext implements ITelemetryContext {
|
|
274
|
+
private readonly telemetry;
|
|
275
|
+
/**
|
|
276
|
+
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.set}
|
|
277
|
+
*/
|
|
278
|
+
set(prefix: string, property: string, value: TelemetryEventPropertyType): void;
|
|
279
|
+
/**
|
|
280
|
+
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.setMultiple}
|
|
281
|
+
*/
|
|
282
|
+
setMultiple(prefix: string, property: string, values: Record<string, TelemetryEventPropertyType>): void;
|
|
283
|
+
/**
|
|
284
|
+
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.get}
|
|
285
|
+
*/
|
|
286
|
+
get(prefix: string, property: string): TelemetryEventPropertyType;
|
|
287
|
+
/**
|
|
288
|
+
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.serialize}
|
|
289
|
+
*/
|
|
290
|
+
serialize(): string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Helper function that unpacks the used routes of children from a given node's used routes.
|
|
295
|
+
* @param usedRoutes - The used routes of a node.
|
|
296
|
+
* @returns A map of used routes of each children of the the given node.
|
|
297
|
+
* @internal
|
|
298
|
+
*/
|
|
299
|
+
export declare function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]): Map<string, string[]>;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @internal
|
|
303
|
+
*/
|
|
304
|
+
export declare function utf8ByteLength(str: string): number;
|
|
305
|
+
|
|
306
|
+
export { }
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IContainerContext, IRuntime, IRuntimeFactory } from "@fluidframework/container-definitions";
|
|
6
6
|
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
|
+
/**
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
7
10
|
export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
|
|
8
11
|
get IRuntimeFactory(): this;
|
|
9
12
|
instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeFactoryHelper.d.ts","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,8BAAsB,oBAAoB,CAAC,CAAC,GAAG,iBAAiB,CAAE,YAAW,eAAe;IAC3F,IAAW,eAAe,SAEzB;IAEY,kBAAkB,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,CAAC;aASJ,aAAa,CAC5B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACX,oBAAoB,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAChD,uBAAuB,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IACnD,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CACvD"}
|
|
1
|
+
{"version":3,"file":"runtimeFactoryHelper.d.ts","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF;;GAEG;AACH,8BAAsB,oBAAoB,CAAC,CAAC,GAAG,iBAAiB,CAAE,YAAW,eAAe;IAC3F,IAAW,eAAe,SAEzB;IAEY,kBAAkB,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,CAAC;aASJ,aAAa,CAC5B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACX,oBAAoB,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAChD,uBAAuB,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IACnD,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CACvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeFactoryHelper.js","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,OAAgB,oBAAoB;IACzC,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAC9B,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC5D,MAAM,CAAC,QAAQ;YACd,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,OAAO,CAAC;IAChB,CAAC;IAMM,KAAK,CAAC,oBAAoB,CAAC,QAAW,IAAkB,CAAC;IACzD,KAAK,CAAC,uBAAuB,CAAC,QAAW,IAAkB,CAAC;IAC5D,KAAK,CAAC,cAAc,CAAC,QAAW,IAAkB,CAAC;CAC1D","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainerContext,\n\tIRuntime,\n\tIRuntimeFactory,\n} from \"@fluidframework/container-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\n\nexport abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {\n\tpublic get IRuntimeFactory() {\n\t\treturn this;\n\t}\n\n\tpublic async instantiateRuntime(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<IRuntime> {\n\t\tconst runtime = await this.preInitialize(context, existing);\n\t\tawait (existing\n\t\t\t? this.instantiateFromExisting(runtime)\n\t\t\t: this.instantiateFirstTime(runtime));\n\t\tawait this.hasInitialized(runtime);\n\t\treturn runtime;\n\t}\n\n\tpublic abstract preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<IRuntime & T>;\n\tpublic async instantiateFirstTime(_runtime: T): Promise<void> {}\n\tpublic async instantiateFromExisting(_runtime: T): Promise<void> {}\n\tpublic async hasInitialized(_runtime: T): Promise<void> {}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtimeFactoryHelper.js","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;GAEG;AACH,MAAM,OAAgB,oBAAoB;IACzC,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAC9B,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC5D,MAAM,CAAC,QAAQ;YACd,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,OAAO,CAAC;IAChB,CAAC;IAMM,KAAK,CAAC,oBAAoB,CAAC,QAAW,IAAkB,CAAC;IACzD,KAAK,CAAC,uBAAuB,CAAC,QAAW,IAAkB,CAAC;IAC5D,KAAK,CAAC,cAAc,CAAC,QAAW,IAAkB,CAAC;CAC1D","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainerContext,\n\tIRuntime,\n\tIRuntimeFactory,\n} from \"@fluidframework/container-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\n\n/**\n * @alpha\n */\nexport abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {\n\tpublic get IRuntimeFactory() {\n\t\treturn this;\n\t}\n\n\tpublic async instantiateRuntime(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<IRuntime> {\n\t\tconst runtime = await this.preInitialize(context, existing);\n\t\tawait (existing\n\t\t\t? this.instantiateFromExisting(runtime)\n\t\t\t: this.instantiateFirstTime(runtime));\n\t\tawait this.hasInitialized(runtime);\n\t\treturn runtime;\n\t}\n\n\tpublic abstract preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<IRuntime & T>;\n\tpublic async instantiateFirstTime(_runtime: T): Promise<void> {}\n\tpublic async instantiateFromExisting(_runtime: T): Promise<void> {}\n\tpublic async hasInitialized(_runtime: T): Promise<void> {}\n}\n"]}
|
package/lib/summaryUtils.d.ts
CHANGED
|
@@ -3,20 +3,43 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { TelemetryEventPropertyType } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { ITree, SummaryType, ISummaryTree, SummaryObject, ISummaryBlob
|
|
6
|
+
import { ITree, SummaryType, ISummaryTree, SummaryObject, ISummaryBlob } from "@fluidframework/protocol-definitions";
|
|
7
7
|
import { ISummaryStats, ISummarizeResult, ISummaryTreeWithStats, ITelemetryContext, IGarbageCollectionData } from "@fluidframework/runtime-definitions";
|
|
8
|
+
import { ISnapshotTreeWithBlobContents } from "@fluidframework/container-definitions";
|
|
8
9
|
/**
|
|
9
10
|
* Combines summary stats by adding their totals together.
|
|
10
11
|
* Returns empty stats if called without args.
|
|
11
12
|
* @param stats - stats to merge
|
|
13
|
+
* @internal
|
|
12
14
|
*/
|
|
13
15
|
export declare function mergeStats(...stats: ISummaryStats[]): ISummaryStats;
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
14
19
|
export declare function utf8ByteLength(str: string): number;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
15
23
|
export declare function getBlobSize(content: ISummaryBlob["content"]): number;
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
16
27
|
export declare function calculateStats(summary: SummaryObject): ISummaryStats;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
17
31
|
export declare function addBlobToSummary(summary: ISummaryTreeWithStats, key: string, content: string | Uint8Array): void;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
18
35
|
export declare function addTreeToSummary(summary: ISummaryTreeWithStats, key: string, summarizeResult: ISummarizeResult): void;
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
19
39
|
export declare function addSummarizeResultToSummary(summary: ISummaryTreeWithStats, key: string, summarizeResult: ISummarizeResult): void;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
20
43
|
export declare class SummaryTreeBuilder implements ISummaryTreeWithStats {
|
|
21
44
|
private attachmentCounter;
|
|
22
45
|
get summary(): ISummaryTree;
|
|
@@ -34,25 +57,32 @@ export declare class SummaryTreeBuilder implements ISummaryTreeWithStats {
|
|
|
34
57
|
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
35
58
|
* @param snapshot - snapshot in ITree format
|
|
36
59
|
* @param fullTree - true to never use handles, even if id is specified
|
|
60
|
+
* @internal
|
|
37
61
|
*/
|
|
38
62
|
export declare function convertToSummaryTreeWithStats(snapshot: ITree, fullTree?: boolean): ISummaryTreeWithStats;
|
|
39
63
|
/**
|
|
40
64
|
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
41
65
|
* @param snapshot - snapshot in ITree format
|
|
42
66
|
* @param fullTree - true to never use handles, even if id is specified
|
|
67
|
+
* @internal
|
|
43
68
|
*/
|
|
44
69
|
export declare function convertToSummaryTree(snapshot: ITree, fullTree?: boolean): ISummarizeResult;
|
|
45
70
|
/**
|
|
46
71
|
* Converts ISnapshotTree to ISummaryTree format and tracks stats. This snapshot tree was
|
|
47
72
|
* was taken by serialize api in detached container.
|
|
48
73
|
* @param snapshot - snapshot in ISnapshotTree format
|
|
74
|
+
* @internal
|
|
49
75
|
*/
|
|
50
|
-
export declare function convertSnapshotTreeToSummaryTree(snapshot:
|
|
76
|
+
export declare function convertSnapshotTreeToSummaryTree(snapshot: ISnapshotTreeWithBlobContents): ISummaryTreeWithStats;
|
|
51
77
|
/**
|
|
52
78
|
* Converts ISummaryTree to ITree format. This is needed for back-compat while we get rid of snapshot.
|
|
53
79
|
* @param summaryTree - summary tree in ISummaryTree format
|
|
80
|
+
* @internal
|
|
54
81
|
*/
|
|
55
82
|
export declare function convertSummaryTreeToITree(summaryTree: ISummaryTree): ITree;
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
56
86
|
export declare class TelemetryContext implements ITelemetryContext {
|
|
57
87
|
private readonly telemetry;
|
|
58
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryUtils.d.ts","sourceRoot":"","sources":["../src/summaryUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAS7E,OAAO,EACN,KAAK,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EAGZ,
|
|
1
|
+
{"version":3,"file":"summaryUtils.d.ts","sourceRoot":"","sources":["../src/summaryUtils.ts"],"names":[],"mappings":"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"}
|
package/lib/summaryUtils.js
CHANGED
|
@@ -10,6 +10,7 @@ import { SummaryType, TreeEntry, } from "@fluidframework/protocol-definitions";
|
|
|
10
10
|
* Combines summary stats by adding their totals together.
|
|
11
11
|
* Returns empty stats if called without args.
|
|
12
12
|
* @param stats - stats to merge
|
|
13
|
+
* @internal
|
|
13
14
|
*/
|
|
14
15
|
export function mergeStats(...stats) {
|
|
15
16
|
const results = {
|
|
@@ -28,6 +29,9 @@ export function mergeStats(...stats) {
|
|
|
28
29
|
}
|
|
29
30
|
return results;
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
31
35
|
export function utf8ByteLength(str) {
|
|
32
36
|
// returns the byte length of an utf8 string
|
|
33
37
|
let s = str.length;
|
|
@@ -45,6 +49,9 @@ export function utf8ByteLength(str) {
|
|
|
45
49
|
}
|
|
46
50
|
return s;
|
|
47
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
48
55
|
export function getBlobSize(content) {
|
|
49
56
|
return typeof content === "string" ? utf8ByteLength(content) : content.byteLength;
|
|
50
57
|
}
|
|
@@ -70,11 +77,17 @@ function calculateStatsCore(summaryObject, stats) {
|
|
|
70
77
|
return;
|
|
71
78
|
}
|
|
72
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
73
83
|
export function calculateStats(summary) {
|
|
74
84
|
const stats = mergeStats();
|
|
75
85
|
calculateStatsCore(summary, stats);
|
|
76
86
|
return stats;
|
|
77
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
78
91
|
export function addBlobToSummary(summary, key, content) {
|
|
79
92
|
const blob = {
|
|
80
93
|
type: SummaryType.Blob,
|
|
@@ -84,14 +97,23 @@ export function addBlobToSummary(summary, key, content) {
|
|
|
84
97
|
summary.stats.blobNodeCount++;
|
|
85
98
|
summary.stats.totalBlobSize += getBlobSize(content);
|
|
86
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
87
103
|
export function addTreeToSummary(summary, key, summarizeResult) {
|
|
88
104
|
summary.summary.tree[key] = summarizeResult.summary;
|
|
89
105
|
summary.stats = mergeStats(summary.stats, summarizeResult.stats);
|
|
90
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
91
110
|
export function addSummarizeResultToSummary(summary, key, summarizeResult) {
|
|
92
111
|
summary.summary.tree[key] = summarizeResult.summary;
|
|
93
112
|
summary.stats = mergeStats(summary.stats, summarizeResult.stats);
|
|
94
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
95
117
|
export class SummaryTreeBuilder {
|
|
96
118
|
get summary() {
|
|
97
119
|
return {
|
|
@@ -141,6 +163,7 @@ export class SummaryTreeBuilder {
|
|
|
141
163
|
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
142
164
|
* @param snapshot - snapshot in ITree format
|
|
143
165
|
* @param fullTree - true to never use handles, even if id is specified
|
|
166
|
+
* @internal
|
|
144
167
|
*/
|
|
145
168
|
export function convertToSummaryTreeWithStats(snapshot, fullTree = false) {
|
|
146
169
|
const builder = new SummaryTreeBuilder();
|
|
@@ -176,6 +199,7 @@ export function convertToSummaryTreeWithStats(snapshot, fullTree = false) {
|
|
|
176
199
|
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
177
200
|
* @param snapshot - snapshot in ITree format
|
|
178
201
|
* @param fullTree - true to never use handles, even if id is specified
|
|
202
|
+
* @internal
|
|
179
203
|
*/
|
|
180
204
|
export function convertToSummaryTree(snapshot, fullTree = false) {
|
|
181
205
|
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
@@ -199,6 +223,7 @@ export function convertToSummaryTree(snapshot, fullTree = false) {
|
|
|
199
223
|
* Converts ISnapshotTree to ISummaryTree format and tracks stats. This snapshot tree was
|
|
200
224
|
* was taken by serialize api in detached container.
|
|
201
225
|
* @param snapshot - snapshot in ISnapshotTree format
|
|
226
|
+
* @internal
|
|
202
227
|
*/
|
|
203
228
|
export function convertSnapshotTreeToSummaryTree(snapshot) {
|
|
204
229
|
const builder = new SummaryTreeBuilder();
|
|
@@ -230,6 +255,7 @@ export function convertSnapshotTreeToSummaryTree(snapshot) {
|
|
|
230
255
|
/**
|
|
231
256
|
* Converts ISummaryTree to ITree format. This is needed for back-compat while we get rid of snapshot.
|
|
232
257
|
* @param summaryTree - summary tree in ISummaryTree format
|
|
258
|
+
* @internal
|
|
233
259
|
*/
|
|
234
260
|
export function convertSummaryTreeToITree(summaryTree) {
|
|
235
261
|
const entries = [];
|
|
@@ -268,6 +294,9 @@ export function convertSummaryTreeToITree(summaryTree) {
|
|
|
268
294
|
unreferenced: summaryTree.unreferenced,
|
|
269
295
|
};
|
|
270
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* @internal
|
|
299
|
+
*/
|
|
271
300
|
export class TelemetryContext {
|
|
272
301
|
constructor() {
|
|
273
302
|
this.telemetry = new Map();
|