@fluidframework/runtime-utils 2.0.0-rc.2.0.1 → 2.0.0-rc.3.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 +23 -0
- package/api-report/runtime-utils.api.md +10 -10
- package/dist/dataStoreHelpers.d.ts +2 -2
- package/dist/dataStoreHelpers.d.ts.map +1 -1
- package/dist/dataStoreHelpers.js +7 -7
- package/dist/dataStoreHelpers.js.map +1 -1
- package/dist/legacy.d.ts +18 -0
- package/dist/objectstoragepartition.js +2 -2
- package/dist/objectstoragepartition.js.map +1 -1
- package/dist/public.d.ts +12 -0
- package/dist/requestParser.d.ts.map +1 -1
- package/dist/requestParser.js +4 -0
- package/dist/requestParser.js.map +1 -1
- package/dist/runtimeFactoryHelper.d.ts +2 -2
- package/dist/runtimeFactoryHelper.d.ts.map +1 -1
- package/dist/runtimeFactoryHelper.js.map +1 -1
- package/dist/summaryUtils.d.ts +4 -3
- package/dist/summaryUtils.d.ts.map +1 -1
- package/dist/summaryUtils.js +7 -7
- package/dist/summaryUtils.js.map +1 -1
- package/dist/unpackUsedRoutes.js +2 -2
- package/dist/unpackUsedRoutes.js.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/dataStoreHelpers.d.ts +2 -2
- package/lib/dataStoreHelpers.d.ts.map +1 -1
- package/lib/dataStoreHelpers.js +3 -3
- package/lib/dataStoreHelpers.js.map +1 -1
- package/lib/legacy.d.ts +18 -0
- package/lib/objectstoragepartition.js +1 -1
- package/lib/objectstoragepartition.js.map +1 -1
- package/lib/public.d.ts +12 -0
- package/lib/requestParser.d.ts.map +1 -1
- package/lib/requestParser.js +4 -0
- package/lib/requestParser.js.map +1 -1
- package/lib/runtimeFactoryHelper.d.ts +2 -2
- package/lib/runtimeFactoryHelper.d.ts.map +1 -1
- package/lib/runtimeFactoryHelper.js.map +1 -1
- package/lib/summaryUtils.d.ts +4 -3
- package/lib/summaryUtils.d.ts.map +1 -1
- package/lib/summaryUtils.js +3 -3
- package/lib/summaryUtils.js.map +1 -1
- package/lib/unpackUsedRoutes.js +1 -1
- package/lib/unpackUsedRoutes.js.map +1 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +33 -54
- package/src/dataStoreHelpers.ts +4 -4
- package/src/objectstoragepartition.ts +1 -1
- package/src/requestParser.ts +1 -0
- package/src/runtimeFactoryHelper.ts +2 -2
- package/src/summaryUtils.ts +16 -12
- package/src/unpackUsedRoutes.ts +1 -1
- package/src/utils.ts +1 -1
- package/api-extractor-cjs.json +0 -8
- package/dist/runtime-utils-alpha.d.ts +0 -161
- package/dist/runtime-utils-beta.d.ts +0 -109
- package/dist/runtime-utils-public.d.ts +0 -109
- package/dist/runtime-utils-untrimmed.d.ts +0 -346
- package/lib/runtime-utils-alpha.d.ts +0 -161
- package/lib/runtime-utils-beta.d.ts +0 -109
- package/lib/runtime-utils-public.d.ts +0 -109
- package/lib/runtime-utils-untrimmed.d.ts +0 -346
- package/lib/test/dataStoreHelpers.spec.js +0 -29
- package/lib/test/dataStoreHelpers.spec.js.map +0 -1
- package/lib/test/requestParser.spec.js +0 -111
- package/lib/test/requestParser.spec.js.map +0 -1
- package/lib/test/runtimeFactoryHelper.spec.js +0 -44
- package/lib/test/runtimeFactoryHelper.spec.js.map +0 -1
- package/lib/test/summaryUtils.spec.js +0 -283
- package/lib/test/summaryUtils.spec.js.map +0 -1
- package/lib/test/types/validateRuntimeUtilsPrevious.generated.js +0 -58
- package/lib/test/types/validateRuntimeUtilsPrevious.generated.js.map +0 -1
- package/lib/test/utils.spec.js +0 -65
- package/lib/test/utils.spec.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -1,109 +0,0 @@
|
|
|
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 type { TelemetryBaseEventPropertyType } from '@fluidframework/core-interfaces';
|
|
26
|
-
|
|
27
|
-
/* Excluded from this release type: addBlobToSummary */
|
|
28
|
-
|
|
29
|
-
/* Excluded from this release type: addSummarizeResultToSummary */
|
|
30
|
-
|
|
31
|
-
/* Excluded from this release type: calculateStats */
|
|
32
|
-
|
|
33
|
-
/* Excluded from this release type: convertSnapshotTreeToSummaryTree */
|
|
34
|
-
|
|
35
|
-
/* Excluded from this release type: convertSummaryTreeToITree */
|
|
36
|
-
|
|
37
|
-
/* Excluded from this release type: convertToSummaryTree */
|
|
38
|
-
|
|
39
|
-
/* Excluded from this release type: convertToSummaryTreeWithStats */
|
|
40
|
-
|
|
41
|
-
/* Excluded from this release type: create404Response */
|
|
42
|
-
|
|
43
|
-
/* Excluded from this release type: createDataStoreFactory */
|
|
44
|
-
|
|
45
|
-
/* Excluded from this release type: createResponseError */
|
|
46
|
-
|
|
47
|
-
/* Excluded from this release type: encodeCompactIdToString */
|
|
48
|
-
|
|
49
|
-
/* Excluded from this release type: exceptionToResponse */
|
|
50
|
-
|
|
51
|
-
/* Excluded from this release type: Factory */
|
|
52
|
-
|
|
53
|
-
/* Excluded from this release type: GCDataBuilder */
|
|
54
|
-
|
|
55
|
-
/* Excluded from this release type: generateHandleContextPath */
|
|
56
|
-
|
|
57
|
-
/* Excluded from this release type: getBlobSize */
|
|
58
|
-
|
|
59
|
-
/* Excluded from this release type: getNormalizedObjectStoragePathParts */
|
|
60
|
-
|
|
61
|
-
/* Excluded from this release type: IContainerContext */
|
|
62
|
-
|
|
63
|
-
/* Excluded from this release type: IContainerRuntime */
|
|
64
|
-
|
|
65
|
-
/* Excluded from this release type: IFluidDataStoreFactory */
|
|
66
|
-
|
|
67
|
-
/* Excluded from this release type: IFluidDataStoreRegistry */
|
|
68
|
-
|
|
69
|
-
/* Excluded from this release type: IProvideFluidDataStoreRegistry */
|
|
70
|
-
|
|
71
|
-
/* Excluded from this release type: IRuntime */
|
|
72
|
-
|
|
73
|
-
/* Excluded from this release type: IRuntimeFactory */
|
|
74
|
-
|
|
75
|
-
/* Excluded from this release type: ISerializedHandle */
|
|
76
|
-
|
|
77
|
-
/* Excluded from this release type: ISnapshotTreeWithBlobContents */
|
|
78
|
-
|
|
79
|
-
/* Excluded from this release type: isSerializedHandle */
|
|
80
|
-
|
|
81
|
-
/* Excluded from this release type: ISummarizeResult */
|
|
82
|
-
|
|
83
|
-
/* Excluded from this release type: listBlobsAtTreePath */
|
|
84
|
-
|
|
85
|
-
/* Excluded from this release type: mergeStats */
|
|
86
|
-
|
|
87
|
-
/* Excluded from this release type: ObjectStoragePartition */
|
|
88
|
-
|
|
89
|
-
/* Excluded from this release type: processAttachMessageGCData */
|
|
90
|
-
|
|
91
|
-
/* Excluded from this release type: ReadAndParseBlob */
|
|
92
|
-
|
|
93
|
-
/* Excluded from this release type: RequestParser */
|
|
94
|
-
|
|
95
|
-
/* Excluded from this release type: responseToException */
|
|
96
|
-
|
|
97
|
-
/* Excluded from this release type: RuntimeFactoryHelper */
|
|
98
|
-
|
|
99
|
-
/* Excluded from this release type: seqFromTree */
|
|
100
|
-
|
|
101
|
-
/* Excluded from this release type: SummaryTreeBuilder */
|
|
102
|
-
|
|
103
|
-
/* Excluded from this release type: TelemetryContext */
|
|
104
|
-
|
|
105
|
-
/* Excluded from this release type: unpackChildNodesUsedRoutes */
|
|
106
|
-
|
|
107
|
-
/* Excluded from this release type: utf8ByteLength */
|
|
108
|
-
|
|
109
|
-
export { }
|
|
@@ -1,346 +0,0 @@
|
|
|
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 type { TelemetryBaseEventPropertyType } 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 calculateStats(summary: SummaryObject): ISummaryStats;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Converts ISnapshotTree to ISummaryTree format and tracks stats. This snapshot tree was
|
|
44
|
-
* was taken by serialize api in detached container.
|
|
45
|
-
* @param snapshot - snapshot in ISnapshotTree format
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
export declare function convertSnapshotTreeToSummaryTree(snapshot: ISnapshotTreeWithBlobContents): ISummaryTreeWithStats;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Converts ISummaryTree to ITree format. This is needed for back-compat while we get rid of snapshot.
|
|
52
|
-
* @param summaryTree - summary tree in ISummaryTree format
|
|
53
|
-
* @internal
|
|
54
|
-
*/
|
|
55
|
-
export declare function convertSummaryTreeToITree(summaryTree: ISummaryTree): ITree;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
59
|
-
* @param snapshot - snapshot in ITree format
|
|
60
|
-
* @param fullTree - true to never use handles, even if id is specified
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
|
-
export declare function convertToSummaryTree(snapshot: ITree, fullTree?: boolean): ISummarizeResult;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
67
|
-
* @param snapshot - snapshot in ITree format
|
|
68
|
-
* @param fullTree - true to never use handles, even if id is specified
|
|
69
|
-
* @alpha
|
|
70
|
-
*/
|
|
71
|
-
export declare function convertToSummaryTreeWithStats(snapshot: ITree, fullTree?: boolean): ISummaryTreeWithStats;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @internal
|
|
75
|
-
*/
|
|
76
|
-
export declare const create404Response: (request: IRequest) => IResponse;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @internal
|
|
80
|
-
*/
|
|
81
|
-
export declare function createDataStoreFactory(type: string, factory: Factory | Promise<Factory>): IFluidDataStoreFactory & IFluidDataStoreRegistry;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @internal
|
|
85
|
-
*/
|
|
86
|
-
export declare function createResponseError(status: number, value: string, request: IRequest, headers?: {
|
|
87
|
-
[key: string]: any;
|
|
88
|
-
}): IResponse;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Encode compact ID (returned by IContainerRuntime.generateDocumentUniqueId()) to a compact string representation.
|
|
92
|
-
* While this is the main usage pattern, it works with any non-negative integer or a string.
|
|
93
|
-
* Strings are retured as is, and assumed to be UUIDs, i.e. unique enough to never overlap with
|
|
94
|
-
* numbers encoded as strings by this function. Any other strings are likely to run into collisions and should not be used!
|
|
95
|
-
* This function is useful in places where we serialize resulting ID as string and use them as strings, thus we are not
|
|
96
|
-
* gaining any efficiency from having a number type.
|
|
97
|
-
* We do not provide a decode function, so this API is only useful only result is stored and there is no need to go back to origianl form.
|
|
98
|
-
* @param idArg - input - either a non-negative integer or a string. Strings are returned as is, while numbers are encoded in compat form
|
|
99
|
-
* @param prefix - optinal string prefix
|
|
100
|
-
* @returns A string - representation of an input
|
|
101
|
-
* @internal
|
|
102
|
-
*/
|
|
103
|
-
export declare function encodeCompactIdToString(idArg: number | string, prefix?: string): string;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @internal
|
|
107
|
-
*/
|
|
108
|
-
export declare function exceptionToResponse(err: any): IResponse;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @internal
|
|
112
|
-
*/
|
|
113
|
-
export declare type Factory = IFluidDataStoreFactory & Partial<IProvideFluidDataStoreRegistry>;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Helper class to build the garbage collection data of a node by combining the data from multiple nodes.
|
|
117
|
-
* @internal
|
|
118
|
-
*/
|
|
119
|
-
export declare class GCDataBuilder implements IGarbageCollectionData {
|
|
120
|
-
private readonly gcNodesSet;
|
|
121
|
-
get gcNodes(): {
|
|
122
|
-
[id: string]: string[];
|
|
123
|
-
};
|
|
124
|
-
addNode(id: string, outboundRoutes: string[]): void;
|
|
125
|
-
/**
|
|
126
|
-
* Adds the given GC nodes. It does the following:
|
|
127
|
-
* - Normalizes the ids of the given nodes.
|
|
128
|
-
* - Prefixes the given `prefixId` to the given nodes' ids.
|
|
129
|
-
* - Adds the outbound routes of the nodes against the normalized and prefixed id.
|
|
130
|
-
*/
|
|
131
|
-
prefixAndAddNodes(prefixId: string, gcNodes: {
|
|
132
|
-
[id: string]: string[];
|
|
133
|
-
}): void;
|
|
134
|
-
addNodes(gcNodes: {
|
|
135
|
-
[id: string]: string[];
|
|
136
|
-
}): void;
|
|
137
|
-
/**
|
|
138
|
-
* Adds the given outbound route to the outbound routes of all GC nodes.
|
|
139
|
-
*/
|
|
140
|
-
addRouteToAllNodes(outboundRoute: string): void;
|
|
141
|
-
getGCData(): IGarbageCollectionData;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Generates the absolute path for a Fluid object given its path and its parent routeContext.
|
|
146
|
-
* @param path - The path to the Fluid object relative to the route context.
|
|
147
|
-
* @param routeContext - The route context that contains the Fluid object.
|
|
148
|
-
* @returns The absolute path to the Fluid object from the root of the Container.
|
|
149
|
-
* @internal
|
|
150
|
-
*/
|
|
151
|
-
export declare function generateHandleContextPath(path: string, routeContext?: IFluidHandleContext): string;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @internal
|
|
155
|
-
*/
|
|
156
|
-
export declare function getBlobSize(content: ISummaryBlob["content"]): number;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* @internal
|
|
160
|
-
*/
|
|
161
|
-
export declare function getNormalizedObjectStoragePathParts(path: string): string[];
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* JSON serialized form of an IFluidHandle
|
|
165
|
-
* @internal
|
|
166
|
-
*/
|
|
167
|
-
export declare interface ISerializedHandle {
|
|
168
|
-
type: "__fluid_handle__";
|
|
169
|
-
url: string;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Is the input object a @see ISerializedHandle?
|
|
174
|
-
* @internal
|
|
175
|
-
*/
|
|
176
|
-
export declare const isSerializedHandle: (value: any) => value is ISerializedHandle;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @internal
|
|
180
|
-
*/
|
|
181
|
-
export declare function listBlobsAtTreePath(inputTree: ITree | undefined, path: string): Promise<string[]>;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Combines summary stats by adding their totals together.
|
|
185
|
-
* Returns empty stats if called without args.
|
|
186
|
-
* @param stats - stats to merge
|
|
187
|
-
* @internal
|
|
188
|
-
*/
|
|
189
|
-
export declare function mergeStats(...stats: ISummaryStats[]): ISummaryStats;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Returns a new IChannelStorageService that resolves the given `path` as root.
|
|
193
|
-
* @internal
|
|
194
|
-
*/
|
|
195
|
-
export declare class ObjectStoragePartition implements IChannelStorageService {
|
|
196
|
-
private readonly storage;
|
|
197
|
-
private readonly path;
|
|
198
|
-
constructor(storage: IChannelStorageService, path: string);
|
|
199
|
-
readBlob(path: string): Promise<ArrayBufferLike>;
|
|
200
|
-
contains(path: string): Promise<boolean>;
|
|
201
|
-
list(path: string): Promise<string[]>;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Looks in the given attach message snapshot for the .gcdata blob, which would
|
|
206
|
-
* contain the initial GC Data for the node being attached.
|
|
207
|
-
* If it finds it, it notifies GC of all the new outbound routes being added by the attach.
|
|
208
|
-
*
|
|
209
|
-
* @param snapshot - The snapshot from the attach message
|
|
210
|
-
* @param addedGCOutboundRoute - Callback to notify GC of a new outbound route.
|
|
211
|
-
* IMPORTANT: addedGCOutboundRoute's param nodeId is "/" for the attaching node itself, or "/<id>" for its children.
|
|
212
|
-
*
|
|
213
|
-
* @returns true if it found/processed GC Data, false otherwise
|
|
214
|
-
*
|
|
215
|
-
* @internal
|
|
216
|
-
*/
|
|
217
|
-
export declare function processAttachMessageGCData(snapshot: ITree | null, addedGCOutboundRoute: (fromNodeId: string, toPath: string) => void): boolean;
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Reads a blob from storage and parses it from JSON.
|
|
221
|
-
*
|
|
222
|
-
* @internal
|
|
223
|
-
*/
|
|
224
|
-
export declare type ReadAndParseBlob = <T>(id: string) => Promise<T>;
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* The Request Parser takes an IRequest provides parsing and sub request creation
|
|
228
|
-
* @alpha
|
|
229
|
-
*/
|
|
230
|
-
export declare class RequestParser implements IRequest {
|
|
231
|
-
private readonly request;
|
|
232
|
-
/**
|
|
233
|
-
* Splits the path of the url and decodes each path part
|
|
234
|
-
* @param url - the url to get path parts of
|
|
235
|
-
*/
|
|
236
|
-
static getPathParts(url: string): readonly string[];
|
|
237
|
-
private requestPathParts;
|
|
238
|
-
readonly query: string;
|
|
239
|
-
static create(request: Readonly<IRequest>): RequestParser;
|
|
240
|
-
protected constructor(request: Readonly<IRequest>);
|
|
241
|
-
get url(): string;
|
|
242
|
-
get headers(): IRequestHeader | undefined;
|
|
243
|
-
/**
|
|
244
|
-
* Returns the decoded path parts of the request's url
|
|
245
|
-
*/
|
|
246
|
-
get pathParts(): readonly string[];
|
|
247
|
-
/**
|
|
248
|
-
* Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.
|
|
249
|
-
* @param elements - number of elements in path
|
|
250
|
-
*/
|
|
251
|
-
isLeaf(elements: number): boolean;
|
|
252
|
-
/**
|
|
253
|
-
* Creates a sub request starting at a specific path part of this request's url
|
|
254
|
-
* The sub request url always has a leading slash, and always include query params if original url has any
|
|
255
|
-
* e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams
|
|
256
|
-
* createSubRequest(1) is /b/?queryParams
|
|
257
|
-
* createSubRequest(2) is /?queryParams
|
|
258
|
-
* createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception
|
|
259
|
-
*
|
|
260
|
-
* note: query params are not counted towards path parts.
|
|
261
|
-
*
|
|
262
|
-
* @param startingPathIndex - The index of the first path part of the sub request
|
|
263
|
-
*/
|
|
264
|
-
createSubRequest(startingPathIndex: number): IRequest;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* @internal
|
|
269
|
-
*/
|
|
270
|
-
export declare function responseToException(response: IResponse, request: IRequest): Error;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* @alpha
|
|
274
|
-
*/
|
|
275
|
-
export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
|
|
276
|
-
get IRuntimeFactory(): this;
|
|
277
|
-
instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
|
|
278
|
-
abstract preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & T>;
|
|
279
|
-
instantiateFirstTime(_runtime: T): Promise<void>;
|
|
280
|
-
instantiateFromExisting(_runtime: T): Promise<void>;
|
|
281
|
-
hasInitialized(_runtime: T): Promise<void>;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Fetches the sequence number of the snapshot tree by examining the protocol.
|
|
286
|
-
* @param tree - snapshot tree to examine
|
|
287
|
-
* @param readAndParseBlob - function to read blob contents from storage
|
|
288
|
-
* and parse the result from JSON.
|
|
289
|
-
* @internal
|
|
290
|
-
*/
|
|
291
|
-
export declare function seqFromTree(tree: ISnapshotTree, readAndParseBlob: ReadAndParseBlob): Promise<number>;
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* @alpha
|
|
295
|
-
*/
|
|
296
|
-
export declare class SummaryTreeBuilder implements ISummaryTreeWithStats {
|
|
297
|
-
private attachmentCounter;
|
|
298
|
-
get summary(): ISummaryTree;
|
|
299
|
-
get stats(): Readonly<ISummaryStats>;
|
|
300
|
-
constructor();
|
|
301
|
-
private readonly summaryTree;
|
|
302
|
-
private summaryStats;
|
|
303
|
-
addBlob(key: string, content: string | Uint8Array): void;
|
|
304
|
-
addHandle(key: string, handleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment, handle: string): void;
|
|
305
|
-
addWithStats(key: string, summarizeResult: ISummarizeResult): void;
|
|
306
|
-
addAttachment(id: string): void;
|
|
307
|
-
getSummaryTree(): ISummaryTreeWithStats;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* @internal
|
|
312
|
-
*/
|
|
313
|
-
export declare class TelemetryContext implements ITelemetryContext {
|
|
314
|
-
private readonly telemetry;
|
|
315
|
-
/**
|
|
316
|
-
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.set}
|
|
317
|
-
*/
|
|
318
|
-
set(prefix: string, property: string, value: TelemetryBaseEventPropertyType): void;
|
|
319
|
-
/**
|
|
320
|
-
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.setMultiple}
|
|
321
|
-
*/
|
|
322
|
-
setMultiple(prefix: string, property: string, values: Record<string, TelemetryBaseEventPropertyType>): void;
|
|
323
|
-
/**
|
|
324
|
-
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.get}
|
|
325
|
-
*/
|
|
326
|
-
get(prefix: string, property: string): TelemetryBaseEventPropertyType;
|
|
327
|
-
/**
|
|
328
|
-
* {@inheritDoc @fluidframework/runtime-definitions#ITelemetryContext.serialize}
|
|
329
|
-
*/
|
|
330
|
-
serialize(): string;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Helper function that unpacks the used routes of children from a given node's used routes.
|
|
335
|
-
* @param usedRoutes - The used routes of a node.
|
|
336
|
-
* @returns A map of used routes of each children of the the given node.
|
|
337
|
-
* @internal
|
|
338
|
-
*/
|
|
339
|
-
export declare function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]): Map<string, string[]>;
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* @internal
|
|
343
|
-
*/
|
|
344
|
-
export declare function utf8ByteLength(str: string): number;
|
|
345
|
-
|
|
346
|
-
export { }
|
|
@@ -1,161 +0,0 @@
|
|
|
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 type { TelemetryBaseEventPropertyType } from '@fluidframework/core-interfaces';
|
|
26
|
-
|
|
27
|
-
/* Excluded from this release type: addBlobToSummary */
|
|
28
|
-
|
|
29
|
-
/* Excluded from this release type: addSummarizeResultToSummary */
|
|
30
|
-
|
|
31
|
-
/* Excluded from this release type: calculateStats */
|
|
32
|
-
|
|
33
|
-
/* Excluded from this release type: convertSnapshotTreeToSummaryTree */
|
|
34
|
-
|
|
35
|
-
/* Excluded from this release type: convertSummaryTreeToITree */
|
|
36
|
-
|
|
37
|
-
/* Excluded from this release type: convertToSummaryTree */
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Converts snapshot ITree to ISummaryTree format and tracks stats.
|
|
41
|
-
* @param snapshot - snapshot in ITree format
|
|
42
|
-
* @param fullTree - true to never use handles, even if id is specified
|
|
43
|
-
* @alpha
|
|
44
|
-
*/
|
|
45
|
-
export declare function convertToSummaryTreeWithStats(snapshot: ITree, fullTree?: boolean): ISummaryTreeWithStats;
|
|
46
|
-
|
|
47
|
-
/* Excluded from this release type: create404Response */
|
|
48
|
-
|
|
49
|
-
/* Excluded from this release type: createDataStoreFactory */
|
|
50
|
-
|
|
51
|
-
/* Excluded from this release type: createResponseError */
|
|
52
|
-
|
|
53
|
-
/* Excluded from this release type: encodeCompactIdToString */
|
|
54
|
-
|
|
55
|
-
/* Excluded from this release type: exceptionToResponse */
|
|
56
|
-
|
|
57
|
-
/* Excluded from this release type: Factory */
|
|
58
|
-
|
|
59
|
-
/* Excluded from this release type: GCDataBuilder */
|
|
60
|
-
|
|
61
|
-
/* Excluded from this release type: generateHandleContextPath */
|
|
62
|
-
|
|
63
|
-
/* Excluded from this release type: getBlobSize */
|
|
64
|
-
|
|
65
|
-
/* Excluded from this release type: getNormalizedObjectStoragePathParts */
|
|
66
|
-
|
|
67
|
-
/* Excluded from this release type: ISerializedHandle */
|
|
68
|
-
|
|
69
|
-
/* Excluded from this release type: isSerializedHandle */
|
|
70
|
-
|
|
71
|
-
/* Excluded from this release type: listBlobsAtTreePath */
|
|
72
|
-
|
|
73
|
-
/* Excluded from this release type: mergeStats */
|
|
74
|
-
|
|
75
|
-
/* Excluded from this release type: ObjectStoragePartition */
|
|
76
|
-
|
|
77
|
-
/* Excluded from this release type: processAttachMessageGCData */
|
|
78
|
-
|
|
79
|
-
/* Excluded from this release type: ReadAndParseBlob */
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The Request Parser takes an IRequest provides parsing and sub request creation
|
|
83
|
-
* @alpha
|
|
84
|
-
*/
|
|
85
|
-
export declare class RequestParser implements IRequest {
|
|
86
|
-
private readonly request;
|
|
87
|
-
/**
|
|
88
|
-
* Splits the path of the url and decodes each path part
|
|
89
|
-
* @param url - the url to get path parts of
|
|
90
|
-
*/
|
|
91
|
-
static getPathParts(url: string): readonly string[];
|
|
92
|
-
private requestPathParts;
|
|
93
|
-
readonly query: string;
|
|
94
|
-
static create(request: Readonly<IRequest>): RequestParser;
|
|
95
|
-
protected constructor(request: Readonly<IRequest>);
|
|
96
|
-
get url(): string;
|
|
97
|
-
get headers(): IRequestHeader | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* Returns the decoded path parts of the request's url
|
|
100
|
-
*/
|
|
101
|
-
get pathParts(): readonly string[];
|
|
102
|
-
/**
|
|
103
|
-
* Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.
|
|
104
|
-
* @param elements - number of elements in path
|
|
105
|
-
*/
|
|
106
|
-
isLeaf(elements: number): boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Creates a sub request starting at a specific path part of this request's url
|
|
109
|
-
* The sub request url always has a leading slash, and always include query params if original url has any
|
|
110
|
-
* e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams
|
|
111
|
-
* createSubRequest(1) is /b/?queryParams
|
|
112
|
-
* createSubRequest(2) is /?queryParams
|
|
113
|
-
* createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception
|
|
114
|
-
*
|
|
115
|
-
* note: query params are not counted towards path parts.
|
|
116
|
-
*
|
|
117
|
-
* @param startingPathIndex - The index of the first path part of the sub request
|
|
118
|
-
*/
|
|
119
|
-
createSubRequest(startingPathIndex: number): IRequest;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* Excluded from this release type: responseToException */
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @alpha
|
|
126
|
-
*/
|
|
127
|
-
export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
|
|
128
|
-
get IRuntimeFactory(): this;
|
|
129
|
-
instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
|
|
130
|
-
abstract preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & T>;
|
|
131
|
-
instantiateFirstTime(_runtime: T): Promise<void>;
|
|
132
|
-
instantiateFromExisting(_runtime: T): Promise<void>;
|
|
133
|
-
hasInitialized(_runtime: T): Promise<void>;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* Excluded from this release type: seqFromTree */
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* @alpha
|
|
140
|
-
*/
|
|
141
|
-
export declare class SummaryTreeBuilder implements ISummaryTreeWithStats {
|
|
142
|
-
private attachmentCounter;
|
|
143
|
-
get summary(): ISummaryTree;
|
|
144
|
-
get stats(): Readonly<ISummaryStats>;
|
|
145
|
-
constructor();
|
|
146
|
-
private readonly summaryTree;
|
|
147
|
-
private summaryStats;
|
|
148
|
-
addBlob(key: string, content: string | Uint8Array): void;
|
|
149
|
-
addHandle(key: string, handleType: SummaryType.Tree | SummaryType.Blob | SummaryType.Attachment, handle: string): void;
|
|
150
|
-
addWithStats(key: string, summarizeResult: ISummarizeResult): void;
|
|
151
|
-
addAttachment(id: string): void;
|
|
152
|
-
getSummaryTree(): ISummaryTreeWithStats;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/* Excluded from this release type: TelemetryContext */
|
|
156
|
-
|
|
157
|
-
/* Excluded from this release type: unpackChildNodesUsedRoutes */
|
|
158
|
-
|
|
159
|
-
/* Excluded from this release type: utf8ByteLength */
|
|
160
|
-
|
|
161
|
-
export { }
|