@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.
Files changed (103) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +3 -3
  4. package/api-report/runtime-utils.api.md +31 -35
  5. package/dist/dataStoreHandleContextUtils.d.ts +1 -0
  6. package/dist/dataStoreHandleContextUtils.d.ts.map +1 -1
  7. package/dist/dataStoreHandleContextUtils.js +1 -0
  8. package/dist/dataStoreHandleContextUtils.js.map +1 -1
  9. package/dist/dataStoreHelpers.d.ts +17 -3
  10. package/dist/dataStoreHelpers.d.ts.map +1 -1
  11. package/dist/dataStoreHelpers.js +14 -14
  12. package/dist/dataStoreHelpers.js.map +1 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/objectstoragepartition.d.ts +1 -0
  18. package/dist/objectstoragepartition.d.ts.map +1 -1
  19. package/dist/objectstoragepartition.js +1 -0
  20. package/dist/objectstoragepartition.js.map +1 -1
  21. package/dist/objectstorageutils.d.ts +6 -0
  22. package/dist/objectstorageutils.d.ts.map +1 -1
  23. package/dist/objectstorageutils.js +6 -0
  24. package/dist/objectstorageutils.js.map +1 -1
  25. package/dist/requestParser.d.ts +1 -0
  26. package/dist/requestParser.d.ts.map +1 -1
  27. package/dist/requestParser.js +1 -0
  28. package/dist/requestParser.js.map +1 -1
  29. package/dist/runtime-utils-alpha.d.ts +134 -0
  30. package/dist/runtime-utils-beta.d.ts +121 -0
  31. package/dist/runtime-utils-public.d.ts +121 -0
  32. package/dist/runtime-utils-untrimmed.d.ts +306 -0
  33. package/dist/runtimeFactoryHelper.d.ts +3 -0
  34. package/dist/runtimeFactoryHelper.d.ts.map +1 -1
  35. package/dist/runtimeFactoryHelper.js +3 -0
  36. package/dist/runtimeFactoryHelper.js.map +1 -1
  37. package/dist/summaryUtils.d.ts +32 -2
  38. package/dist/summaryUtils.d.ts.map +1 -1
  39. package/dist/summaryUtils.js +29 -0
  40. package/dist/summaryUtils.js.map +1 -1
  41. package/dist/unpackUsedRoutes.d.ts +2 -1
  42. package/dist/unpackUsedRoutes.d.ts.map +1 -1
  43. package/dist/unpackUsedRoutes.js +1 -0
  44. package/dist/unpackUsedRoutes.js.map +1 -1
  45. package/dist/utils.d.ts +6 -1
  46. package/dist/utils.d.ts.map +1 -1
  47. package/dist/utils.js +1 -0
  48. package/dist/utils.js.map +1 -1
  49. package/lib/dataStoreHandleContextUtils.d.ts +1 -0
  50. package/lib/dataStoreHandleContextUtils.d.ts.map +1 -1
  51. package/lib/dataStoreHandleContextUtils.js +1 -0
  52. package/lib/dataStoreHandleContextUtils.js.map +1 -1
  53. package/lib/dataStoreHelpers.d.ts +17 -3
  54. package/lib/dataStoreHelpers.d.ts.map +1 -1
  55. package/lib/dataStoreHelpers.js +13 -12
  56. package/lib/dataStoreHelpers.js.map +1 -1
  57. package/lib/index.d.ts +1 -1
  58. package/lib/index.d.ts.map +1 -1
  59. package/lib/index.js +1 -1
  60. package/lib/index.js.map +1 -1
  61. package/lib/objectstoragepartition.d.ts +1 -0
  62. package/lib/objectstoragepartition.d.ts.map +1 -1
  63. package/lib/objectstoragepartition.js +1 -0
  64. package/lib/objectstoragepartition.js.map +1 -1
  65. package/lib/objectstorageutils.d.ts +6 -0
  66. package/lib/objectstorageutils.d.ts.map +1 -1
  67. package/lib/objectstorageutils.js +6 -0
  68. package/lib/objectstorageutils.js.map +1 -1
  69. package/lib/requestParser.d.ts +1 -0
  70. package/lib/requestParser.d.ts.map +1 -1
  71. package/lib/requestParser.js +1 -0
  72. package/lib/requestParser.js.map +1 -1
  73. package/lib/runtime-utils-alpha.d.ts +134 -0
  74. package/lib/runtime-utils-beta.d.ts +121 -0
  75. package/lib/runtime-utils-public.d.ts +121 -0
  76. package/lib/runtime-utils-untrimmed.d.ts +306 -0
  77. package/lib/runtimeFactoryHelper.d.ts +3 -0
  78. package/lib/runtimeFactoryHelper.d.ts.map +1 -1
  79. package/lib/runtimeFactoryHelper.js +3 -0
  80. package/lib/runtimeFactoryHelper.js.map +1 -1
  81. package/lib/summaryUtils.d.ts +32 -2
  82. package/lib/summaryUtils.d.ts.map +1 -1
  83. package/lib/summaryUtils.js +29 -0
  84. package/lib/summaryUtils.js.map +1 -1
  85. package/lib/unpackUsedRoutes.d.ts +2 -1
  86. package/lib/unpackUsedRoutes.d.ts.map +1 -1
  87. package/lib/unpackUsedRoutes.js +1 -0
  88. package/lib/unpackUsedRoutes.js.map +1 -1
  89. package/lib/utils.d.ts +6 -1
  90. package/lib/utils.d.ts.map +1 -1
  91. package/lib/utils.js +1 -0
  92. package/lib/utils.js.map +1 -1
  93. package/package.json +41 -17
  94. package/src/dataStoreHandleContextUtils.ts +1 -0
  95. package/src/dataStoreHelpers.ts +17 -19
  96. package/src/index.ts +0 -1
  97. package/src/objectstoragepartition.ts +1 -0
  98. package/src/objectstorageutils.ts +6 -0
  99. package/src/requestParser.ts +1 -0
  100. package/src/runtimeFactoryHelper.ts +3 -0
  101. package/src/summaryUtils.ts +35 -4
  102. package/src/unpackUsedRoutes.ts +2 -1
  103. package/src/utils.ts +6 -1
@@ -0,0 +1,134 @@
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
+ /* Excluded from this release type: addBlobToSummary */
28
+
29
+ /* Excluded from this release type: addSummarizeResultToSummary */
30
+
31
+ /* Excluded from this release type: addTreeToSummary */
32
+
33
+ /* Excluded from this release type: calculateStats */
34
+
35
+ /* Excluded from this release type: convertSnapshotTreeToSummaryTree */
36
+
37
+ /* Excluded from this release type: convertSummaryTreeToITree */
38
+
39
+ /* Excluded from this release type: convertToSummaryTree */
40
+
41
+ /* Excluded from this release type: convertToSummaryTreeWithStats */
42
+
43
+ /* Excluded from this release type: create404Response */
44
+
45
+ /* Excluded from this release type: createDataStoreFactory */
46
+
47
+ /* Excluded from this release type: createResponseError */
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: listBlobsAtTreePath */
62
+
63
+ /* Excluded from this release type: mergeStats */
64
+
65
+ /* Excluded from this release type: ObjectStoragePartition */
66
+
67
+ /* Excluded from this release type: ReadAndParseBlob */
68
+
69
+ /**
70
+ * The Request Parser takes an IRequest provides parsing and sub request creation
71
+ * @alpha
72
+ */
73
+ export declare class RequestParser implements IRequest {
74
+ private readonly request;
75
+ /**
76
+ * Splits the path of the url and decodes each path part
77
+ * @param url - the url to get path parts of
78
+ */
79
+ static getPathParts(url: string): readonly string[];
80
+ private requestPathParts;
81
+ readonly query: string;
82
+ static create(request: Readonly<IRequest>): RequestParser;
83
+ protected constructor(request: Readonly<IRequest>);
84
+ get url(): string;
85
+ get headers(): IRequestHeader | undefined;
86
+ /**
87
+ * Returns the decoded path parts of the request's url
88
+ */
89
+ get pathParts(): readonly string[];
90
+ /**
91
+ * Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.
92
+ * @param elements - number of elements in path
93
+ */
94
+ isLeaf(elements: number): boolean;
95
+ /**
96
+ * Creates a sub request starting at a specific path part of this request's url
97
+ * The sub request url always has a leading slash, and always include query params if original url has any
98
+ * e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams
99
+ * createSubRequest(1) is /b/?queryParams
100
+ * createSubRequest(2) is /?queryParams
101
+ * createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception
102
+ *
103
+ * note: query params are not counted towards path parts.
104
+ *
105
+ * @param startingPathIndex - The index of the first path part of the sub request
106
+ */
107
+ createSubRequest(startingPathIndex: number): IRequest;
108
+ }
109
+
110
+ /* Excluded from this release type: responseToException */
111
+
112
+ /**
113
+ * @alpha
114
+ */
115
+ export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
116
+ get IRuntimeFactory(): this;
117
+ instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
118
+ abstract preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & T>;
119
+ instantiateFirstTime(_runtime: T): Promise<void>;
120
+ instantiateFromExisting(_runtime: T): Promise<void>;
121
+ hasInitialized(_runtime: T): Promise<void>;
122
+ }
123
+
124
+ /* Excluded from this release type: seqFromTree */
125
+
126
+ /* Excluded from this release type: SummaryTreeBuilder */
127
+
128
+ /* Excluded from this release type: TelemetryContext */
129
+
130
+ /* Excluded from this release type: unpackChildNodesUsedRoutes */
131
+
132
+ /* Excluded from this release type: utf8ByteLength */
133
+
134
+ export { }
@@ -0,0 +1,121 @@
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
+ /* Excluded from this release type: addBlobToSummary */
28
+
29
+ /* Excluded from this release type: addSummarizeResultToSummary */
30
+
31
+ /* Excluded from this release type: addTreeToSummary */
32
+
33
+ /* Excluded from this release type: calculateStats */
34
+
35
+ /* Excluded from this release type: convertSnapshotTreeToSummaryTree */
36
+
37
+ /* Excluded from this release type: convertSummaryTreeToITree */
38
+
39
+ /* Excluded from this release type: convertToSummaryTree */
40
+
41
+ /* Excluded from this release type: convertToSummaryTreeWithStats */
42
+
43
+ /* Excluded from this release type: create404Response */
44
+
45
+ /* Excluded from this release type: createDataStoreFactory */
46
+
47
+ /* Excluded from this release type: createResponseError */
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: IChannelStorageService */
62
+
63
+ /* Excluded from this release type: IContainerContext */
64
+
65
+ /* Excluded from this release type: IContainerRuntime */
66
+
67
+ /* Excluded from this release type: IFluidDataStoreFactory */
68
+
69
+ /* Excluded from this release type: IFluidDataStoreRegistry */
70
+
71
+ /* Excluded from this release type: IFluidHandleContext */
72
+
73
+ /* Excluded from this release type: IGarbageCollectionData */
74
+
75
+ /* Excluded from this release type: IProvideFluidDataStoreRegistry */
76
+
77
+ /* Excluded from this release type: IRequest */
78
+
79
+ /* Excluded from this release type: IResponse */
80
+
81
+ /* Excluded from this release type: IRuntime */
82
+
83
+ /* Excluded from this release type: IRuntimeFactory */
84
+
85
+ /* Excluded from this release type: ISnapshotTreeWithBlobContents */
86
+
87
+ /* Excluded from this release type: ISummarizeResult */
88
+
89
+ /* Excluded from this release type: ISummaryStats */
90
+
91
+ /* Excluded from this release type: ISummaryTreeWithStats */
92
+
93
+ /* Excluded from this release type: ITelemetryContext */
94
+
95
+ /* Excluded from this release type: listBlobsAtTreePath */
96
+
97
+ /* Excluded from this release type: mergeStats */
98
+
99
+ /* Excluded from this release type: ObjectStoragePartition */
100
+
101
+ /* Excluded from this release type: ReadAndParseBlob */
102
+
103
+ /* Excluded from this release type: RequestParser */
104
+
105
+ /* Excluded from this release type: responseToException */
106
+
107
+ /* Excluded from this release type: RuntimeFactoryHelper */
108
+
109
+ /* Excluded from this release type: seqFromTree */
110
+
111
+ /* Excluded from this release type: SummaryTreeBuilder */
112
+
113
+ /* Excluded from this release type: TelemetryContext */
114
+
115
+ /* Excluded from this release type: TelemetryEventPropertyType */
116
+
117
+ /* Excluded from this release type: unpackChildNodesUsedRoutes */
118
+
119
+ /* Excluded from this release type: utf8ByteLength */
120
+
121
+ export { }
@@ -0,0 +1,121 @@
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
+ /* Excluded from this release type: addBlobToSummary */
28
+
29
+ /* Excluded from this release type: addSummarizeResultToSummary */
30
+
31
+ /* Excluded from this release type: addTreeToSummary */
32
+
33
+ /* Excluded from this release type: calculateStats */
34
+
35
+ /* Excluded from this release type: convertSnapshotTreeToSummaryTree */
36
+
37
+ /* Excluded from this release type: convertSummaryTreeToITree */
38
+
39
+ /* Excluded from this release type: convertToSummaryTree */
40
+
41
+ /* Excluded from this release type: convertToSummaryTreeWithStats */
42
+
43
+ /* Excluded from this release type: create404Response */
44
+
45
+ /* Excluded from this release type: createDataStoreFactory */
46
+
47
+ /* Excluded from this release type: createResponseError */
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: IChannelStorageService */
62
+
63
+ /* Excluded from this release type: IContainerContext */
64
+
65
+ /* Excluded from this release type: IContainerRuntime */
66
+
67
+ /* Excluded from this release type: IFluidDataStoreFactory */
68
+
69
+ /* Excluded from this release type: IFluidDataStoreRegistry */
70
+
71
+ /* Excluded from this release type: IFluidHandleContext */
72
+
73
+ /* Excluded from this release type: IGarbageCollectionData */
74
+
75
+ /* Excluded from this release type: IProvideFluidDataStoreRegistry */
76
+
77
+ /* Excluded from this release type: IRequest */
78
+
79
+ /* Excluded from this release type: IResponse */
80
+
81
+ /* Excluded from this release type: IRuntime */
82
+
83
+ /* Excluded from this release type: IRuntimeFactory */
84
+
85
+ /* Excluded from this release type: ISnapshotTreeWithBlobContents */
86
+
87
+ /* Excluded from this release type: ISummarizeResult */
88
+
89
+ /* Excluded from this release type: ISummaryStats */
90
+
91
+ /* Excluded from this release type: ISummaryTreeWithStats */
92
+
93
+ /* Excluded from this release type: ITelemetryContext */
94
+
95
+ /* Excluded from this release type: listBlobsAtTreePath */
96
+
97
+ /* Excluded from this release type: mergeStats */
98
+
99
+ /* Excluded from this release type: ObjectStoragePartition */
100
+
101
+ /* Excluded from this release type: ReadAndParseBlob */
102
+
103
+ /* Excluded from this release type: RequestParser */
104
+
105
+ /* Excluded from this release type: responseToException */
106
+
107
+ /* Excluded from this release type: RuntimeFactoryHelper */
108
+
109
+ /* Excluded from this release type: seqFromTree */
110
+
111
+ /* Excluded from this release type: SummaryTreeBuilder */
112
+
113
+ /* Excluded from this release type: TelemetryContext */
114
+
115
+ /* Excluded from this release type: TelemetryEventPropertyType */
116
+
117
+ /* Excluded from this release type: unpackChildNodesUsedRoutes */
118
+
119
+ /* Excluded from this release type: utf8ByteLength */
120
+
121
+ export { }
@@ -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 { }