@fluidframework/runtime-utils 2.0.0-dev.7.4.0.217212 → 2.0.0-dev.7.4.0.221926

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/runtime-utils
2
2
 
3
+ ## 2.0.0-internal.7.4.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.7.3.0
4
8
 
5
9
  Dependency updates only.
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
3
  "extends": "../../../common/build/build-common/api-extractor-base.json",
4
- "dtsRollup": {
5
- "enabled": true
6
- },
7
4
  "messages": {
8
5
  "extractorMessageReporting": {
9
6
  // TODO: Add missing documentation and remove this rule override
@@ -124,7 +124,7 @@ export type ReadAndParseBlob = <T>(id: string) => Promise<T>;
124
124
  // @internal @deprecated (undocumented)
125
125
  export function requestFluidObject<T = FluidObject>(router: IFluidRouter, url: string | IRequest): Promise<T>;
126
126
 
127
- // @internal
127
+ // @alpha
128
128
  export class RequestParser implements IRequest {
129
129
  protected constructor(request: Readonly<IRequest>);
130
130
  // (undocumented)
@@ -144,7 +144,7 @@ export class RequestParser implements IRequest {
144
144
  // @internal (undocumented)
145
145
  export function responseToException(response: IResponse, request: IRequest): Error;
146
146
 
147
- // @internal (undocumented)
147
+ // @alpha (undocumented)
148
148
  export abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
149
149
  // (undocumented)
150
150
  hasInitialized(_runtime: T): Promise<void>;
@@ -195,7 +195,7 @@ export class TelemetryContext implements ITelemetryContext {
195
195
  }
196
196
 
197
197
  // @internal
198
- export function unpackChildNodesUsedRoutes(usedRoutes: string[]): Map<string, string[]>;
198
+ export function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]): Map<string, string[]>;
199
199
 
200
200
  // @internal (undocumented)
201
201
  export function utf8ByteLength(str: string): number;
@@ -5,7 +5,7 @@
5
5
  import { IRequest, IRequestHeader } from "@fluidframework/core-interfaces";
6
6
  /**
7
7
  * The Request Parser takes an IRequest provides parsing and sub request creation
8
- * @internal
8
+ * @alpha
9
9
  */
10
10
  export declare class RequestParser implements IRequest {
11
11
  private readonly request;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RequestParser = void 0;
4
4
  /**
5
5
  * The Request Parser takes an IRequest provides parsing and sub request creation
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  class RequestParser {
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"requestParser.js","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":";;;AAMA;;;GAGG;AACH,MAAa,aAAa;IACzB;;;OAGG;IACI,MAAM,CAAC,YAAY,CAAC,GAAW;QACrC,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,GAAG;aACR,SAAS,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;aAChE,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YAC5B,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;gBACtC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC;aAChC;YACD,OAAO,EAAE,CAAC;QACX,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IAKM,MAAM,CAAC,MAAM,CAAC,OAA2B;QAC/C,sBAAsB;QACtB,IAAI,OAAO,YAAY,aAAa,EAAE;YACrC,OAAO,OAAO,CAAC;SACf;QACD,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,YAA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,IAAI,CAAC,OAAO;aACrB,CAAC;SACF;QACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACrE,OAAO;YACN,GAAG,EAAE,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YACvD,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD;AAzFD,sCAyFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest, IRequestHeader } from \"@fluidframework/core-interfaces\";\n\n/**\n * The Request Parser takes an IRequest provides parsing and sub request creation\n * @internal\n */\nexport class RequestParser implements IRequest {\n\t/**\n\t * Splits the path of the url and decodes each path part\n\t * @param url - the url to get path parts of\n\t */\n\tpublic static getPathParts(url: string): readonly string[] {\n\t\tconst queryStartIndex = url.indexOf(\"?\");\n\t\treturn url\n\t\t\t.substring(0, queryStartIndex < 0 ? url.length : queryStartIndex)\n\t\t\t.split(\"/\")\n\t\t\t.reduce<string[]>((pv, cv) => {\n\t\t\t\tif (cv !== undefined && cv.length > 0) {\n\t\t\t\t\tpv.push(decodeURIComponent(cv));\n\t\t\t\t}\n\t\t\t\treturn pv;\n\t\t\t}, []);\n\t}\n\n\tprivate requestPathParts: readonly string[] | undefined;\n\tpublic readonly query: string;\n\n\tpublic static create(request: Readonly<IRequest>) {\n\t\t// Perf optimizations.\n\t\tif (request instanceof RequestParser) {\n\t\t\treturn request;\n\t\t}\n\t\treturn new RequestParser(request);\n\t}\n\n\tprotected constructor(private readonly request: Readonly<IRequest>) {\n\t\tconst queryStartIndex = this.request.url.indexOf(\"?\");\n\t\tthis.query = queryStartIndex >= 0 ? this.request.url.substring(queryStartIndex) : \"\";\n\t}\n\n\tpublic get url(): string {\n\t\treturn this.request.url;\n\t}\n\n\tpublic get headers(): IRequestHeader | undefined {\n\t\treturn this.request.headers;\n\t}\n\n\t/**\n\t * Returns the decoded path parts of the request's url\n\t */\n\tpublic get pathParts(): readonly string[] {\n\t\tif (this.requestPathParts === undefined) {\n\t\t\tthis.requestPathParts = RequestParser.getPathParts(this.url);\n\t\t}\n\t\treturn this.requestPathParts;\n\t}\n\n\t/**\n\t * Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.\n\t * @param elements - number of elements in path\n\t */\n\tpublic isLeaf(elements: number) {\n\t\treturn this.query === \"\" && this.pathParts.length === elements;\n\t}\n\n\t/**\n\t * Creates a sub request starting at a specific path part of this request's url\n\t * The sub request url always has a leading slash, and always include query params if original url has any\n\t * e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams\n\t * createSubRequest(1) is /b/?queryParams\n\t * createSubRequest(2) is /?queryParams\n\t * createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception\n\t *\n\t * note: query params are not counted towards path parts.\n\t *\n\t * @param startingPathIndex - The index of the first path part of the sub request\n\t */\n\tpublic createSubRequest(startingPathIndex: number): IRequest {\n\t\tconst pathLen = this.pathParts.length;\n\t\tif (startingPathIndex < 0 || startingPathIndex > pathLen) {\n\t\t\tthrow new Error(\"incorrect sub-request\");\n\t\t}\n\t\tif (startingPathIndex === pathLen && this.url.includes(\"?\")) {\n\t\t\treturn {\n\t\t\t\turl: `/${this.query}`,\n\t\t\t\theaders: this.headers,\n\t\t\t};\n\t\t}\n\t\tconst path = `/${this.pathParts.slice(startingPathIndex).join(\"/\")}`;\n\t\treturn {\n\t\t\turl: this.query === \"\" ? path : `${path}/${this.query}`,\n\t\t\theaders: this.headers,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"requestParser.js","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":";;;AAMA;;;GAGG;AACH,MAAa,aAAa;IACzB;;;O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gBAAgB,KAAK,SAAS,EAAE;YACxC,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC7D;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAgB;QAC7B,OAAO,IAAI,CAAC,KAAK,KAAK,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,QAAQ,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;OAWG;IACI,gBAAgB,CAAC,iBAAyB;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QACtC,IAAI,iBAAiB,GAAG,CAAC,IAAI,iBAAiB,GAAG,OAAO,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;SACzC;QACD,IAAI,iBAAiB,KAAK,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC5D,OAAO;gBACN,GAAG,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;aACrB,CAAC;SACF;QACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACrE,OAAO;YACN,GAAG,EAAE,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YACvD,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD;AAzFD,sCAyFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest, IRequestHeader } from \"@fluidframework/core-interfaces\";\n\n/**\n * The Request Parser takes an IRequest provides parsing and sub request creation\n * @alpha\n */\nexport class RequestParser implements IRequest {\n\t/**\n\t * Splits the path of the url and decodes each path part\n\t * @param url - the url to get path parts of\n\t */\n\tpublic static getPathParts(url: string): readonly string[] {\n\t\tconst queryStartIndex = url.indexOf(\"?\");\n\t\treturn url\n\t\t\t.substring(0, queryStartIndex < 0 ? url.length : queryStartIndex)\n\t\t\t.split(\"/\")\n\t\t\t.reduce<string[]>((pv, cv) => {\n\t\t\t\tif (cv !== undefined && cv.length > 0) {\n\t\t\t\t\tpv.push(decodeURIComponent(cv));\n\t\t\t\t}\n\t\t\t\treturn pv;\n\t\t\t}, []);\n\t}\n\n\tprivate requestPathParts: readonly string[] | undefined;\n\tpublic readonly query: string;\n\n\tpublic static create(request: Readonly<IRequest>) {\n\t\t// Perf optimizations.\n\t\tif (request instanceof RequestParser) {\n\t\t\treturn request;\n\t\t}\n\t\treturn new RequestParser(request);\n\t}\n\n\tprotected constructor(private readonly request: Readonly<IRequest>) {\n\t\tconst queryStartIndex = this.request.url.indexOf(\"?\");\n\t\tthis.query = queryStartIndex >= 0 ? this.request.url.substring(queryStartIndex) : \"\";\n\t}\n\n\tpublic get url(): string {\n\t\treturn this.request.url;\n\t}\n\n\tpublic get headers(): IRequestHeader | undefined {\n\t\treturn this.request.headers;\n\t}\n\n\t/**\n\t * Returns the decoded path parts of the request's url\n\t */\n\tpublic get pathParts(): readonly string[] {\n\t\tif (this.requestPathParts === undefined) {\n\t\t\tthis.requestPathParts = RequestParser.getPathParts(this.url);\n\t\t}\n\t\treturn this.requestPathParts;\n\t}\n\n\t/**\n\t * Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.\n\t * @param elements - number of elements in path\n\t */\n\tpublic isLeaf(elements: number) {\n\t\treturn this.query === \"\" && this.pathParts.length === elements;\n\t}\n\n\t/**\n\t * Creates a sub request starting at a specific path part of this request's url\n\t * The sub request url always has a leading slash, and always include query params if original url has any\n\t * e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams\n\t * createSubRequest(1) is /b/?queryParams\n\t * createSubRequest(2) is /?queryParams\n\t * createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception\n\t *\n\t * note: query params are not counted towards path parts.\n\t *\n\t * @param startingPathIndex - The index of the first path part of the sub request\n\t */\n\tpublic createSubRequest(startingPathIndex: number): IRequest {\n\t\tconst pathLen = this.pathParts.length;\n\t\tif (startingPathIndex < 0 || startingPathIndex > pathLen) {\n\t\t\tthrow new Error(\"incorrect sub-request\");\n\t\t}\n\t\tif (startingPathIndex === pathLen && this.url.includes(\"?\")) {\n\t\t\treturn {\n\t\t\t\turl: `/${this.query}`,\n\t\t\t\theaders: this.headers,\n\t\t\t};\n\t\t}\n\t\tconst path = `/${this.pathParts.slice(startingPathIndex).join(\"/\")}`;\n\t\treturn {\n\t\t\turl: this.query === \"\" ? path : `${path}/${this.query}`,\n\t\t\theaders: this.headers,\n\t\t};\n\t}\n}\n"]}
@@ -1,14 +1,25 @@
1
1
  import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
2
3
  import { IContainerContext } from '@fluidframework/container-definitions';
4
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
5
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
6
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
7
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
3
8
  import { IFluidRouter } from '@fluidframework/core-interfaces';
9
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
10
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
4
11
  import { IRequest } from '@fluidframework/core-interfaces';
5
12
  import { IRequestHeader } from '@fluidframework/core-interfaces';
6
13
  import { IResponse } from '@fluidframework/core-interfaces';
7
14
  import { IRuntime } from '@fluidframework/container-definitions';
8
15
  import { IRuntimeFactory } from '@fluidframework/container-definitions';
9
16
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
17
+ import { ISummarizeResult } from '@fluidframework/runtime-definitions';
10
18
  import { ISummaryBlob } from '@fluidframework/protocol-definitions';
19
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
11
20
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
21
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
22
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
12
23
  import { ITree } from '@fluidframework/protocol-definitions';
13
24
  import { SummaryObject } from '@fluidframework/protocol-definitions';
14
25
  import { SummaryType } from '@fluidframework/protocol-definitions';
@@ -48,28 +59,6 @@ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
48
59
 
49
60
  /* Excluded from this release type: getNormalizedObjectStoragePathParts */
50
61
 
51
- /* Excluded from this release type: IChannelStorageService */
52
-
53
- /* Excluded from this release type: IContainerRuntime */
54
-
55
- /* Excluded from this release type: IFluidDataStoreFactory */
56
-
57
- /* Excluded from this release type: IFluidDataStoreRegistry */
58
-
59
- /* Excluded from this release type: IFluidHandleContext */
60
-
61
- /* Excluded from this release type: IGarbageCollectionData */
62
-
63
- /* Excluded from this release type: IProvideFluidDataStoreRegistry */
64
-
65
- /* Excluded from this release type: ISummarizeResult */
66
-
67
- /* Excluded from this release type: ISummaryStats */
68
-
69
- /* Excluded from this release type: ISummaryTreeWithStats */
70
-
71
- /* Excluded from this release type: ITelemetryContext */
72
-
73
62
  /* Excluded from this release type: listBlobsAtTreePath */
74
63
 
75
64
  /* Excluded from this release type: mergeStats */
@@ -80,11 +69,60 @@ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
80
69
 
81
70
  /* Excluded from this release type: requestFluidObject */
82
71
 
83
- /* Excluded from this release type: RequestParser */
72
+ /**
73
+ * The Request Parser takes an IRequest provides parsing and sub request creation
74
+ * @alpha
75
+ */
76
+ export declare class RequestParser implements IRequest {
77
+ private readonly request;
78
+ /**
79
+ * Splits the path of the url and decodes each path part
80
+ * @param url - the url to get path parts of
81
+ */
82
+ static getPathParts(url: string): readonly string[];
83
+ private requestPathParts;
84
+ readonly query: string;
85
+ static create(request: Readonly<IRequest>): RequestParser;
86
+ protected constructor(request: Readonly<IRequest>);
87
+ get url(): string;
88
+ get headers(): IRequestHeader | undefined;
89
+ /**
90
+ * Returns the decoded path parts of the request's url
91
+ */
92
+ get pathParts(): readonly string[];
93
+ /**
94
+ * Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.
95
+ * @param elements - number of elements in path
96
+ */
97
+ isLeaf(elements: number): boolean;
98
+ /**
99
+ * Creates a sub request starting at a specific path part of this request's url
100
+ * The sub request url always has a leading slash, and always include query params if original url has any
101
+ * e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams
102
+ * createSubRequest(1) is /b/?queryParams
103
+ * createSubRequest(2) is /?queryParams
104
+ * createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception
105
+ *
106
+ * note: query params are not counted towards path parts.
107
+ *
108
+ * @param startingPathIndex - The index of the first path part of the sub request
109
+ */
110
+ createSubRequest(startingPathIndex: number): IRequest;
111
+ }
84
112
 
85
113
  /* Excluded from this release type: responseToException */
86
114
 
87
- /* Excluded from this release type: RuntimeFactoryHelper */
115
+ /**
116
+ * @alpha
117
+ */
118
+ export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
119
+ get IRuntimeFactory(): this;
120
+ instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
121
+ abstract preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & T>;
122
+ instantiateFirstTime(_runtime: T): Promise<void>;
123
+ instantiateFromExisting(_runtime: T): Promise<void>;
124
+ hasInitialized(_runtime: T): Promise<void>;
125
+ }
88
126
 
89
127
  /* Excluded from this release type: seqFromTree */
90
128
 
@@ -1,10 +1,29 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
3
+ import { IContainerContext } from '@fluidframework/container-definitions';
4
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
5
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
6
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
7
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
8
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
9
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
10
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
11
+ import { IRequest } from '@fluidframework/core-interfaces';
1
12
  import { IRequestHeader } from '@fluidframework/core-interfaces';
13
+ import { IResponse } from '@fluidframework/core-interfaces';
14
+ import { IRuntime } from '@fluidframework/container-definitions';
15
+ import { IRuntimeFactory } from '@fluidframework/container-definitions';
2
16
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
17
+ import { ISummarizeResult } from '@fluidframework/runtime-definitions';
3
18
  import { ISummaryBlob } from '@fluidframework/protocol-definitions';
19
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
4
20
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
21
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
22
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
5
23
  import { ITree } from '@fluidframework/protocol-definitions';
6
24
  import { SummaryObject } from '@fluidframework/protocol-definitions';
7
25
  import { SummaryType } from '@fluidframework/protocol-definitions';
26
+ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
8
27
 
9
28
  /* Excluded from this release type: addBlobToSummary */
10
29
 
@@ -1,10 +1,29 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
3
+ import { IContainerContext } from '@fluidframework/container-definitions';
4
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
5
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
6
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
7
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
8
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
9
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
10
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
11
+ import { IRequest } from '@fluidframework/core-interfaces';
1
12
  import { IRequestHeader } from '@fluidframework/core-interfaces';
13
+ import { IResponse } from '@fluidframework/core-interfaces';
14
+ import { IRuntime } from '@fluidframework/container-definitions';
15
+ import { IRuntimeFactory } from '@fluidframework/container-definitions';
2
16
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
17
+ import { ISummarizeResult } from '@fluidframework/runtime-definitions';
3
18
  import { ISummaryBlob } from '@fluidframework/protocol-definitions';
19
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
4
20
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
21
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
22
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
5
23
  import { ITree } from '@fluidframework/protocol-definitions';
6
24
  import { SummaryObject } from '@fluidframework/protocol-definitions';
7
25
  import { SummaryType } from '@fluidframework/protocol-definitions';
26
+ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
8
27
 
9
28
  /* Excluded from this release type: addBlobToSummary */
10
29
 
@@ -192,7 +192,7 @@ export declare function requestFluidObject<T = FluidObject>(router: IFluidRouter
192
192
 
193
193
  /**
194
194
  * The Request Parser takes an IRequest provides parsing and sub request creation
195
- * @internal
195
+ * @alpha
196
196
  */
197
197
  export declare class RequestParser implements IRequest {
198
198
  private readonly request;
@@ -237,7 +237,7 @@ export declare class RequestParser implements IRequest {
237
237
  export declare function responseToException(response: IResponse, request: IRequest): Error;
238
238
 
239
239
  /**
240
- * @internal
240
+ * @alpha
241
241
  */
242
242
  export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
243
243
  get IRuntimeFactory(): this;
@@ -303,7 +303,7 @@ export declare class TelemetryContext implements ITelemetryContext {
303
303
  * @returns A map of used routes of each children of the the given node.
304
304
  * @internal
305
305
  */
306
- export declare function unpackChildNodesUsedRoutes(usedRoutes: string[]): Map<string, string[]>;
306
+ export declare function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]): Map<string, string[]>;
307
307
 
308
308
  /**
309
309
  * @internal
@@ -5,7 +5,7 @@
5
5
  import { IContainerContext, IRuntime, IRuntimeFactory } from "@fluidframework/container-definitions";
6
6
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
7
7
  /**
8
- * @internal
8
+ * @alpha
9
9
  */
10
10
  export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
11
11
  get IRuntimeFactory(): this;
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.RuntimeFactoryHelper = void 0;
8
8
  /**
9
- * @internal
9
+ * @alpha
10
10
  */
11
11
  class RuntimeFactoryHelper {
12
12
  get IRuntimeFactory() {
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeFactoryHelper.js","sourceRoot":"","sources":["../src/runtimeFactoryHelper.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;GAEG;AACH,MAAsB,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;AAxBD,oDAwBC","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 * @internal\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,MAAsB,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;AAxBD,oDAwBC","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"]}
@@ -8,5 +8,5 @@
8
8
  * @returns A map of used routes of each children of the the given node.
9
9
  * @internal
10
10
  */
11
- export declare function unpackChildNodesUsedRoutes(usedRoutes: string[]): Map<string, string[]>;
11
+ export declare function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]): Map<string, string[]>;
12
12
  //# sourceMappingURL=unpackUsedRoutes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unpackUsedRoutes.d.ts","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,yBAiB9D"}
1
+ {"version":3,"file":"unpackUsedRoutes.d.ts","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,yBAiBvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"unpackUsedRoutes.js","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,UAAoB;IAC9D,oFAAoF;IACpF,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC;IACvF,MAAM,kBAAkB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC5D,KAAK,MAAM,KAAK,IAAI,kBAAkB,EAAE;QACvC,IAAA,mBAAM,EAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACzF,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEvD,MAAM,eAAe,GAAG,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,eAAe,KAAK,SAAS,EAAE;YAClC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SACrC;aAAM;YACN,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;SAClD;KACD;IACD,OAAO,kBAAkB,CAAC;AAC3B,CAAC;AAjBD,gEAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * Helper function that unpacks the used routes of children from a given node's used routes.\n * @param usedRoutes - The used routes of a node.\n * @returns A map of used routes of each children of the the given node.\n * @internal\n */\nexport function unpackChildNodesUsedRoutes(usedRoutes: string[]) {\n\t// Remove the node's self used route, if any, and generate the children used routes.\n\tconst filteredUsedRoutes = usedRoutes.filter((route) => route !== \"\" && route !== \"/\");\n\tconst childUsedRoutesMap: Map<string, string[]> = new Map();\n\tfor (const route of filteredUsedRoutes) {\n\t\tassert(route.startsWith(\"/\"), 0x5e0 /* Used route should always be an absolute route */);\n\t\tconst childId = route.split(\"/\")[1];\n\t\tconst childUsedRoute = route.slice(childId.length + 1);\n\n\t\tconst childUsedRoutes = childUsedRoutesMap.get(childId);\n\t\tif (childUsedRoutes !== undefined) {\n\t\t\tchildUsedRoutes.push(childUsedRoute);\n\t\t} else {\n\t\t\tchildUsedRoutesMap.set(childId, [childUsedRoute]);\n\t\t}\n\t}\n\treturn childUsedRoutesMap;\n}\n"]}
1
+ {"version":3,"file":"unpackUsedRoutes.js","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,UAA6B;IACvE,oFAAoF;IACpF,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC;IACvF,MAAM,kBAAkB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC5D,KAAK,MAAM,KAAK,IAAI,kBAAkB,EAAE;QACvC,IAAA,mBAAM,EAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACzF,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEvD,MAAM,eAAe,GAAG,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,eAAe,KAAK,SAAS,EAAE;YAClC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SACrC;aAAM;YACN,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;SAClD;KACD;IACD,OAAO,kBAAkB,CAAC;AAC3B,CAAC;AAjBD,gEAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * Helper function that unpacks the used routes of children from a given node's used routes.\n * @param usedRoutes - The used routes of a node.\n * @returns A map of used routes of each children of the the given node.\n * @internal\n */\nexport function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]) {\n\t// Remove the node's self used route, if any, and generate the children used routes.\n\tconst filteredUsedRoutes = usedRoutes.filter((route) => route !== \"\" && route !== \"/\");\n\tconst childUsedRoutesMap: Map<string, string[]> = new Map();\n\tfor (const route of filteredUsedRoutes) {\n\t\tassert(route.startsWith(\"/\"), 0x5e0 /* Used route should always be an absolute route */);\n\t\tconst childId = route.split(\"/\")[1];\n\t\tconst childUsedRoute = route.slice(childId.length + 1);\n\n\t\tconst childUsedRoutes = childUsedRoutesMap.get(childId);\n\t\tif (childUsedRoutes !== undefined) {\n\t\t\tchildUsedRoutes.push(childUsedRoute);\n\t\t} else {\n\t\t\tchildUsedRoutesMap.set(childId, [childUsedRoute]);\n\t\t}\n\t}\n\treturn childUsedRoutesMap;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  import { IRequest, IRequestHeader } from "@fluidframework/core-interfaces";
6
6
  /**
7
7
  * The Request Parser takes an IRequest provides parsing and sub request creation
8
- * @internal
8
+ * @alpha
9
9
  */
10
10
  export declare class RequestParser implements IRequest {
11
11
  private readonly request;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The Request Parser takes an IRequest provides parsing and sub request creation
3
- * @internal
3
+ * @alpha
4
4
  */
5
5
  export class RequestParser {
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"requestParser.js","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,OAAO,aAAa;IACzB;;;OAGG;IACI,MAAM,CAAC,YAAY,CAAC,GAAW;QACrC,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,GAAG;aACR,SAAS,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;aAChE,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YAC5B,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;gBACtC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC;aAChC;YACD,OAAO,EAAE,CAAC;QACX,CAAC,E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M,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;SACzC;QACD,IAAI,iBAAiB,KAAK,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC5D,OAAO;gBACN,GAAG,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;aACrB,CAAC;SACF;QACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACrE,OAAO;YACN,GAAG,EAAE,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YACvD,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest, IRequestHeader } from \"@fluidframework/core-interfaces\";\n\n/**\n * The Request Parser takes an IRequest provides parsing and sub request creation\n * @internal\n */\nexport class RequestParser implements IRequest {\n\t/**\n\t * Splits the path of the url and decodes each path part\n\t * @param url - the url to get path parts of\n\t */\n\tpublic static getPathParts(url: string): readonly string[] {\n\t\tconst queryStartIndex = url.indexOf(\"?\");\n\t\treturn url\n\t\t\t.substring(0, queryStartIndex < 0 ? url.length : queryStartIndex)\n\t\t\t.split(\"/\")\n\t\t\t.reduce<string[]>((pv, cv) => {\n\t\t\t\tif (cv !== undefined && cv.length > 0) {\n\t\t\t\t\tpv.push(decodeURIComponent(cv));\n\t\t\t\t}\n\t\t\t\treturn pv;\n\t\t\t}, []);\n\t}\n\n\tprivate requestPathParts: readonly string[] | undefined;\n\tpublic readonly query: string;\n\n\tpublic static create(request: Readonly<IRequest>) {\n\t\t// Perf optimizations.\n\t\tif (request instanceof RequestParser) {\n\t\t\treturn request;\n\t\t}\n\t\treturn new RequestParser(request);\n\t}\n\n\tprotected constructor(private readonly request: Readonly<IRequest>) {\n\t\tconst queryStartIndex = this.request.url.indexOf(\"?\");\n\t\tthis.query = queryStartIndex >= 0 ? this.request.url.substring(queryStartIndex) : \"\";\n\t}\n\n\tpublic get url(): string {\n\t\treturn this.request.url;\n\t}\n\n\tpublic get headers(): IRequestHeader | undefined {\n\t\treturn this.request.headers;\n\t}\n\n\t/**\n\t * Returns the decoded path parts of the request's url\n\t */\n\tpublic get pathParts(): readonly string[] {\n\t\tif (this.requestPathParts === undefined) {\n\t\t\tthis.requestPathParts = RequestParser.getPathParts(this.url);\n\t\t}\n\t\treturn this.requestPathParts;\n\t}\n\n\t/**\n\t * Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.\n\t * @param elements - number of elements in path\n\t */\n\tpublic isLeaf(elements: number) {\n\t\treturn this.query === \"\" && this.pathParts.length === elements;\n\t}\n\n\t/**\n\t * Creates a sub request starting at a specific path part of this request's url\n\t * The sub request url always has a leading slash, and always include query params if original url has any\n\t * e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams\n\t * createSubRequest(1) is /b/?queryParams\n\t * createSubRequest(2) is /?queryParams\n\t * createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception\n\t *\n\t * note: query params are not counted towards path parts.\n\t *\n\t * @param startingPathIndex - The index of the first path part of the sub request\n\t */\n\tpublic createSubRequest(startingPathIndex: number): IRequest {\n\t\tconst pathLen = this.pathParts.length;\n\t\tif (startingPathIndex < 0 || startingPathIndex > pathLen) {\n\t\t\tthrow new Error(\"incorrect sub-request\");\n\t\t}\n\t\tif (startingPathIndex === pathLen && this.url.includes(\"?\")) {\n\t\t\treturn {\n\t\t\t\turl: `/${this.query}`,\n\t\t\t\theaders: this.headers,\n\t\t\t};\n\t\t}\n\t\tconst path = `/${this.pathParts.slice(startingPathIndex).join(\"/\")}`;\n\t\treturn {\n\t\t\turl: this.query === \"\" ? path : `${path}/${this.query}`,\n\t\t\theaders: this.headers,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"requestParser.js","sourceRoot":"","sources":["../src/requestParser.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,OAAO,aAAa;IACzB;;;OAGG;IACI,MAAM,CAAC,YAAY,CAAC,GAAW;QACrC,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,GAAG;aACR,SAAS,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;aAChE,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YAC5B,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;gBACtC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC;aAChC;YACD,OAAO,EAAE,CAAC;QACX,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IAKM,MAAM,CAAC,MAAM,CAAC,OAA2B;QAC/C,sBAAsB;QACtB,IAAI,OAAO,YAAY,aAAa,EAAE;YACrC,OAAO,OAAO,CAAC;SACf;QACD,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,YAAuC,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;QACjE,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,CAAC;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ACvD,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest, IRequestHeader } from \"@fluidframework/core-interfaces\";\n\n/**\n * The Request Parser takes an IRequest provides parsing and sub request creation\n * @alpha\n */\nexport class RequestParser implements IRequest {\n\t/**\n\t * Splits the path of the url and decodes each path part\n\t * @param url - the url to get path parts of\n\t */\n\tpublic static getPathParts(url: string): readonly string[] {\n\t\tconst queryStartIndex = url.indexOf(\"?\");\n\t\treturn url\n\t\t\t.substring(0, queryStartIndex < 0 ? url.length : queryStartIndex)\n\t\t\t.split(\"/\")\n\t\t\t.reduce<string[]>((pv, cv) => {\n\t\t\t\tif (cv !== undefined && cv.length > 0) {\n\t\t\t\t\tpv.push(decodeURIComponent(cv));\n\t\t\t\t}\n\t\t\t\treturn pv;\n\t\t\t}, []);\n\t}\n\n\tprivate requestPathParts: readonly string[] | undefined;\n\tpublic readonly query: string;\n\n\tpublic static create(request: Readonly<IRequest>) {\n\t\t// Perf optimizations.\n\t\tif (request instanceof RequestParser) {\n\t\t\treturn request;\n\t\t}\n\t\treturn new RequestParser(request);\n\t}\n\n\tprotected constructor(private readonly request: Readonly<IRequest>) {\n\t\tconst queryStartIndex = this.request.url.indexOf(\"?\");\n\t\tthis.query = queryStartIndex >= 0 ? this.request.url.substring(queryStartIndex) : \"\";\n\t}\n\n\tpublic get url(): string {\n\t\treturn this.request.url;\n\t}\n\n\tpublic get headers(): IRequestHeader | undefined {\n\t\treturn this.request.headers;\n\t}\n\n\t/**\n\t * Returns the decoded path parts of the request's url\n\t */\n\tpublic get pathParts(): readonly string[] {\n\t\tif (this.requestPathParts === undefined) {\n\t\t\tthis.requestPathParts = RequestParser.getPathParts(this.url);\n\t\t}\n\t\treturn this.requestPathParts;\n\t}\n\n\t/**\n\t * Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.\n\t * @param elements - number of elements in path\n\t */\n\tpublic isLeaf(elements: number) {\n\t\treturn this.query === \"\" && this.pathParts.length === elements;\n\t}\n\n\t/**\n\t * Creates a sub request starting at a specific path part of this request's url\n\t * The sub request url always has a leading slash, and always include query params if original url has any\n\t * e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams\n\t * createSubRequest(1) is /b/?queryParams\n\t * createSubRequest(2) is /?queryParams\n\t * createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception\n\t *\n\t * note: query params are not counted towards path parts.\n\t *\n\t * @param startingPathIndex - The index of the first path part of the sub request\n\t */\n\tpublic createSubRequest(startingPathIndex: number): IRequest {\n\t\tconst pathLen = this.pathParts.length;\n\t\tif (startingPathIndex < 0 || startingPathIndex > pathLen) {\n\t\t\tthrow new Error(\"incorrect sub-request\");\n\t\t}\n\t\tif (startingPathIndex === pathLen && this.url.includes(\"?\")) {\n\t\t\treturn {\n\t\t\t\turl: `/${this.query}`,\n\t\t\t\theaders: this.headers,\n\t\t\t};\n\t\t}\n\t\tconst path = `/${this.pathParts.slice(startingPathIndex).join(\"/\")}`;\n\t\treturn {\n\t\t\turl: this.query === \"\" ? path : `${path}/${this.query}`,\n\t\t\theaders: this.headers,\n\t\t};\n\t}\n}\n"]}
@@ -1,14 +1,25 @@
1
1
  import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
2
3
  import { IContainerContext } from '@fluidframework/container-definitions';
4
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
5
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
6
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
7
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
3
8
  import { IFluidRouter } from '@fluidframework/core-interfaces';
9
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
10
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
4
11
  import { IRequest } from '@fluidframework/core-interfaces';
5
12
  import { IRequestHeader } from '@fluidframework/core-interfaces';
6
13
  import { IResponse } from '@fluidframework/core-interfaces';
7
14
  import { IRuntime } from '@fluidframework/container-definitions';
8
15
  import { IRuntimeFactory } from '@fluidframework/container-definitions';
9
16
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
17
+ import { ISummarizeResult } from '@fluidframework/runtime-definitions';
10
18
  import { ISummaryBlob } from '@fluidframework/protocol-definitions';
19
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
11
20
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
21
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
22
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
12
23
  import { ITree } from '@fluidframework/protocol-definitions';
13
24
  import { SummaryObject } from '@fluidframework/protocol-definitions';
14
25
  import { SummaryType } from '@fluidframework/protocol-definitions';
@@ -48,28 +59,6 @@ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
48
59
 
49
60
  /* Excluded from this release type: getNormalizedObjectStoragePathParts */
50
61
 
51
- /* Excluded from this release type: IChannelStorageService */
52
-
53
- /* Excluded from this release type: IContainerRuntime */
54
-
55
- /* Excluded from this release type: IFluidDataStoreFactory */
56
-
57
- /* Excluded from this release type: IFluidDataStoreRegistry */
58
-
59
- /* Excluded from this release type: IFluidHandleContext */
60
-
61
- /* Excluded from this release type: IGarbageCollectionData */
62
-
63
- /* Excluded from this release type: IProvideFluidDataStoreRegistry */
64
-
65
- /* Excluded from this release type: ISummarizeResult */
66
-
67
- /* Excluded from this release type: ISummaryStats */
68
-
69
- /* Excluded from this release type: ISummaryTreeWithStats */
70
-
71
- /* Excluded from this release type: ITelemetryContext */
72
-
73
62
  /* Excluded from this release type: listBlobsAtTreePath */
74
63
 
75
64
  /* Excluded from this release type: mergeStats */
@@ -80,11 +69,60 @@ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
80
69
 
81
70
  /* Excluded from this release type: requestFluidObject */
82
71
 
83
- /* Excluded from this release type: RequestParser */
72
+ /**
73
+ * The Request Parser takes an IRequest provides parsing and sub request creation
74
+ * @alpha
75
+ */
76
+ export declare class RequestParser implements IRequest {
77
+ private readonly request;
78
+ /**
79
+ * Splits the path of the url and decodes each path part
80
+ * @param url - the url to get path parts of
81
+ */
82
+ static getPathParts(url: string): readonly string[];
83
+ private requestPathParts;
84
+ readonly query: string;
85
+ static create(request: Readonly<IRequest>): RequestParser;
86
+ protected constructor(request: Readonly<IRequest>);
87
+ get url(): string;
88
+ get headers(): IRequestHeader | undefined;
89
+ /**
90
+ * Returns the decoded path parts of the request's url
91
+ */
92
+ get pathParts(): readonly string[];
93
+ /**
94
+ * Returns true if it's a terminating path, i.e. no more elements after `elements` entries and empty query.
95
+ * @param elements - number of elements in path
96
+ */
97
+ isLeaf(elements: number): boolean;
98
+ /**
99
+ * Creates a sub request starting at a specific path part of this request's url
100
+ * The sub request url always has a leading slash, and always include query params if original url has any
101
+ * e.g. original url is /a/b/?queryParams, createSubRequest(0) is /a/b/?queryParams
102
+ * createSubRequest(1) is /b/?queryParams
103
+ * createSubRequest(2) is /?queryParams
104
+ * createSubRequest(n) where n is bigger than parts length, e.g. 2, or n is less than 0 will throw an exception
105
+ *
106
+ * note: query params are not counted towards path parts.
107
+ *
108
+ * @param startingPathIndex - The index of the first path part of the sub request
109
+ */
110
+ createSubRequest(startingPathIndex: number): IRequest;
111
+ }
84
112
 
85
113
  /* Excluded from this release type: responseToException */
86
114
 
87
- /* Excluded from this release type: RuntimeFactoryHelper */
115
+ /**
116
+ * @alpha
117
+ */
118
+ export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
119
+ get IRuntimeFactory(): this;
120
+ instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
121
+ abstract preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & T>;
122
+ instantiateFirstTime(_runtime: T): Promise<void>;
123
+ instantiateFromExisting(_runtime: T): Promise<void>;
124
+ hasInitialized(_runtime: T): Promise<void>;
125
+ }
88
126
 
89
127
  /* Excluded from this release type: seqFromTree */
90
128
 
@@ -1,10 +1,29 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
3
+ import { IContainerContext } from '@fluidframework/container-definitions';
4
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
5
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
6
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
7
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
8
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
9
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
10
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
11
+ import { IRequest } from '@fluidframework/core-interfaces';
1
12
  import { IRequestHeader } from '@fluidframework/core-interfaces';
13
+ import { IResponse } from '@fluidframework/core-interfaces';
14
+ import { IRuntime } from '@fluidframework/container-definitions';
15
+ import { IRuntimeFactory } from '@fluidframework/container-definitions';
2
16
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
17
+ import { ISummarizeResult } from '@fluidframework/runtime-definitions';
3
18
  import { ISummaryBlob } from '@fluidframework/protocol-definitions';
19
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
4
20
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
21
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
22
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
5
23
  import { ITree } from '@fluidframework/protocol-definitions';
6
24
  import { SummaryObject } from '@fluidframework/protocol-definitions';
7
25
  import { SummaryType } from '@fluidframework/protocol-definitions';
26
+ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
8
27
 
9
28
  /* Excluded from this release type: addBlobToSummary */
10
29
 
@@ -1,10 +1,29 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
3
+ import { IContainerContext } from '@fluidframework/container-definitions';
4
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
5
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
6
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
7
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
8
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
9
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
10
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
11
+ import { IRequest } from '@fluidframework/core-interfaces';
1
12
  import { IRequestHeader } from '@fluidframework/core-interfaces';
13
+ import { IResponse } from '@fluidframework/core-interfaces';
14
+ import { IRuntime } from '@fluidframework/container-definitions';
15
+ import { IRuntimeFactory } from '@fluidframework/container-definitions';
2
16
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
17
+ import { ISummarizeResult } from '@fluidframework/runtime-definitions';
3
18
  import { ISummaryBlob } from '@fluidframework/protocol-definitions';
19
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
4
20
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
21
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
22
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
5
23
  import { ITree } from '@fluidframework/protocol-definitions';
6
24
  import { SummaryObject } from '@fluidframework/protocol-definitions';
7
25
  import { SummaryType } from '@fluidframework/protocol-definitions';
26
+ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
8
27
 
9
28
  /* Excluded from this release type: addBlobToSummary */
10
29
 
@@ -192,7 +192,7 @@ export declare function requestFluidObject<T = FluidObject>(router: IFluidRouter
192
192
 
193
193
  /**
194
194
  * The Request Parser takes an IRequest provides parsing and sub request creation
195
- * @internal
195
+ * @alpha
196
196
  */
197
197
  export declare class RequestParser implements IRequest {
198
198
  private readonly request;
@@ -237,7 +237,7 @@ export declare class RequestParser implements IRequest {
237
237
  export declare function responseToException(response: IResponse, request: IRequest): Error;
238
238
 
239
239
  /**
240
- * @internal
240
+ * @alpha
241
241
  */
242
242
  export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
243
243
  get IRuntimeFactory(): this;
@@ -303,7 +303,7 @@ export declare class TelemetryContext implements ITelemetryContext {
303
303
  * @returns A map of used routes of each children of the the given node.
304
304
  * @internal
305
305
  */
306
- export declare function unpackChildNodesUsedRoutes(usedRoutes: string[]): Map<string, string[]>;
306
+ export declare function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]): Map<string, string[]>;
307
307
 
308
308
  /**
309
309
  * @internal
@@ -5,7 +5,7 @@
5
5
  import { IContainerContext, IRuntime, IRuntimeFactory } from "@fluidframework/container-definitions";
6
6
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
7
7
  /**
8
- * @internal
8
+ * @alpha
9
9
  */
10
10
  export declare abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
11
11
  get IRuntimeFactory(): this;
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  export class RuntimeFactoryHelper {
9
9
  get IRuntimeFactory() {
@@ -1 +1 @@
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 * @internal\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"]}
@@ -8,5 +8,5 @@
8
8
  * @returns A map of used routes of each children of the the given node.
9
9
  * @internal
10
10
  */
11
- export declare function unpackChildNodesUsedRoutes(usedRoutes: string[]): Map<string, string[]>;
11
+ export declare function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]): Map<string, string[]>;
12
12
  //# sourceMappingURL=unpackUsedRoutes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unpackUsedRoutes.d.ts","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,yBAiB9D"}
1
+ {"version":3,"file":"unpackUsedRoutes.d.ts","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,yBAiBvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"unpackUsedRoutes.js","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAAoB;IAC9D,oFAAoF;IACpF,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC;IACvF,MAAM,kBAAkB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC5D,KAAK,MAAM,KAAK,IAAI,kBAAkB,EAAE;QACvC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACzF,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEvD,MAAM,eAAe,GAAG,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,eAAe,KAAK,SAAS,EAAE;YAClC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SACrC;aAAM;YACN,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;SAClD;KACD;IACD,OAAO,kBAAkB,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * Helper function that unpacks the used routes of children from a given node's used routes.\n * @param usedRoutes - The used routes of a node.\n * @returns A map of used routes of each children of the the given node.\n * @internal\n */\nexport function unpackChildNodesUsedRoutes(usedRoutes: string[]) {\n\t// Remove the node's self used route, if any, and generate the children used routes.\n\tconst filteredUsedRoutes = usedRoutes.filter((route) => route !== \"\" && route !== \"/\");\n\tconst childUsedRoutesMap: Map<string, string[]> = new Map();\n\tfor (const route of filteredUsedRoutes) {\n\t\tassert(route.startsWith(\"/\"), 0x5e0 /* Used route should always be an absolute route */);\n\t\tconst childId = route.split(\"/\")[1];\n\t\tconst childUsedRoute = route.slice(childId.length + 1);\n\n\t\tconst childUsedRoutes = childUsedRoutesMap.get(childId);\n\t\tif (childUsedRoutes !== undefined) {\n\t\t\tchildUsedRoutes.push(childUsedRoute);\n\t\t} else {\n\t\t\tchildUsedRoutesMap.set(childId, [childUsedRoute]);\n\t\t}\n\t}\n\treturn childUsedRoutesMap;\n}\n"]}
1
+ {"version":3,"file":"unpackUsedRoutes.js","sourceRoot":"","sources":["../src/unpackUsedRoutes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAA6B;IACvE,oFAAoF;IACpF,MAAM,kBAAkB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC;IACvF,MAAM,kBAAkB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC5D,KAAK,MAAM,KAAK,IAAI,kBAAkB,EAAE;QACvC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACzF,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAEvD,MAAM,eAAe,GAAG,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,eAAe,KAAK,SAAS,EAAE;YAClC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SACrC;aAAM;YACN,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;SAClD;KACD;IACD,OAAO,kBAAkB,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\n\n/**\n * Helper function that unpacks the used routes of children from a given node's used routes.\n * @param usedRoutes - The used routes of a node.\n * @returns A map of used routes of each children of the the given node.\n * @internal\n */\nexport function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]) {\n\t// Remove the node's self used route, if any, and generate the children used routes.\n\tconst filteredUsedRoutes = usedRoutes.filter((route) => route !== \"\" && route !== \"/\");\n\tconst childUsedRoutesMap: Map<string, string[]> = new Map();\n\tfor (const route of filteredUsedRoutes) {\n\t\tassert(route.startsWith(\"/\"), 0x5e0 /* Used route should always be an absolute route */);\n\t\tconst childId = route.split(\"/\")[1];\n\t\tconst childUsedRoute = route.slice(childId.length + 1);\n\n\t\tconst childUsedRoutes = childUsedRoutesMap.get(childId);\n\t\tif (childUsedRoutes !== undefined) {\n\t\t\tchildUsedRoutes.push(childUsedRoute);\n\t\t} else {\n\t\t\tchildUsedRoutesMap.set(childId, [childUsedRoute]);\n\t\t}\n\t}\n\treturn childUsedRoutesMap;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/runtime-utils",
3
- "version": "2.0.0-dev.7.4.0.217212",
3
+ "version": "2.0.0-dev.7.4.0.221926",
4
4
  "description": "Collection of utility functions for Fluid Runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,27 +35,28 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.217212",
39
- "@fluidframework/container-definitions": "2.0.0-dev.7.4.0.217212",
40
- "@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.217212",
41
- "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.217212",
42
- "@fluidframework/core-utils": "2.0.0-dev.7.4.0.217212",
43
- "@fluidframework/datastore-definitions": "2.0.0-dev.7.4.0.217212",
44
- "@fluidframework/driver-utils": "2.0.0-dev.7.4.0.217212",
38
+ "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.221926",
39
+ "@fluidframework/container-definitions": "2.0.0-dev.7.4.0.221926",
40
+ "@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.221926",
41
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.221926",
42
+ "@fluidframework/core-utils": "2.0.0-dev.7.4.0.221926",
43
+ "@fluidframework/datastore-definitions": "2.0.0-dev.7.4.0.221926",
44
+ "@fluidframework/driver-utils": "2.0.0-dev.7.4.0.221926",
45
45
  "@fluidframework/protocol-definitions": "^3.0.0",
46
- "@fluidframework/runtime-definitions": "2.0.0-dev.7.4.0.217212",
47
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.217212"
46
+ "@fluidframework/runtime-definitions": "2.0.0-dev.7.4.0.221926",
47
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.221926"
48
48
  },
49
49
  "devDependencies": {
50
+ "@arethetypeswrong/cli": "^0.13.3",
50
51
  "@fluid-tools/build-cli": "^0.28.0",
51
52
  "@fluidframework/build-common": "^2.0.3",
52
53
  "@fluidframework/build-tools": "^0.28.0",
53
54
  "@fluidframework/eslint-config-fluid": "^3.1.0",
54
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.217212",
55
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.221926",
55
56
  "@fluidframework/runtime-utils-previous": "npm:@fluidframework/runtime-utils@2.0.0-internal.7.2.0",
56
57
  "@microsoft/api-extractor": "^7.38.3",
57
58
  "@types/mocha": "^9.1.1",
58
- "@types/node": "^16.18.38",
59
+ "@types/node": "^18.19.0",
59
60
  "c8": "^7.7.1",
60
61
  "copyfiles": "^2.4.1",
61
62
  "cross-env": "^7.0.3",
@@ -95,6 +96,7 @@
95
96
  "build:docs": "fluid-build . --task api",
96
97
  "build:esnext": "tsc --project ./tsconfig.esnext.json",
97
98
  "build:test": "tsc --project ./src/test/tsconfig.json",
99
+ "check:are-the-types-wrong": "attw --pack",
98
100
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
99
101
  "ci:build:docs": "api-extractor run",
100
102
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -6,7 +6,7 @@ import { IRequest, IRequestHeader } from "@fluidframework/core-interfaces";
6
6
 
7
7
  /**
8
8
  * The Request Parser takes an IRequest provides parsing and sub request creation
9
- * @internal
9
+ * @alpha
10
10
  */
11
11
  export class RequestParser implements IRequest {
12
12
  /**
@@ -11,7 +11,7 @@ import {
11
11
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
12
12
 
13
13
  /**
14
- * @internal
14
+ * @alpha
15
15
  */
16
16
  export abstract class RuntimeFactoryHelper<T = IContainerRuntime> implements IRuntimeFactory {
17
17
  public get IRuntimeFactory() {
@@ -11,7 +11,7 @@ import { assert } from "@fluidframework/core-utils";
11
11
  * @returns A map of used routes of each children of the the given node.
12
12
  * @internal
13
13
  */
14
- export function unpackChildNodesUsedRoutes(usedRoutes: string[]) {
14
+ export function unpackChildNodesUsedRoutes(usedRoutes: readonly string[]) {
15
15
  // Remove the node's self used route, if any, and generate the children used routes.
16
16
  const filteredUsedRoutes = usedRoutes.filter((route) => route !== "" && route !== "/");
17
17
  const childUsedRoutesMap: Map<string, string[]> = new Map();