@fluidframework/container-runtime 2.0.0-internal.7.4.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 (50) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/api-report/container-runtime.api.md +0 -17
  3. package/dist/container-runtime-alpha.d.ts +3 -32
  4. package/dist/container-runtime-beta.d.ts +0 -8
  5. package/dist/container-runtime-public.d.ts +0 -8
  6. package/dist/container-runtime-untrimmed.d.ts +3 -47
  7. package/dist/containerRuntime.d.ts +6 -36
  8. package/dist/containerRuntime.d.ts.map +1 -1
  9. package/dist/containerRuntime.js +6 -64
  10. package/dist/containerRuntime.js.map +1 -1
  11. package/dist/dataStore.js +0 -12
  12. package/dist/dataStore.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/packageVersion.d.ts +1 -1
  18. package/dist/packageVersion.js +1 -1
  19. package/dist/packageVersion.js.map +1 -1
  20. package/dist/summary/summarizer.d.ts +0 -12
  21. package/dist/summary/summarizer.d.ts.map +1 -1
  22. package/dist/summary/summarizer.js +0 -46
  23. package/dist/summary/summarizer.js.map +1 -1
  24. package/lib/container-runtime-alpha.d.ts +3 -32
  25. package/lib/container-runtime-beta.d.ts +0 -8
  26. package/lib/container-runtime-public.d.ts +0 -8
  27. package/lib/container-runtime-untrimmed.d.ts +3 -47
  28. package/lib/containerRuntime.d.ts +6 -36
  29. package/lib/containerRuntime.d.ts.map +1 -1
  30. package/lib/containerRuntime.js +5 -62
  31. package/lib/containerRuntime.js.map +1 -1
  32. package/lib/dataStore.js +0 -12
  33. package/lib/dataStore.js.map +1 -1
  34. package/lib/index.d.ts +1 -1
  35. package/lib/index.d.ts.map +1 -1
  36. package/lib/index.js +1 -1
  37. package/lib/index.js.map +1 -1
  38. package/lib/packageVersion.d.ts +1 -1
  39. package/lib/packageVersion.js +1 -1
  40. package/lib/packageVersion.js.map +1 -1
  41. package/lib/summary/summarizer.d.ts +0 -12
  42. package/lib/summary/summarizer.d.ts.map +1 -1
  43. package/lib/summary/summarizer.js +0 -46
  44. package/lib/summary/summarizer.js.map +1 -1
  45. package/package.json +20 -16
  46. package/src/containerRuntime.ts +7 -85
  47. package/src/dataStore.ts +1 -15
  48. package/src/index.ts +0 -1
  49. package/src/packageVersion.ts +1 -1
  50. package/src/summary/summarizer.ts +1 -50
package/dist/dataStore.js CHANGED
@@ -107,12 +107,6 @@ class DataStore {
107
107
  this.aliasState = AliasState.Aliased;
108
108
  return "Success";
109
109
  }
110
- /**
111
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
112
- */
113
- async request(request) {
114
- return this.fluidDataStoreChannel.request(request);
115
- }
116
110
  /**
117
111
  * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}
118
112
  */
@@ -128,12 +122,6 @@ class DataStore {
128
122
  this.aliasState = AliasState.None;
129
123
  this.pendingAliases = datastores.pendingAliases;
130
124
  }
131
- /**
132
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
133
- */
134
- get IFluidRouter() {
135
- return this.fluidDataStoreChannel;
136
- }
137
125
  async ackBasedPromise(executor) {
138
126
  let rejectBecauseDispose;
139
127
  return new Promise((resolve, reject) => {
@@ -1 +1 @@
1
- {"version":3,"file":"dataStore.js","sourceRoot":"","sources":["../src/dataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAAoG;AACpG,2DAAqE;AACrE,iFAAoE;AAqBpE;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,CACtC,0BAA+B,EACwB,EAAE;IACzD,OAAO,CACN,OAAO,0BAA0B,EAAE,UAAU,KAAK,QAAQ;QAC1D,OAAO,0BAA0B,EAAE,KAAK,KAAK,QAAQ,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;IACjD,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACnC,CAAC;IAEO,KAAK,CAAC,eAAe,CAC5B,QAGS;QAET,IAAI,oBAAgC,CAAC;QACrC,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzC,oBAAoB,GAAG,GAAG,EAAE,CAC3B,MAAM,CACL,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAC/E,CAAC;YAEH,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAC1B,oBAAoB,EAAE,CAAC;gBACvB,OAAO;aACP;YAED,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;YACjD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;YACf,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, TelemetryDataTag, UsageError } from \"@fluidframework/telemetry-utils\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { FluidObject, IFluidHandle, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport {\n\tAliasResult,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n} from \"@fluidframework/runtime-definitions\";\nimport { ContainerRuntime } from \"./containerRuntime\";\nimport { DataStores } from \"./dataStores\";\n\n/**\n * Interface for an op to be used for assigning an\n * alias to a datastore\n */\nexport interface IDataStoreAliasMessage {\n\t/** The internal id of the datastore */\n\treadonly internalId: string;\n\t/** The alias name to be assigned to the datastore */\n\treadonly alias: string;\n}\n\n/**\n * Type guard that returns true if the given alias message is actually an instance of\n * a class which implements {@link IDataStoreAliasMessage}\n * @param maybeDataStoreAliasMessage - message object to be validated\n * @returns True if the {@link IDataStoreAliasMessage} is fully implemented, false otherwise\n */\nexport const isDataStoreAliasMessage = (\n\tmaybeDataStoreAliasMessage: any,\n): maybeDataStoreAliasMessage is IDataStoreAliasMessage => {\n\treturn (\n\t\ttypeof maybeDataStoreAliasMessage?.internalId === \"string\" &&\n\t\ttypeof maybeDataStoreAliasMessage?.alias === \"string\"\n\t);\n};\n\nexport const channelToDataStore = (\n\tfluidDataStoreChannel: IFluidDataStoreChannel,\n\tinternalId: string,\n\truntime: ContainerRuntime,\n\tdatastores: DataStores,\n\tlogger: ITelemetryLoggerExt,\n): IDataStore => new DataStore(fluidDataStoreChannel, internalId, runtime, datastores, logger);\n\nenum AliasState {\n\tAliased = \"Aliased\",\n\tAliasing = \"Aliasing\",\n\tNone = \"None\",\n}\n\nclass DataStore implements IDataStore {\n\tprivate aliasState: AliasState = AliasState.None;\n\tprivate alias: string | undefined;\n\tprivate readonly pendingAliases: Map<string, Promise<AliasResult>>;\n\tprivate aliasResult: Promise<AliasResult> | undefined;\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.trySetAlias}\n\t */\n\tasync trySetAlias(alias: string): Promise<AliasResult> {\n\t\tif (alias.includes(\"/\")) {\n\t\t\tthrow new UsageError(`The alias cannot contain slashes: '${alias}'`);\n\t\t}\n\n\t\tswitch (this.aliasState) {\n\t\t\t// If we're already aliasing, check if it's for the same value and return\n\t\t\t// the stored promise, otherwise return 'AlreadyAliased'\n\t\t\tcase AliasState.Aliasing:\n\t\t\t\tassert(\n\t\t\t\t\tthis.aliasResult !== undefined,\n\t\t\t\t\t0x316 /* There should be a cached promise of in-progress aliasing */,\n\t\t\t\t);\n\t\t\t\tawait this.aliasResult;\n\t\t\t\treturn this.alias === alias ? \"Success\" : \"AlreadyAliased\";\n\n\t\t\t// If this datastore is already aliased, return true only if this\n\t\t\t// is a repeated call for the same alias\n\t\t\tcase AliasState.Aliased:\n\t\t\t\treturn this.alias === alias ? \"Success\" : \"AlreadyAliased\";\n\n\t\t\tcase AliasState.None: {\n\t\t\t\tconst existingAlias = this.pendingAliases.get(alias);\n\t\t\t\tif (existingAlias !== undefined) {\n\t\t\t\t\t// There is already another datastore which will be aliased\n\t\t\t\t\t// to the same name\n\t\t\t\t\treturn \"Conflict\";\n\t\t\t\t}\n\n\t\t\t\t// There is no current or past alias operation for this datastore,\n\t\t\t\t// or for this alias, so it is safe to continue execution\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tunreachableCase(this.aliasState);\n\t\t}\n\n\t\tthis.aliasState = AliasState.Aliasing;\n\t\tthis.aliasResult = this.trySetAliasInternal(alias);\n\t\tthis.pendingAliases.set(alias, this.aliasResult);\n\t\treturn this.aliasResult;\n\t}\n\n\tasync trySetAliasInternal(alias: string): Promise<AliasResult> {\n\t\tconst message: IDataStoreAliasMessage = {\n\t\t\tinternalId: this.internalId,\n\t\t\talias,\n\t\t};\n\n\t\tthis.fluidDataStoreChannel.makeVisibleAndAttachGraph();\n\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\tconst localResult = this.datastores.processAliasMessageCore(message);\n\t\t\t// Explicitly lock-out future attempts of aliasing,\n\t\t\t// regardless of result\n\t\t\tthis.aliasState = AliasState.Aliased;\n\t\t\treturn localResult ? \"Success\" : \"Conflict\";\n\t\t}\n\n\t\tconst aliased = await this.ackBasedPromise<boolean>((resolve) => {\n\t\t\tthis.runtime.submitDataStoreAliasOp(message, resolve);\n\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"AliasingException\",\n\t\t\t\t\t\talias: {\n\t\t\t\t\t\t\tvalue: alias,\n\t\t\t\t\t\t\ttag: TelemetryDataTag.UserData,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinternalId: {\n\t\t\t\t\t\t\tvalue: this.internalId,\n\t\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tthis.pendingAliases.delete(alias);\n\t\t\t});\n\n\t\tif (!aliased) {\n\t\t\tthis.aliasState = AliasState.None;\n\t\t\tthis.aliasResult = undefined;\n\t\t\treturn \"Conflict\";\n\t\t}\n\n\t\tthis.alias = alias;\n\t\tthis.aliasState = AliasState.Aliased;\n\t\treturn \"Success\";\n\t}\n\n\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\treturn this.fluidDataStoreChannel.request(request);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}\n\t */\n\tget entryPoint(): IFluidHandle<FluidObject> {\n\t\treturn this.fluidDataStoreChannel.entryPoint;\n\t}\n\n\tconstructor(\n\t\tprivate readonly fluidDataStoreChannel: IFluidDataStoreChannel,\n\t\tprivate readonly internalId: string,\n\t\tprivate readonly runtime: ContainerRuntime,\n\t\tprivate readonly datastores: DataStores,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.pendingAliases = datastores.pendingAliases;\n\t}\n\n\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\tpublic get IFluidRouter() {\n\t\treturn this.fluidDataStoreChannel;\n\t}\n\n\tprivate async ackBasedPromise<T>(\n\t\texecutor: (\n\t\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\t\treject: (reason?: any) => void,\n\t\t) => void,\n\t): Promise<T> {\n\t\tlet rejectBecauseDispose: () => void;\n\t\treturn new Promise<T>((resolve, reject) => {\n\t\t\trejectBecauseDispose = () =>\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\"ContainerRuntime disposed while this ack-based Promise was pending\"),\n\t\t\t\t);\n\n\t\t\tif (this.runtime.disposed) {\n\t\t\t\trejectBecauseDispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.runtime.on(\"dispose\", rejectBecauseDispose);\n\t\t\texecutor(resolve, reject);\n\t\t}).finally(() => {\n\t\t\tthis.runtime.off(\"dispose\", rejectBecauseDispose);\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"dataStore.js","sourceRoot":"","sources":["../src/dataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAAoG;AACpG,2DAAqE;AACrE,iFAAoE;AAqBpE;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,CACtC,0BAA+B,EACwB,EAAE;IACzD,OAAO,CACN,OAAO,0BAA0B,EAAE,UAAU,KAAK,QAAQ;QAC1D,OAAO,0BAA0B,EAAE,KAAK,KAAK,QAAQ,CACrD,CAAC;AACH,CAAC,CAAC;AAPW,QAAA,uBAAuB,2BAOlC;AAEK,MAAM,kBAAkB,GAAG,CACjC,qBAA6C,EAC7C,UAAkB,EAClB,OAAyB,EACzB,UAAsB,EACtB,MAA2B,EACd,EAAE,CAAC,IAAI,SAAS,CAAC,qBAAqB,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AANlF,QAAA,kBAAkB,sBAMgE;AAE/F,IAAK,UAIJ;AAJD,WAAK,UAAU;IACd,iCAAmB,CAAA;IACnB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;AACd,CAAC,EAJI,UAAU,KAAV,UAAU,QAId;AAED,MAAM,SAAS;IAMd;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,KAAa;QAC9B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,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under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, TelemetryDataTag, UsageError } from \"@fluidframework/telemetry-utils\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { FluidObject, IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tAliasResult,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n} from \"@fluidframework/runtime-definitions\";\nimport { ContainerRuntime } from \"./containerRuntime\";\nimport { DataStores } from \"./dataStores\";\n\n/**\n * Interface for an op to be used for assigning an\n * alias to a datastore\n */\nexport interface IDataStoreAliasMessage {\n\t/** The internal id of the datastore */\n\treadonly internalId: string;\n\t/** The alias name to be assigned to the datastore */\n\treadonly alias: string;\n}\n\n/**\n * Type guard that returns true if the given alias message is actually an instance of\n * a class which implements {@link IDataStoreAliasMessage}\n * @param maybeDataStoreAliasMessage - message object to be validated\n * @returns True if the {@link IDataStoreAliasMessage} is fully implemented, false otherwise\n */\nexport const isDataStoreAliasMessage = (\n\tmaybeDataStoreAliasMessage: any,\n): maybeDataStoreAliasMessage is IDataStoreAliasMessage => {\n\treturn (\n\t\ttypeof maybeDataStoreAliasMessage?.internalId === \"string\" &&\n\t\ttypeof maybeDataStoreAliasMessage?.alias === \"string\"\n\t);\n};\n\nexport const channelToDataStore = (\n\tfluidDataStoreChannel: IFluidDataStoreChannel,\n\tinternalId: string,\n\truntime: ContainerRuntime,\n\tdatastores: DataStores,\n\tlogger: ITelemetryLoggerExt,\n): IDataStore => new DataStore(fluidDataStoreChannel, internalId, runtime, datastores, logger);\n\nenum AliasState {\n\tAliased = \"Aliased\",\n\tAliasing = \"Aliasing\",\n\tNone = \"None\",\n}\n\nclass DataStore implements IDataStore {\n\tprivate aliasState: AliasState = AliasState.None;\n\tprivate alias: string | undefined;\n\tprivate readonly pendingAliases: Map<string, Promise<AliasResult>>;\n\tprivate aliasResult: Promise<AliasResult> | undefined;\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.trySetAlias}\n\t */\n\tasync trySetAlias(alias: string): Promise<AliasResult> {\n\t\tif (alias.includes(\"/\")) {\n\t\t\tthrow new UsageError(`The alias cannot contain slashes: '${alias}'`);\n\t\t}\n\n\t\tswitch (this.aliasState) {\n\t\t\t// If we're already aliasing, check if it's for the same value and return\n\t\t\t// the stored promise, otherwise return 'AlreadyAliased'\n\t\t\tcase AliasState.Aliasing:\n\t\t\t\tassert(\n\t\t\t\t\tthis.aliasResult !== undefined,\n\t\t\t\t\t0x316 /* There should be a cached promise of in-progress aliasing */,\n\t\t\t\t);\n\t\t\t\tawait this.aliasResult;\n\t\t\t\treturn this.alias === alias ? \"Success\" : \"AlreadyAliased\";\n\n\t\t\t// If this datastore is already aliased, return true only if this\n\t\t\t// is a repeated call for the same alias\n\t\t\tcase AliasState.Aliased:\n\t\t\t\treturn this.alias === alias ? \"Success\" : \"AlreadyAliased\";\n\n\t\t\tcase AliasState.None: {\n\t\t\t\tconst existingAlias = this.pendingAliases.get(alias);\n\t\t\t\tif (existingAlias !== undefined) {\n\t\t\t\t\t// There is already another datastore which will be aliased\n\t\t\t\t\t// to the same name\n\t\t\t\t\treturn \"Conflict\";\n\t\t\t\t}\n\n\t\t\t\t// There is no current or past alias operation for this datastore,\n\t\t\t\t// or for this alias, so it is safe to continue execution\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tunreachableCase(this.aliasState);\n\t\t}\n\n\t\tthis.aliasState = AliasState.Aliasing;\n\t\tthis.aliasResult = this.trySetAliasInternal(alias);\n\t\tthis.pendingAliases.set(alias, this.aliasResult);\n\t\treturn this.aliasResult;\n\t}\n\n\tasync trySetAliasInternal(alias: string): Promise<AliasResult> {\n\t\tconst message: IDataStoreAliasMessage = {\n\t\t\tinternalId: this.internalId,\n\t\t\talias,\n\t\t};\n\n\t\tthis.fluidDataStoreChannel.makeVisibleAndAttachGraph();\n\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\tconst localResult = this.datastores.processAliasMessageCore(message);\n\t\t\t// Explicitly lock-out future attempts of aliasing,\n\t\t\t// regardless of result\n\t\t\tthis.aliasState = AliasState.Aliased;\n\t\t\treturn localResult ? \"Success\" : \"Conflict\";\n\t\t}\n\n\t\tconst aliased = await this.ackBasedPromise<boolean>((resolve) => {\n\t\t\tthis.runtime.submitDataStoreAliasOp(message, resolve);\n\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"AliasingException\",\n\t\t\t\t\t\talias: {\n\t\t\t\t\t\t\tvalue: alias,\n\t\t\t\t\t\t\ttag: TelemetryDataTag.UserData,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinternalId: {\n\t\t\t\t\t\t\tvalue: this.internalId,\n\t\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tthis.pendingAliases.delete(alias);\n\t\t\t});\n\n\t\tif (!aliased) {\n\t\t\tthis.aliasState = AliasState.None;\n\t\t\tthis.aliasResult = undefined;\n\t\t\treturn \"Conflict\";\n\t\t}\n\n\t\tthis.alias = alias;\n\t\tthis.aliasState = AliasState.Aliased;\n\t\treturn \"Success\";\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}\n\t */\n\tget entryPoint(): IFluidHandle<FluidObject> {\n\t\treturn this.fluidDataStoreChannel.entryPoint;\n\t}\n\n\tconstructor(\n\t\tprivate readonly fluidDataStoreChannel: IFluidDataStoreChannel,\n\t\tprivate readonly internalId: string,\n\t\tprivate readonly runtime: ContainerRuntime,\n\t\tprivate readonly datastores: DataStores,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.pendingAliases = datastores.pendingAliases;\n\t}\n\n\tprivate async ackBasedPromise<T>(\n\t\texecutor: (\n\t\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\t\treject: (reason?: any) => void,\n\t\t) => void,\n\t): Promise<T> {\n\t\tlet rejectBecauseDispose: () => void;\n\t\treturn new Promise<T>((resolve, reject) => {\n\t\t\trejectBecauseDispose = () =>\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\"ContainerRuntime disposed while this ack-based Promise was pending\"),\n\t\t\t\t);\n\n\t\t\tif (this.runtime.disposed) {\n\t\t\t\trejectBecauseDispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.runtime.on(\"dispose\", rejectBecauseDispose);\n\t\t\texecutor(resolve, reject);\n\t\t}).finally(() => {\n\t\t\tthis.runtime.off(\"dispose\", rejectBecauseDispose);\n\t\t});\n\t}\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { ISummaryRuntimeOptions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, IContainerRuntimeOptions, isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime, RuntimeHeaders, AllowTombstoneRequestHeaderKey, AllowInactiveRequestHeaderKey, TombstoneResponseHeaderKey, InactiveResponseHeaderKey, ISummaryConfiguration, DefaultSummaryConfiguration, ICompressionRuntimeOptions, CompressionAlgorithms, TEST_requestSummarizer, } from "./containerRuntime";
5
+ export { ISummaryRuntimeOptions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, IContainerRuntimeOptions, isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime, RuntimeHeaders, AllowTombstoneRequestHeaderKey, AllowInactiveRequestHeaderKey, TombstoneResponseHeaderKey, InactiveResponseHeaderKey, ISummaryConfiguration, DefaultSummaryConfiguration, ICompressionRuntimeOptions, CompressionAlgorithms, } from "./containerRuntime";
6
6
  export { ContainerMessageType, ContainerRuntimeMessage, IContainerRuntimeMessageCompatDetails, CompatModeBehavior, RecentlyAddedContainerRuntimeMessageDetails, } from "./messageTypes";
7
7
  export { IBlobManagerLoadInfo } from "./blobManager";
8
8
  export { FluidDataStoreRegistry } from "./dataStoreRegistry";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,qCAAqC,EACrC,kBAAkB,EAClB,2CAA2C,GAC3C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACN,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACR,MAAM,MAAM,CAAC;AACd,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC1B,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gCAAgC,EAChC,wBAAwB,EACxB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAIjE,OAAO;AACN;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,UAAU,GACV,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,8BAA8B,EAC9B,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,qCAAqC,EACrC,kBAAkB,EAClB,2CAA2C,GAC3C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACN,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACR,MAAM,MAAM,CAAC;AACd,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC1B,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gCAAgC,EAChC,wBAAwB,EACxB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAIjE,OAAO;AACN;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,gBAAgB;AAChB;;GAEG;AACH,UAAU,GACV,MAAM,+BAA+B,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isStableId = exports.generateStableId = exports.assertIsStableId = exports.unpackRuntimeMessage = exports.SummaryCollection = exports.Summarizer = exports.neverCancelledSummaryToken = exports.GCNodeType = exports.FluidDataStoreRegistry = exports.ContainerMessageType = exports.TEST_requestSummarizer = exports.CompressionAlgorithms = exports.DefaultSummaryConfiguration = exports.InactiveResponseHeaderKey = exports.TombstoneResponseHeaderKey = exports.AllowInactiveRequestHeaderKey = exports.AllowTombstoneRequestHeaderKey = exports.RuntimeHeaders = exports.ContainerRuntime = exports.agentSchedulerId = exports.RuntimeMessage = exports.isRuntimeMessage = void 0;
7
+ exports.isStableId = exports.generateStableId = exports.assertIsStableId = exports.unpackRuntimeMessage = exports.SummaryCollection = exports.Summarizer = exports.neverCancelledSummaryToken = exports.GCNodeType = exports.FluidDataStoreRegistry = exports.ContainerMessageType = exports.CompressionAlgorithms = exports.DefaultSummaryConfiguration = exports.InactiveResponseHeaderKey = exports.TombstoneResponseHeaderKey = exports.AllowInactiveRequestHeaderKey = exports.AllowTombstoneRequestHeaderKey = exports.RuntimeHeaders = exports.ContainerRuntime = exports.agentSchedulerId = exports.RuntimeMessage = exports.isRuntimeMessage = void 0;
8
8
  var containerRuntime_1 = require("./containerRuntime");
9
9
  Object.defineProperty(exports, "isRuntimeMessage", { enumerable: true, get: function () { return containerRuntime_1.isRuntimeMessage; } });
10
10
  Object.defineProperty(exports, "RuntimeMessage", { enumerable: true, get: function () { return containerRuntime_1.RuntimeMessage; } });
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "TombstoneResponseHeaderKey", { enumerable: true,
17
17
  Object.defineProperty(exports, "InactiveResponseHeaderKey", { enumerable: true, get: function () { return containerRuntime_1.InactiveResponseHeaderKey; } });
18
18
  Object.defineProperty(exports, "DefaultSummaryConfiguration", { enumerable: true, get: function () { return containerRuntime_1.DefaultSummaryConfiguration; } });
19
19
  Object.defineProperty(exports, "CompressionAlgorithms", { enumerable: true, get: function () { return containerRuntime_1.CompressionAlgorithms; } });
20
- Object.defineProperty(exports, "TEST_requestSummarizer", { enumerable: true, get: function () { return containerRuntime_1.TEST_requestSummarizer; } });
21
20
  var messageTypes_1 = require("./messageTypes");
22
21
  Object.defineProperty(exports, "ContainerMessageType", { enumerable: true, get: function () { return messageTypes_1.ContainerMessageType; } });
23
22
  var dataStoreRegistry_1 = require("./dataStoreRegistry");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAqB4B;AAd3B,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AACd,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AACd,kIAAA,8BAA8B,OAAA;AAC9B,iIAAA,6BAA6B,OAAA;AAC7B,8HAAA,0BAA0B,OAAA;AAC1B,6HAAA,yBAAyB,OAAA;AAEzB,+HAAA,2BAA2B,OAAA;AAE3B,yHAAA,qBAAqB,OAAA;AACrB,0HAAA,sBAAsB,OAAA;AAEvB,+CAMwB;AALvB,oHAAA,oBAAoB,OAAA;AAOrB,yDAA6D;AAApD,2HAAA,sBAAsB,OAAA;AAC/B,2BASc;AARb,gGAAA,UAAU,OAAA;AASX,qCAgDmB;AA3ClB,qHAAA,0BAA0B,OAAA;AAC1B,qGAAA,UAAU,OAAA;AAEV,4GAAA,iBAAiB,OAAA;AAyClB,6CAAiE;AAA5C,mHAAA,oBAAoB,OAAA;AAEzC,0CAA0C;AAC1C,iCAAiC;AACjC,+DAauC;AAZtC;;GAEG;AACH,iHAAA,gBAAgB,OAAA;AAChB;;GAEG;AACH,iHAAA,gBAAgB,OAAA;AAChB;;GAEG;AACH,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tISummaryRuntimeOptions,\n\tISummaryBaseConfiguration,\n\tISummaryConfigurationHeuristics,\n\tISummaryConfigurationDisableSummarizer,\n\tISummaryConfigurationDisableHeuristics,\n\tIContainerRuntimeOptions,\n\tisRuntimeMessage,\n\tRuntimeMessage,\n\tagentSchedulerId,\n\tContainerRuntime,\n\tRuntimeHeaders,\n\tAllowTombstoneRequestHeaderKey,\n\tAllowInactiveRequestHeaderKey,\n\tTombstoneResponseHeaderKey,\n\tInactiveResponseHeaderKey,\n\tISummaryConfiguration,\n\tDefaultSummaryConfiguration,\n\tICompressionRuntimeOptions,\n\tCompressionAlgorithms,\n\tTEST_requestSummarizer,\n} from \"./containerRuntime\";\nexport {\n\tContainerMessageType,\n\tContainerRuntimeMessage,\n\tIContainerRuntimeMessageCompatDetails,\n\tCompatModeBehavior,\n\tRecentlyAddedContainerRuntimeMessageDetails,\n} from \"./messageTypes\";\nexport { IBlobManagerLoadInfo } from \"./blobManager\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry\";\nexport {\n\tGCNodeType,\n\tIGCMetadata,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCStats,\n} from \"./gc\";\nexport {\n\tIAckedSummary,\n\tISummarizer,\n\tISummarizeResults,\n\tISummaryCancellationToken,\n\tneverCancelledSummaryToken,\n\tSummarizer,\n\tSummarizerStopReason,\n\tSummaryCollection,\n\tEnqueueSummarizeResult,\n\tIAckSummaryResult,\n\tIBaseSummarizeResult,\n\tIBroadcastSummaryResult,\n\tICancellationToken,\n\tIConnectableRuntime,\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIEnqueueSummarizeOptions,\n\tIGenerateSummaryTreeResult,\n\tIGeneratedSummaryStats,\n\tINackSummaryResult,\n\tIOnDemandSummarizeOptions,\n\tIRefreshSummaryAckOptions,\n\tISubmitSummaryOpResult,\n\tISubmitSummaryOptions,\n\tISerializedElection,\n\tISummarizeOptions,\n\tISummarizerEvents,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummarizingWarning,\n\tIUploadSummaryResult,\n\tSubmitSummaryResult,\n\tSummarizeResultPart,\n\tIClientSummaryWatcher,\n\tISummary,\n\tISummaryCollectionOpEvents,\n\tISummaryAckMessage,\n\tISummaryMetadataMessage,\n\tISummaryNackMessage,\n\tISummaryOpMessage,\n\tOpActionEventListener,\n\tOpActionEventName,\n\tICancellableSummarizerController,\n\tSubmitSummaryFailureData,\n\tSummaryStage,\n\tIRetriableFailureResult,\n\tISummarizeEventProps,\n} from \"./summary\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle\";\n\n// Re-exports for backwards compatibility.\n// Will be removed in the future.\nexport {\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tassertIsStableId,\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tgenerateStableId,\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tisStableId,\n} from \"@fluidframework/id-compressor\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAoB4B;AAb3B,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AACd,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AACd,kIAAA,8BAA8B,OAAA;AAC9B,iIAAA,6BAA6B,OAAA;AAC7B,8HAAA,0BAA0B,OAAA;AAC1B,6HAAA,yBAAyB,OAAA;AAEzB,+HAAA,2BAA2B,OAAA;AAE3B,yHAAA,qBAAqB,OAAA;AAEtB,+CAMwB;AALvB,oHAAA,oBAAoB,OAAA;AAOrB,yDAA6D;AAApD,2HAAA,sBAAsB,OAAA;AAC/B,2BASc;AARb,gGAAA,UAAU,OAAA;AASX,qCAgDmB;AA3ClB,qHAAA,0BAA0B,OAAA;AAC1B,qGAAA,UAAU,OAAA;AAEV,4GAAA,iBAAiB,OAAA;AAyClB,6CAAiE;AAA5C,mHAAA,oBAAoB,OAAA;AAEzC,0CAA0C;AAC1C,iCAAiC;AACjC,+DAauC;AAZtC;;GAEG;AACH,iHAAA,gBAAgB,OAAA;AAChB;;GAEG;AACH,iHAAA,gBAAgB,OAAA;AAChB;;GAEG;AACH,2GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tISummaryRuntimeOptions,\n\tISummaryBaseConfiguration,\n\tISummaryConfigurationHeuristics,\n\tISummaryConfigurationDisableSummarizer,\n\tISummaryConfigurationDisableHeuristics,\n\tIContainerRuntimeOptions,\n\tisRuntimeMessage,\n\tRuntimeMessage,\n\tagentSchedulerId,\n\tContainerRuntime,\n\tRuntimeHeaders,\n\tAllowTombstoneRequestHeaderKey,\n\tAllowInactiveRequestHeaderKey,\n\tTombstoneResponseHeaderKey,\n\tInactiveResponseHeaderKey,\n\tISummaryConfiguration,\n\tDefaultSummaryConfiguration,\n\tICompressionRuntimeOptions,\n\tCompressionAlgorithms,\n} from \"./containerRuntime\";\nexport {\n\tContainerMessageType,\n\tContainerRuntimeMessage,\n\tIContainerRuntimeMessageCompatDetails,\n\tCompatModeBehavior,\n\tRecentlyAddedContainerRuntimeMessageDetails,\n} from \"./messageTypes\";\nexport { IBlobManagerLoadInfo } from \"./blobManager\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry\";\nexport {\n\tGCNodeType,\n\tIGCMetadata,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCStats,\n} from \"./gc\";\nexport {\n\tIAckedSummary,\n\tISummarizer,\n\tISummarizeResults,\n\tISummaryCancellationToken,\n\tneverCancelledSummaryToken,\n\tSummarizer,\n\tSummarizerStopReason,\n\tSummaryCollection,\n\tEnqueueSummarizeResult,\n\tIAckSummaryResult,\n\tIBaseSummarizeResult,\n\tIBroadcastSummaryResult,\n\tICancellationToken,\n\tIConnectableRuntime,\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIEnqueueSummarizeOptions,\n\tIGenerateSummaryTreeResult,\n\tIGeneratedSummaryStats,\n\tINackSummaryResult,\n\tIOnDemandSummarizeOptions,\n\tIRefreshSummaryAckOptions,\n\tISubmitSummaryOpResult,\n\tISubmitSummaryOptions,\n\tISerializedElection,\n\tISummarizeOptions,\n\tISummarizerEvents,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummarizingWarning,\n\tIUploadSummaryResult,\n\tSubmitSummaryResult,\n\tSummarizeResultPart,\n\tIClientSummaryWatcher,\n\tISummary,\n\tISummaryCollectionOpEvents,\n\tISummaryAckMessage,\n\tISummaryMetadataMessage,\n\tISummaryNackMessage,\n\tISummaryOpMessage,\n\tOpActionEventListener,\n\tOpActionEventName,\n\tICancellableSummarizerController,\n\tSubmitSummaryFailureData,\n\tSummaryStage,\n\tIRetriableFailureResult,\n\tISummarizeEventProps,\n} from \"./summary\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle\";\n\n// Re-exports for backwards compatibility.\n// Will be removed in the future.\nexport {\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tassertIsStableId,\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tgenerateStableId,\n\t/**\n\t * @deprecated Import from `@fluidframework/id-compressor` instead.\n\t */\n\tisStableId,\n} from \"@fluidframework/id-compressor\";\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/container-runtime";
8
- export declare const pkgVersion = "2.0.0-internal.7.4.0";
8
+ export declare const pkgVersion = "2.0.0-internal.8.0.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/container-runtime";
11
- exports.pkgVersion = "2.0.0-internal.7.4.0";
11
+ exports.pkgVersion = "2.0.0-internal.8.0.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.0.0-internal.7.4.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.0.0-internal.8.0.0\";\n"]}
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
6
  import { ITelemetryLoggerExt, IFluidErrorBase, LoggingError } from "@fluidframework/telemetry-utils";
7
- import { ILoader } from "@fluidframework/container-definitions";
8
7
  import { IFluidHandleContext } from "@fluidframework/core-interfaces";
9
8
  import { ISummaryConfiguration } from "../containerRuntime";
10
9
  import { ICancellableSummarizerController } from "./runWhileConnectedCoordinator";
@@ -51,17 +50,6 @@ export declare class Summarizer extends TypedEventEmitter<ISummarizerEvents> imp
51
50
  * In practical terms, it's same runtime (this.runtime) with clientType === "summarizer".
52
51
  */
53
52
  internalsProvider: ISummarizerInternalsProvider, handleContext: IFluidHandleContext, summaryCollection: SummaryCollection, runCoordinatorCreateFn: (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>);
54
- /**
55
- * Creates a Summarizer and its underlying client.
56
- * Note that different implementations of ILoader will handle the URL differently.
57
- * ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's
58
- * starting with "/" as relative to the Container. The general ILoader
59
- * interface will expect an absolute URL and will not handle "/".
60
- * @param loader - the loader that resolves the request
61
- * @param url - the URL used to resolve the container
62
- * @deprecated Creating a summarizer is not a publicly supported API. Please remove all usage of this static method.
63
- */
64
- static create(loader: ILoader, url: string): Promise<ISummarizer>;
65
53
  run(onBehalfOf: string): Promise<SummarizerStopReason>;
66
54
  /**
67
55
  * Stops the summarizer from running. This will complete
@@ -1 +1 @@
1
- {"version":3,"file":"summarizer.d.ts","sourceRoot":"","sources":["../../src/summary/summarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACN,mBAAmB,EAEnB,eAAe,EACf,YAAY,EAGZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAgB,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAe,mBAAmB,EAAY,MAAM,iCAAiC,CAAC;AAE7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EACN,mBAAmB,EACnB,WAAW,EAEX,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,wBAA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C,oBAAoB,CAAC;IAWnE;;;;OAIG;IACI,IAAI,CAAC,MAAM,EAAE,oBAAoB;IAIjC,KAAK;YAOE,OAAO;IAmDrB;;;;;OAKG;WACW,2BAA2B,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO;IAIpF,OAAO,CAAC,cAAc,CAAsC;IAE5D;;;;;;;;OAQG;YACW,KAAK;IAuDnB,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAEnC;IAEF;;;;;OAKG;IACI,OAAO;IAYP,iBAAiB,CAAC,OAAO,EAAE,yBAAyB,GAAG,iBAAiB;IA4DxE,gBAAgB,CAAC,OAAO,EAAE,wBAAwB,GAAG,sBAAsB;IAW3E,oBAAoB,CAAC,CAAC,gBAAgB,CAAC,EAAE,MAAM;CAGtD"}
@@ -8,10 +8,6 @@ exports.Summarizer = exports.createSummarizingWarning = exports.SummarizingWarni
8
8
  const core_utils_1 = require("@fluidframework/core-utils");
9
9
  const client_utils_1 = require("@fluid-internal/client-utils");
10
10
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
11
- const container_definitions_1 = require("@fluidframework/container-definitions");
12
- const driver_definitions_1 = require("@fluidframework/driver-definitions");
13
- const runtime_utils_1 = require("@fluidframework/runtime-utils");
14
- const summarizerClientElection_1 = require("./summarizerClientElection");
15
11
  const runningSummarizer_1 = require("./runningSummarizer");
16
12
  const summarizerHeuristics_1 = require("./summarizerHeuristics");
17
13
  const summaryGenerator_1 = require("./summaryGenerator");
@@ -64,48 +60,6 @@ class Summarizer extends client_utils_1.TypedEventEmitter {
64
60
  };
65
61
  this.logger = (0, telemetry_utils_1.createChildLogger)({ logger: this.runtime.logger, namespace: "Summarizer" });
66
62
  }
67
- /**
68
- * Creates a Summarizer and its underlying client.
69
- * Note that different implementations of ILoader will handle the URL differently.
70
- * ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's
71
- * starting with "/" as relative to the Container. The general ILoader
72
- * interface will expect an absolute URL and will not handle "/".
73
- * @param loader - the loader that resolves the request
74
- * @param url - the URL used to resolve the container
75
- * @deprecated Creating a summarizer is not a publicly supported API. Please remove all usage of this static method.
76
- */
77
- static async create(loader, url) {
78
- const request = {
79
- headers: {
80
- [container_definitions_1.LoaderHeader.cache]: false,
81
- [container_definitions_1.LoaderHeader.clientDetails]: {
82
- capabilities: { interactive: false },
83
- type: summarizerClientElection_1.summarizerClientType,
84
- },
85
- [driver_definitions_1.DriverHeader.summarizingClient]: true,
86
- [container_definitions_1.LoaderHeader.reconnect]: false,
87
- },
88
- url,
89
- };
90
- const resolvedContainer = await loader.resolve(request);
91
- let fluidObject;
92
- // Older containers may not have the "getEntryPoint" API
93
- // ! This check will need to stay until LTS of loader moves past 2.0.0-internal.7.0.0
94
- if (resolvedContainer.getEntryPoint !== undefined) {
95
- fluidObject = await resolvedContainer.getEntryPoint();
96
- }
97
- else {
98
- const response = await resolvedContainer.request({ url: "_summarizer" });
99
- if (response.status !== 200 || response.mimeType !== "fluid/object") {
100
- throw (0, runtime_utils_1.responseToException)(response, request);
101
- }
102
- fluidObject = response.value;
103
- }
104
- if (fluidObject?.ISummarizer === undefined) {
105
- throw new telemetry_utils_1.UsageError("Fluid object does not implement ISummarizer");
106
- }
107
- return fluidObject.ISummarizer;
108
- }
109
63
  async run(onBehalfOf) {
110
64
  try {
111
65
  return await this.runCore(onBehalfOf);
@@ -1 +1 @@
1
- {"version":3,"file":"summarizer.js","sourceRoot":"","sources":["../../src/summary/summarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAsD;AACtD,+DAAiE;AACjE,qEAOyC;AACzC,iFAA8E;AAC9E,2EAAkE;AAElE,iEAAoE;AAGpE,yEAAkE;AAElE,2DAAwD;AAgBxD,iEAAgE;AAChE,yDAA4D;AAE5D,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,MAAa,kBACZ,SAAQ,8BAAY;IAMpB,YACC,YAAoB,EACX,SAAkB,KAAK;QAEhC,KAAK,CAAC,YAAY,CAAC,C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pC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAC9B;YACD,MAAM,IAAI,4BAAU,CAAC,gDAAgD,CAAC,CAAC;SACvE;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAEM,oBAAoB,CAAE,gBAAyB;QACrD,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtD,CAAC;CACD;AAvUD,gCAuUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Deferred } from \"@fluidframework/core-utils\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tITelemetryLoggerExt,\n\tcreateChildLogger,\n\tIFluidErrorBase,\n\tLoggingError,\n\tUsageError,\n\twrapErrorAndLog,\n} from \"@fluidframework/telemetry-utils\";\nimport { ILoader, LoaderHeader } from \"@fluidframework/container-definitions\";\nimport { DriverHeader } from \"@fluidframework/driver-definitions\";\nimport { FluidObject, IFluidHandleContext, IRequest } from \"@fluidframework/core-interfaces\";\nimport { responseToException } from \"@fluidframework/runtime-utils\";\nimport { ISummaryConfiguration } from \"../containerRuntime\";\nimport { ICancellableSummarizerController } from \"./runWhileConnectedCoordinator\";\nimport { summarizerClientType } from \"./summarizerClientElection\";\nimport { SummaryCollection } from \"./summaryCollection\";\nimport { RunningSummarizer } from \"./runningSummarizer\";\nimport {\n\tIConnectableRuntime,\n\tISummarizer,\n\tISummarizeHeuristicData,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummarizingWarning,\n\tSummarizerStopReason,\n\tIOnDemandSummarizeOptions,\n\tISummarizeResults,\n\tIEnqueueSummarizeOptions,\n\tEnqueueSummarizeResult,\n\tISummarizerEvents,\n\tISummarizeEventProps,\n} from \"./summarizerTypes\";\nimport { SummarizeHeuristicData } from \"./summarizerHeuristics\";\nimport { SummarizeResultBuilder } from \"./summaryGenerator\";\n\nconst summarizingError = \"summarizingError\";\n\nexport class SummarizingWarning\n\textends LoggingError\n\timplements ISummarizingWarning, IFluidErrorBase\n{\n\treadonly errorType = summarizingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\terrorMessage: string,\n\t\treadonly logged: boolean = false,\n\t) {\n\t\tsuper(errorMessage);\n\t}\n\n\tstatic wrap(error: any, logged: boolean = false, logger: ITelemetryLoggerExt) {\n\t\tconst newErrorFn = (errMsg: string) => new SummarizingWarning(errMsg, logged);\n\t\treturn wrapErrorAndLog<SummarizingWarning>(error, newErrorFn, logger);\n\t}\n}\n\nexport const createSummarizingWarning = (errorMessage: string, logged: boolean) =>\n\tnew SummarizingWarning(errorMessage, logged);\n\n/**\n * Summarizer is responsible for coordinating when to generate and send summaries.\n * It is the main entry point for summary work.\n * It is created only by summarizing container (i.e. one with clientType === \"summarizer\")\n * @internal\n */\nexport class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {\n\tpublic get ISummarizer() {\n\t\treturn this;\n\t}\n\n\tprivate readonly logger: ITelemetryLoggerExt;\n\tprivate runningSummarizer?: RunningSummarizer;\n\tprivate _disposed: boolean = false;\n\tprivate starting: boolean = false;\n\n\tprivate readonly stopDeferred = new Deferred<SummarizerStopReason>();\n\n\tconstructor(\n\t\t/** Reference to runtime that created this object.\n\t\t * i.e. runtime with clientType === \"summarizer\"\n\t\t */\n\t\tprivate readonly runtime: ISummarizerRuntime,\n\t\tprivate readonly configurationGetter: () => ISummaryConfiguration,\n\t\t/** Represents an object that can generate summary.\n\t\t * In practical terms, it's same runtime (this.runtime) with clientType === \"summarizer\".\n\t\t */\n\t\tprivate readonly internalsProvider: ISummarizerInternalsProvider,\n\t\thandleContext: IFluidHandleContext,\n\t\tpublic readonly summaryCollection: SummaryCollection,\n\t\tprivate readonly runCoordinatorCreateFn: (\n\t\t\truntime: IConnectableRuntime,\n\t\t) => Promise<ICancellableSummarizerController>,\n\t) {\n\t\tsuper();\n\t\tthis.logger = createChildLogger({ logger: this.runtime.logger, namespace: \"Summarizer\" });\n\t}\n\n\t/**\n\t * Creates a Summarizer and its underlying client.\n\t * Note that different implementations of ILoader will handle the URL differently.\n\t * ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's\n\t * starting with \"/\" as relative to the Container. The general ILoader\n\t * interface will expect an absolute URL and will not handle \"/\".\n\t * @param loader - the loader that resolves the request\n\t * @param url - the URL used to resolve the container\n\t * @deprecated Creating a summarizer is not a publicly supported API. Please remove all usage of this static method.\n\t */\n\tpublic static async create(loader: ILoader, url: string): Promise<ISummarizer> {\n\t\tconst request: IRequest = {\n\t\t\theaders: {\n\t\t\t\t[LoaderHeader.cache]: false,\n\t\t\t\t[LoaderHeader.clientDetails]: {\n\t\t\t\t\tcapabilities: { interactive: false },\n\t\t\t\t\ttype: summarizerClientType,\n\t\t\t\t},\n\t\t\t\t[DriverHeader.summarizingClient]: true,\n\t\t\t\t[LoaderHeader.reconnect]: false,\n\t\t\t},\n\t\t\turl,\n\t\t};\n\n\t\tconst resolvedContainer = await loader.resolve(request);\n\t\tlet fluidObject: FluidObject<ISummarizer> | undefined;\n\n\t\t// Older containers may not have the \"getEntryPoint\" API\n\t\t// ! This check will need to stay until LTS of loader moves past 2.0.0-internal.7.0.0\n\t\tif (resolvedContainer.getEntryPoint !== undefined) {\n\t\t\tfluidObject = await resolvedContainer.getEntryPoint();\n\t\t} else {\n\t\t\tconst response = await resolvedContainer.request({ url: \"_summarizer\" });\n\t\t\tif (response.status !== 200 || response.mimeType !== \"fluid/object\") {\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t}\n\t\t\tfluidObject = response.value;\n\t\t}\n\n\t\tif (fluidObject?.ISummarizer === undefined) {\n\t\t\tthrow new UsageError(\"Fluid object does not implement ISummarizer\");\n\t\t}\n\t\treturn fluidObject.ISummarizer;\n\t}\n\n\tpublic async run(onBehalfOf: string): Promise<SummarizerStopReason> {\n\t\ttry {\n\t\t\treturn await this.runCore(onBehalfOf);\n\t\t} catch (error) {\n\t\t\tthis.stop(\"summarizerException\");\n\t\t\tthrow SummarizingWarning.wrap(error, false /* logged */, this.logger);\n\t\t} finally {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\t/**\n\t * Stops the summarizer from running. This will complete\n\t * the run promise, and also close the container.\n\t * @param reason - reason code for stopping\n\t */\n\tpublic stop(reason: SummarizerStopReason) {\n\t\tthis.stopDeferred.resolve(reason);\n\t}\n\n\tpublic close() {\n\t\t// This will result in \"summarizerClientDisconnected\" stop reason recorded in telemetry,\n\t\t// unless stop() was called earlier\n\t\tthis.dispose();\n\t\tthis.runtime.disposeFn();\n\t}\n\n\tprivate async runCore(onBehalfOf: string): Promise<SummarizerStopReason> {\n\t\tconst runCoordinator: ICancellableSummarizerController = await this.runCoordinatorCreateFn(\n\t\t\tthis.runtime,\n\t\t);\n\n\t\t// Wait for either external signal to cancel, or loss of connectivity.\n\t\tconst stopP = Promise.race([runCoordinator.waitCancelled, this.stopDeferred.promise]);\n\t\tvoid stopP.then((reason) => {\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"StoppingSummarizer\",\n\t\t\t\tonBehalfOf,\n\t\t\t\treason,\n\t\t\t});\n\t\t});\n\n\t\tif (runCoordinator.cancelled) {\n\t\t\treturn runCoordinator.waitCancelled;\n\t\t}\n\n\t\tconst runningSummarizer = await this.start(onBehalfOf, runCoordinator);\n\n\t\t// Wait for either external signal to cancel, or loss of connectivity.\n\t\tconst stopReason = await stopP;\n\n\t\t// There are two possible approaches here:\n\t\t// 1. Propagate cancellation from this.stopDeferred to runCoordinator. This will ensure that we move to the exit\n\t\t// faster, including breaking out of the RunningSummarizer.trySummarize() faster.\n\t\t// We could create new coordinator and pass it to waitStop() -> trySummarizeOnce(\"lastSummary\") flow.\n\t\t// The con of this approach is that we might cancel active summary, and lastSummary will fail because it\n\t\t// did not wait for ack/nack from previous summary. Plus we disregard any 429 kind of info from service\n\t\t// that way (i.e. trySummarize() loop might have been waiting for 5 min because storage told us so).\n\t\t// In general, it's more wasted resources.\n\t\t// 2. We can not do it and make waitStop() do last summary only if there was no active summary. This ensures\n\t\t// that client behaves properly (from server POV) and we do not waste resources. But, it may mean we wait\n\t\t// substantially longer for trySummarize() retries to play out and thus this summary loop may run into\n\t\t// conflict with new summarizer client starting on different client.\n\t\t// As of now, #2 is implemented. It's more forward looking, as issue #7279 suggests changing design for new\n\t\t// summarizer client to not be created until current summarizer fully moves to exit, and that would reduce\n\t\t// cons of #2 substantially.\n\n\t\t// Cleanup after running\n\t\tawait runningSummarizer.waitStop(\n\t\t\t!runCoordinator.cancelled && Summarizer.stopReasonCanRunLastSummary(stopReason),\n\t\t);\n\n\t\t// Propagate reason and ensure that if someone is waiting for cancellation token, they are moving to exit\n\t\trunCoordinator.stop(stopReason);\n\n\t\treturn stopReason;\n\t}\n\n\t/**\n\t * Should we try to run a last summary for the given stop reason?\n\t * Currently only allows \"parentNotConnected\"\n\t * @param stopReason - SummarizerStopReason\n\t * @returns `true` if the stop reason can run a last summary, otherwise `false`.\n\t */\n\tpublic static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean {\n\t\treturn stopReason === \"parentNotConnected\";\n\t}\n\n\tprivate _heuristicData: ISummarizeHeuristicData | undefined;\n\n\t/**\n\t * Put the summarizer in a started state, including creating and initializing the RunningSummarizer.\n\t * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user\n\t * (in the on-demand case).\n\t * @param onBehalfOf - ID of the client that requested that the summarizer start\n\t * @param runCoordinator - cancellation token\n\t * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.\n\t * @returns A promise that is fulfilled when the RunningSummarizer is ready.\n\t */\n\tprivate async start(\n\t\tonBehalfOf: string,\n\t\trunCoordinator: ICancellableSummarizerController,\n\t): Promise<RunningSummarizer> {\n\t\tif (this.runningSummarizer) {\n\t\t\tif (this.runningSummarizer.disposed) {\n\t\t\t\tthrow new UsageError(\"Starting a disposed summarizer\");\n\t\t\t}\n\t\t\treturn this.runningSummarizer;\n\t\t}\n\t\tif (this.starting) {\n\t\t\tthrow new UsageError(\"Attempting to start a summarizer that is already starting\");\n\t\t}\n\t\tthis.starting = true;\n\t\t// Initialize values and first ack (time is not exact)\n\t\tthis.logger.sendTelemetryEvent({\n\t\t\teventName: \"RunningSummarizer\",\n\t\t\tonBehalfOf,\n\t\t\tinitSummarySeqNumber: this.runtime.deltaManager.initialSequenceNumber,\n\t\t\tconfig: JSON.stringify(this.configurationGetter()),\n\t\t});\n\n\t\t// Summarizing container ID (with clientType === \"summarizer\")\n\t\tconst clientId = this.runtime.clientId;\n\t\tif (clientId === undefined) {\n\t\t\tthrow new UsageError(\"clientId should be defined if connected.\");\n\t\t}\n\n\t\tthis._heuristicData = new SummarizeHeuristicData(\n\t\t\tthis.runtime.deltaManager.lastSequenceNumber,\n\t\t\t{\n\t\t\t\t/** summary attempt baseline for heuristics */\n\t\t\t\trefSequenceNumber: this.runtime.deltaManager.initialSequenceNumber,\n\t\t\t\tsummaryTime: Date.now(),\n\t\t\t} as const,\n\t\t);\n\n\t\tconst runningSummarizer = await RunningSummarizer.start(\n\t\t\tthis.logger,\n\t\t\tthis.summaryCollection.createWatcher(clientId),\n\t\t\tthis.configurationGetter(),\n\t\t\tasync (...args) => this.internalsProvider.submitSummary(...args), // submitSummaryCallback\n\t\t\tasync (...args) => this.internalsProvider.refreshLatestSummaryAck(...args), // refreshLatestSummaryCallback\n\t\t\tthis._heuristicData,\n\t\t\tthis.summaryCollection,\n\t\t\trunCoordinator /* cancellationToken */,\n\t\t\t(reason) => runCoordinator.stop(reason) /* stopSummarizerCallback */,\n\t\t\tthis.runtime,\n\t\t);\n\t\tthis.runningSummarizer = runningSummarizer;\n\t\tthis.runningSummarizer.on(\"summarize\", this.handleSummarizeEvent);\n\t\tthis.starting = false;\n\t\treturn runningSummarizer;\n\t}\n\n\tprivate readonly handleSummarizeEvent = (eventProps: ISummarizeEventProps) => {\n\t\tthis.emit(\"summarize\", eventProps);\n\t};\n\n\t/**\n\t * Disposes of resources after running. This cleanup will\n\t * clear any outstanding timers and reset some of the state\n\t * properties.\n\t * Called by ContainerRuntime when it is disposed, as well as at the end the run().\n\t */\n\tpublic dispose() {\n\t\t// Given that the call can come from own ContainerRuntime, ensure that we stop all the processes.\n\t\tthis.stop(\"summarizerClientDisconnected\");\n\n\t\tthis._disposed = true;\n\t\tif (this.runningSummarizer) {\n\t\t\tthis.runningSummarizer.off(\"summarize\", this.handleSummarizeEvent);\n\t\t\tthis.runningSummarizer.dispose();\n\t\t\tthis.runningSummarizer = undefined;\n\t\t}\n\t}\n\n\tpublic summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults {\n\t\ttry {\n\t\t\tif (this._disposed || this.runningSummarizer?.disposed) {\n\t\t\t\tthrow new UsageError(\"Summarizer is already disposed.\");\n\t\t\t}\n\t\t\tif (\n\t\t\t\tthis.runtime.summarizerClientId !== undefined &&\n\t\t\t\tthis.runtime.summarizerClientId !== this.runtime.clientId\n\t\t\t) {\n\t\t\t\t// If there is an elected summarizer, and it's not this one, don't allow on-demand summary.\n\t\t\t\t// This is to prevent the on-demand summary and heuristic-based summary from stepping on\n\t\t\t\t// each other.\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"On-demand summary attempted while an elected summarizer is present\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst builder = new SummarizeResultBuilder();\n\t\t\tif (this.runningSummarizer) {\n\t\t\t\t// Summarizer is already running. Go ahead and start.\n\t\t\t\treturn this.runningSummarizer.summarizeOnDemand(options, builder);\n\t\t\t}\n\n\t\t\t// Summarizer isn't running, so we need to start it, which is an async operation.\n\t\t\t// Manage the promise related to creating the cancellation token here.\n\t\t\t// The promises related to starting, summarizing,\n\t\t\t// and submitting are communicated to the caller through the results builder.\n\t\t\tconst coordinatorCreateP = this.runCoordinatorCreateFn(this.runtime);\n\n\t\t\tcoordinatorCreateP\n\t\t\t\t.then((runCoordinator) => {\n\t\t\t\t\t// Successfully created the cancellation token. Start the summarizer.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst startP = this.start(this.runtime.clientId!, runCoordinator);\n\t\t\t\t\tstartP\n\t\t\t\t\t\t.then(async (runningSummarizer) => {\n\t\t\t\t\t\t\t// Successfully started the summarizer. Run it.\n\t\t\t\t\t\t\trunningSummarizer.summarizeOnDemand(options, builder);\n\t\t\t\t\t\t\t// Wait for a command to stop or loss of connectivity before tearing down the summarizer and client.\n\t\t\t\t\t\t\tconst stopReason = await Promise.race([\n\t\t\t\t\t\t\t\tthis.stopDeferred.promise,\n\t\t\t\t\t\t\t\trunCoordinator.waitCancelled,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\tawait runningSummarizer.waitStop(false);\n\t\t\t\t\t\t\trunCoordinator.stop(stopReason);\n\t\t\t\t\t\t\tthis.close();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((reason) => {\n\t\t\t\t\t\t\tbuilder.fail(\"Failed to start summarizer\", reason);\n\t\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.catch((reason) => {\n\t\t\t\t\tbuilder.fail(\"Failed to create cancellation token\", reason);\n\t\t\t\t});\n\n\t\t\treturn builder.build();\n\t\t} catch (error) {\n\t\t\tthrow SummarizingWarning.wrap(error, false /* logged */, this.logger);\n\t\t}\n\t}\n\n\tpublic enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult {\n\t\tif (\n\t\t\tthis._disposed ||\n\t\t\tthis.runningSummarizer === undefined ||\n\t\t\tthis.runningSummarizer.disposed\n\t\t) {\n\t\t\tthrow new UsageError(\"Summarizer is not running or already disposed.\");\n\t\t}\n\t\treturn this.runningSummarizer.enqueueSummarize(options);\n\t}\n\n\tpublic recordSummaryAttempt?(summaryRefSeqNum?: number) {\n\t\tthis._heuristicData?.recordAttempt(summaryRefSeqNum);\n\t}\n}\n"]}
1
+ {"version":3,"file":"summarizer.js","sourceRoot":"","sources":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ACjB,OAAO,CAAC,IAAI,CAAC,qCAAqC,EAAE,MAAM,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;YAEJ,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC;SACvB;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,kBAAkB,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SACtE;IACF,CAAC;IAEM,gBAAgB,CAAC,OAAiC;QACxD,IACC,IAAI,CAAC,SAAS;YACd,IAAI,CAAC,iBAAiB,KAAK,SAAS;YACpC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAC9B;YACD,MAAM,IAAI,4BAAU,CAAC,gDAAgD,CAAC,CAAC;SACvE;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAEM,oBAAoB,CAAE,gBAAyB;QACrD,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtD,CAAC;CACD;AA1RD,gCA0RC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Deferred } from \"@fluidframework/core-utils\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport {\n\tITelemetryLoggerExt,\n\tcreateChildLogger,\n\tIFluidErrorBase,\n\tLoggingError,\n\tUsageError,\n\twrapErrorAndLog,\n} from \"@fluidframework/telemetry-utils\";\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { ISummaryConfiguration } from \"../containerRuntime\";\nimport { ICancellableSummarizerController } from \"./runWhileConnectedCoordinator\";\nimport { SummaryCollection } from \"./summaryCollection\";\nimport { RunningSummarizer } from \"./runningSummarizer\";\nimport {\n\tIConnectableRuntime,\n\tISummarizer,\n\tISummarizeHeuristicData,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummarizingWarning,\n\tSummarizerStopReason,\n\tIOnDemandSummarizeOptions,\n\tISummarizeResults,\n\tIEnqueueSummarizeOptions,\n\tEnqueueSummarizeResult,\n\tISummarizerEvents,\n\tISummarizeEventProps,\n} from \"./summarizerTypes\";\nimport { SummarizeHeuristicData } from \"./summarizerHeuristics\";\nimport { SummarizeResultBuilder } from \"./summaryGenerator\";\n\nconst summarizingError = \"summarizingError\";\n\nexport class SummarizingWarning\n\textends LoggingError\n\timplements ISummarizingWarning, IFluidErrorBase\n{\n\treadonly errorType = summarizingError;\n\treadonly canRetry = true;\n\n\tconstructor(\n\t\terrorMessage: string,\n\t\treadonly logged: boolean = false,\n\t) {\n\t\tsuper(errorMessage);\n\t}\n\n\tstatic wrap(error: any, logged: boolean = false, logger: ITelemetryLoggerExt) {\n\t\tconst newErrorFn = (errMsg: string) => new SummarizingWarning(errMsg, logged);\n\t\treturn wrapErrorAndLog<SummarizingWarning>(error, newErrorFn, logger);\n\t}\n}\n\nexport const createSummarizingWarning = (errorMessage: string, logged: boolean) =>\n\tnew SummarizingWarning(errorMessage, logged);\n\n/**\n * Summarizer is responsible for coordinating when to generate and send summaries.\n * It is the main entry point for summary work.\n * It is created only by summarizing container (i.e. one with clientType === \"summarizer\")\n * @internal\n */\nexport class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {\n\tpublic get ISummarizer() {\n\t\treturn this;\n\t}\n\n\tprivate readonly logger: ITelemetryLoggerExt;\n\tprivate runningSummarizer?: RunningSummarizer;\n\tprivate _disposed: boolean = false;\n\tprivate starting: boolean = false;\n\n\tprivate readonly stopDeferred = new Deferred<SummarizerStopReason>();\n\n\tconstructor(\n\t\t/** Reference to runtime that created this object.\n\t\t * i.e. runtime with clientType === \"summarizer\"\n\t\t */\n\t\tprivate readonly runtime: ISummarizerRuntime,\n\t\tprivate readonly configurationGetter: () => ISummaryConfiguration,\n\t\t/** Represents an object that can generate summary.\n\t\t * In practical terms, it's same runtime (this.runtime) with clientType === \"summarizer\".\n\t\t */\n\t\tprivate readonly internalsProvider: ISummarizerInternalsProvider,\n\t\thandleContext: IFluidHandleContext,\n\t\tpublic readonly summaryCollection: SummaryCollection,\n\t\tprivate readonly runCoordinatorCreateFn: (\n\t\t\truntime: IConnectableRuntime,\n\t\t) => Promise<ICancellableSummarizerController>,\n\t) {\n\t\tsuper();\n\t\tthis.logger = createChildLogger({ logger: this.runtime.logger, namespace: \"Summarizer\" });\n\t}\n\n\tpublic async run(onBehalfOf: string): Promise<SummarizerStopReason> {\n\t\ttry {\n\t\t\treturn await this.runCore(onBehalfOf);\n\t\t} catch (error) {\n\t\t\tthis.stop(\"summarizerException\");\n\t\t\tthrow SummarizingWarning.wrap(error, false /* logged */, this.logger);\n\t\t} finally {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\t/**\n\t * Stops the summarizer from running. This will complete\n\t * the run promise, and also close the container.\n\t * @param reason - reason code for stopping\n\t */\n\tpublic stop(reason: SummarizerStopReason) {\n\t\tthis.stopDeferred.resolve(reason);\n\t}\n\n\tpublic close() {\n\t\t// This will result in \"summarizerClientDisconnected\" stop reason recorded in telemetry,\n\t\t// unless stop() was called earlier\n\t\tthis.dispose();\n\t\tthis.runtime.disposeFn();\n\t}\n\n\tprivate async runCore(onBehalfOf: string): Promise<SummarizerStopReason> {\n\t\tconst runCoordinator: ICancellableSummarizerController = await this.runCoordinatorCreateFn(\n\t\t\tthis.runtime,\n\t\t);\n\n\t\t// Wait for either external signal to cancel, or loss of connectivity.\n\t\tconst stopP = Promise.race([runCoordinator.waitCancelled, this.stopDeferred.promise]);\n\t\tvoid stopP.then((reason) => {\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"StoppingSummarizer\",\n\t\t\t\tonBehalfOf,\n\t\t\t\treason,\n\t\t\t});\n\t\t});\n\n\t\tif (runCoordinator.cancelled) {\n\t\t\treturn runCoordinator.waitCancelled;\n\t\t}\n\n\t\tconst runningSummarizer = await this.start(onBehalfOf, runCoordinator);\n\n\t\t// Wait for either external signal to cancel, or loss of connectivity.\n\t\tconst stopReason = await stopP;\n\n\t\t// There are two possible approaches here:\n\t\t// 1. Propagate cancellation from this.stopDeferred to runCoordinator. This will ensure that we move to the exit\n\t\t// faster, including breaking out of the RunningSummarizer.trySummarize() faster.\n\t\t// We could create new coordinator and pass it to waitStop() -> trySummarizeOnce(\"lastSummary\") flow.\n\t\t// The con of this approach is that we might cancel active summary, and lastSummary will fail because it\n\t\t// did not wait for ack/nack from previous summary. Plus we disregard any 429 kind of info from service\n\t\t// that way (i.e. trySummarize() loop might have been waiting for 5 min because storage told us so).\n\t\t// In general, it's more wasted resources.\n\t\t// 2. We can not do it and make waitStop() do last summary only if there was no active summary. This ensures\n\t\t// that client behaves properly (from server POV) and we do not waste resources. But, it may mean we wait\n\t\t// substantially longer for trySummarize() retries to play out and thus this summary loop may run into\n\t\t// conflict with new summarizer client starting on different client.\n\t\t// As of now, #2 is implemented. It's more forward looking, as issue #7279 suggests changing design for new\n\t\t// summarizer client to not be created until current summarizer fully moves to exit, and that would reduce\n\t\t// cons of #2 substantially.\n\n\t\t// Cleanup after running\n\t\tawait runningSummarizer.waitStop(\n\t\t\t!runCoordinator.cancelled && Summarizer.stopReasonCanRunLastSummary(stopReason),\n\t\t);\n\n\t\t// Propagate reason and ensure that if someone is waiting for cancellation token, they are moving to exit\n\t\trunCoordinator.stop(stopReason);\n\n\t\treturn stopReason;\n\t}\n\n\t/**\n\t * Should we try to run a last summary for the given stop reason?\n\t * Currently only allows \"parentNotConnected\"\n\t * @param stopReason - SummarizerStopReason\n\t * @returns `true` if the stop reason can run a last summary, otherwise `false`.\n\t */\n\tpublic static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean {\n\t\treturn stopReason === \"parentNotConnected\";\n\t}\n\n\tprivate _heuristicData: ISummarizeHeuristicData | undefined;\n\n\t/**\n\t * Put the summarizer in a started state, including creating and initializing the RunningSummarizer.\n\t * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user\n\t * (in the on-demand case).\n\t * @param onBehalfOf - ID of the client that requested that the summarizer start\n\t * @param runCoordinator - cancellation token\n\t * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.\n\t * @returns A promise that is fulfilled when the RunningSummarizer is ready.\n\t */\n\tprivate async start(\n\t\tonBehalfOf: string,\n\t\trunCoordinator: ICancellableSummarizerController,\n\t): Promise<RunningSummarizer> {\n\t\tif (this.runningSummarizer) {\n\t\t\tif (this.runningSummarizer.disposed) {\n\t\t\t\tthrow new UsageError(\"Starting a disposed summarizer\");\n\t\t\t}\n\t\t\treturn this.runningSummarizer;\n\t\t}\n\t\tif (this.starting) {\n\t\t\tthrow new UsageError(\"Attempting to start a summarizer that is already starting\");\n\t\t}\n\t\tthis.starting = true;\n\t\t// Initialize values and first ack (time is not exact)\n\t\tthis.logger.sendTelemetryEvent({\n\t\t\teventName: \"RunningSummarizer\",\n\t\t\tonBehalfOf,\n\t\t\tinitSummarySeqNumber: this.runtime.deltaManager.initialSequenceNumber,\n\t\t\tconfig: JSON.stringify(this.configurationGetter()),\n\t\t});\n\n\t\t// Summarizing container ID (with clientType === \"summarizer\")\n\t\tconst clientId = this.runtime.clientId;\n\t\tif (clientId === undefined) {\n\t\t\tthrow new UsageError(\"clientId should be defined if connected.\");\n\t\t}\n\n\t\tthis._heuristicData = new SummarizeHeuristicData(\n\t\t\tthis.runtime.deltaManager.lastSequenceNumber,\n\t\t\t{\n\t\t\t\t/** summary attempt baseline for heuristics */\n\t\t\t\trefSequenceNumber: this.runtime.deltaManager.initialSequenceNumber,\n\t\t\t\tsummaryTime: Date.now(),\n\t\t\t} as const,\n\t\t);\n\n\t\tconst runningSummarizer = await RunningSummarizer.start(\n\t\t\tthis.logger,\n\t\t\tthis.summaryCollection.createWatcher(clientId),\n\t\t\tthis.configurationGetter(),\n\t\t\tasync (...args) => this.internalsProvider.submitSummary(...args), // submitSummaryCallback\n\t\t\tasync (...args) => this.internalsProvider.refreshLatestSummaryAck(...args), // refreshLatestSummaryCallback\n\t\t\tthis._heuristicData,\n\t\t\tthis.summaryCollection,\n\t\t\trunCoordinator /* cancellationToken */,\n\t\t\t(reason) => runCoordinator.stop(reason) /* stopSummarizerCallback */,\n\t\t\tthis.runtime,\n\t\t);\n\t\tthis.runningSummarizer = runningSummarizer;\n\t\tthis.runningSummarizer.on(\"summarize\", this.handleSummarizeEvent);\n\t\tthis.starting = false;\n\t\treturn runningSummarizer;\n\t}\n\n\tprivate readonly handleSummarizeEvent = (eventProps: ISummarizeEventProps) => {\n\t\tthis.emit(\"summarize\", eventProps);\n\t};\n\n\t/**\n\t * Disposes of resources after running. This cleanup will\n\t * clear any outstanding timers and reset some of the state\n\t * properties.\n\t * Called by ContainerRuntime when it is disposed, as well as at the end the run().\n\t */\n\tpublic dispose() {\n\t\t// Given that the call can come from own ContainerRuntime, ensure that we stop all the processes.\n\t\tthis.stop(\"summarizerClientDisconnected\");\n\n\t\tthis._disposed = true;\n\t\tif (this.runningSummarizer) {\n\t\t\tthis.runningSummarizer.off(\"summarize\", this.handleSummarizeEvent);\n\t\t\tthis.runningSummarizer.dispose();\n\t\t\tthis.runningSummarizer = undefined;\n\t\t}\n\t}\n\n\tpublic summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults {\n\t\ttry {\n\t\t\tif (this._disposed || this.runningSummarizer?.disposed) {\n\t\t\t\tthrow new UsageError(\"Summarizer is already disposed.\");\n\t\t\t}\n\t\t\tif (\n\t\t\t\tthis.runtime.summarizerClientId !== undefined &&\n\t\t\t\tthis.runtime.summarizerClientId !== this.runtime.clientId\n\t\t\t) {\n\t\t\t\t// If there is an elected summarizer, and it's not this one, don't allow on-demand summary.\n\t\t\t\t// This is to prevent the on-demand summary and heuristic-based summary from stepping on\n\t\t\t\t// each other.\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"On-demand summary attempted while an elected summarizer is present\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst builder = new SummarizeResultBuilder();\n\t\t\tif (this.runningSummarizer) {\n\t\t\t\t// Summarizer is already running. Go ahead and start.\n\t\t\t\treturn this.runningSummarizer.summarizeOnDemand(options, builder);\n\t\t\t}\n\n\t\t\t// Summarizer isn't running, so we need to start it, which is an async operation.\n\t\t\t// Manage the promise related to creating the cancellation token here.\n\t\t\t// The promises related to starting, summarizing,\n\t\t\t// and submitting are communicated to the caller through the results builder.\n\t\t\tconst coordinatorCreateP = this.runCoordinatorCreateFn(this.runtime);\n\n\t\t\tcoordinatorCreateP\n\t\t\t\t.then((runCoordinator) => {\n\t\t\t\t\t// Successfully created the cancellation token. Start the summarizer.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tconst startP = this.start(this.runtime.clientId!, runCoordinator);\n\t\t\t\t\tstartP\n\t\t\t\t\t\t.then(async (runningSummarizer) => {\n\t\t\t\t\t\t\t// Successfully started the summarizer. Run it.\n\t\t\t\t\t\t\trunningSummarizer.summarizeOnDemand(options, builder);\n\t\t\t\t\t\t\t// Wait for a command to stop or loss of connectivity before tearing down the summarizer and client.\n\t\t\t\t\t\t\tconst stopReason = await Promise.race([\n\t\t\t\t\t\t\t\tthis.stopDeferred.promise,\n\t\t\t\t\t\t\t\trunCoordinator.waitCancelled,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\tawait runningSummarizer.waitStop(false);\n\t\t\t\t\t\t\trunCoordinator.stop(stopReason);\n\t\t\t\t\t\t\tthis.close();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((reason) => {\n\t\t\t\t\t\t\tbuilder.fail(\"Failed to start summarizer\", reason);\n\t\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.catch((reason) => {\n\t\t\t\t\tbuilder.fail(\"Failed to create cancellation token\", reason);\n\t\t\t\t});\n\n\t\t\treturn builder.build();\n\t\t} catch (error) {\n\t\t\tthrow SummarizingWarning.wrap(error, false /* logged */, this.logger);\n\t\t}\n\t}\n\n\tpublic enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult {\n\t\tif (\n\t\t\tthis._disposed ||\n\t\t\tthis.runningSummarizer === undefined ||\n\t\t\tthis.runningSummarizer.disposed\n\t\t) {\n\t\t\tthrow new UsageError(\"Summarizer is not running or already disposed.\");\n\t\t}\n\t\treturn this.runningSummarizer.enqueueSummarize(options);\n\t}\n\n\tpublic recordSummaryAttempt?(summaryRefSeqNum?: number) {\n\t\tthis._heuristicData?.recordAttempt(summaryRefSeqNum);\n\t}\n}\n"]}
@@ -22,12 +22,10 @@ import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definiti
22
22
  import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
23
23
  import { IFluidHandle } from '@fluidframework/core-interfaces';
24
24
  import { IFluidHandleContext } from '@fluidframework/core-interfaces';
25
- import { IFluidRouter } from '@fluidframework/core-interfaces';
26
25
  import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
27
26
  import { IGetPendingLocalStateProps } from '@fluidframework/container-definitions';
28
27
  import type { IIdCompressor } from '@fluidframework/id-compressor';
29
28
  import type { IIdCompressorCore } from '@fluidframework/id-compressor';
30
- import { ILoader } from '@fluidframework/container-definitions';
31
29
  import { ILoaderOptions } from '@fluidframework/container-definitions';
32
30
  import { IProvideFluidHandleContext } from '@fluidframework/core-interfaces';
33
31
  import { IQuorumClients } from '@fluidframework/protocol-definitions';
@@ -82,22 +80,6 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
82
80
  private readonly _storage;
83
81
  private readonly requestHandler?;
84
82
  private readonly summaryConfiguration;
85
- /**
86
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
87
- */
88
- get IFluidRouter(): this;
89
- /**
90
- * @deprecated use loadRuntime instead.
91
- * Load the stores from a snapshot and returns the runtime.
92
- * @param context - Context of the container.
93
- * @param registryEntries - Mapping to the stores.
94
- * @param requestHandler - Request handlers for the container runtime
95
- * @param runtimeOptions - Additional options to be passed to the runtime
96
- * @param existing - (optional) When loading from an existing snapshot. Precedes context.existing if provided
97
- * @param containerRuntimeCtor - (optional) Constructor to use to create the ContainerRuntime instance. This
98
- * allows mixin classes to leverage this method to define their own async initializer.
99
- */
100
- static load(context: IContainerContext, registryEntries: NamedFluidDataStoreRegistryEntries, requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>, runtimeOptions?: IContainerRuntimeOptions, containerScope?: FluidObject, existing?: boolean, containerRuntimeCtor?: typeof ContainerRuntime): Promise<ContainerRuntime>;
101
83
  /**
102
84
  * Load the stores from a snapshot and returns the runtime.
103
85
  * @param params - An object housing the runtime properties:
@@ -120,7 +102,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
120
102
  runtimeOptions?: IContainerRuntimeOptions;
121
103
  containerScope?: FluidObject;
122
104
  containerRuntimeCtor?: typeof ContainerRuntime;
123
- /** @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md */
105
+ /** @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md */
124
106
  requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
125
107
  provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>;
126
108
  }): Promise<ContainerRuntime>;
@@ -277,9 +259,9 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
277
259
  /**
278
260
  * Notifies this object about the request made to the container.
279
261
  * @param request - Request made to the handler.
280
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
262
+ * @deprecated Will be removed in future major release. This method needs to stay private until LTS version of Loader moves to "2.0.0-internal.7.0.0".
281
263
  */
282
- request(request: IRequest): Promise<IResponse>;
264
+ private request;
283
265
  /**
284
266
  * Resolves URI representing handle
285
267
  * @param request - Request made to the handler.
@@ -325,14 +307,6 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
325
307
  */
326
308
  private sendSignalTelemetryEvent;
327
309
  processSignal(message: ISignalMessage, local: boolean): void;
328
- /**
329
- * Returns the runtime of the data store.
330
- * @param id - Id supplied during creating the data store.
331
- * @param wait - True if you want to wait for it.
332
- * @deprecated Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
333
- */
334
- getRootDataStore(id: string, wait?: boolean): Promise<IFluidRouter>;
335
- private getRootDataStoreChannel;
336
310
  /**
337
311
  * Flush the pending ops manually.
338
312
  * This method is expected to be called at the end of a batch.
@@ -559,7 +533,6 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
559
533
  * overridden via options.
560
534
  */
561
535
  private fetchLatestSnapshotFromStorage;
562
- notifyAttaching(): void;
563
536
  getPendingLocalState(props?: IGetPendingLocalStateProps): Promise<unknown>;
564
537
  summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
565
538
  enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
@@ -1464,8 +1437,6 @@ export declare type SummarizerStopReason =
1464
1437
  */
1465
1438
  export declare type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
1466
1439
 
1467
- /* Excluded from this release type: TEST_requestSummarizer */
1468
-
1469
1440
  /* Excluded from this release type: TombstoneResponseHeaderKey */
1470
1441
 
1471
1442
  /* Excluded from this release type: unpackRuntimeMessage */
@@ -22,12 +22,10 @@ import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definiti
22
22
  import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
23
23
  import { IFluidHandle } from '@fluidframework/core-interfaces';
24
24
  import { IFluidHandleContext } from '@fluidframework/core-interfaces';
25
- import { IFluidRouter } from '@fluidframework/core-interfaces';
26
25
  import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
27
26
  import { IGetPendingLocalStateProps } from '@fluidframework/container-definitions';
28
27
  import type { IIdCompressor } from '@fluidframework/id-compressor';
29
28
  import type { IIdCompressorCore } from '@fluidframework/id-compressor';
30
- import { ILoader } from '@fluidframework/container-definitions';
31
29
  import { ILoaderOptions } from '@fluidframework/container-definitions';
32
30
  import { IProvideFluidHandleContext } from '@fluidframework/core-interfaces';
33
31
  import { IQuorumClients } from '@fluidframework/protocol-definitions';
@@ -153,8 +151,6 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
153
151
 
154
152
  /* Excluded from this release type: IFluidHandleContext */
155
153
 
156
- /* Excluded from this release type: IFluidRouter */
157
-
158
154
  /* Excluded from this release type: IGarbageCollectionData */
159
155
 
160
156
  /* Excluded from this release type: IGCMetadata */
@@ -173,8 +169,6 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
173
169
 
174
170
  /* Excluded from this release type: IIdCompressorCore */
175
171
 
176
- /* Excluded from this release type: ILoader */
177
-
178
172
  /* Excluded from this release type: ILoaderOptions */
179
173
 
180
174
  /* Excluded from this release type: IMarkPhaseStats */
@@ -289,8 +283,6 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
289
283
 
290
284
  /* Excluded from this release type: SummaryStage */
291
285
 
292
- /* Excluded from this release type: TEST_requestSummarizer */
293
-
294
286
  /* Excluded from this release type: TombstoneResponseHeaderKey */
295
287
 
296
288
  /* Excluded from this release type: TypedEventEmitter */
@@ -22,12 +22,10 @@ import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definiti
22
22
  import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
23
23
  import { IFluidHandle } from '@fluidframework/core-interfaces';
24
24
  import { IFluidHandleContext } from '@fluidframework/core-interfaces';
25
- import { IFluidRouter } from '@fluidframework/core-interfaces';
26
25
  import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
27
26
  import { IGetPendingLocalStateProps } from '@fluidframework/container-definitions';
28
27
  import type { IIdCompressor } from '@fluidframework/id-compressor';
29
28
  import type { IIdCompressorCore } from '@fluidframework/id-compressor';
30
- import { ILoader } from '@fluidframework/container-definitions';
31
29
  import { ILoaderOptions } from '@fluidframework/container-definitions';
32
30
  import { IProvideFluidHandleContext } from '@fluidframework/core-interfaces';
33
31
  import { IQuorumClients } from '@fluidframework/protocol-definitions';
@@ -153,8 +151,6 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
153
151
 
154
152
  /* Excluded from this release type: IFluidHandleContext */
155
153
 
156
- /* Excluded from this release type: IFluidRouter */
157
-
158
154
  /* Excluded from this release type: IGarbageCollectionData */
159
155
 
160
156
  /* Excluded from this release type: IGCMetadata */
@@ -173,8 +169,6 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
173
169
 
174
170
  /* Excluded from this release type: IIdCompressorCore */
175
171
 
176
- /* Excluded from this release type: ILoader */
177
-
178
172
  /* Excluded from this release type: ILoaderOptions */
179
173
 
180
174
  /* Excluded from this release type: IMarkPhaseStats */
@@ -289,8 +283,6 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
289
283
 
290
284
  /* Excluded from this release type: SummaryStage */
291
285
 
292
- /* Excluded from this release type: TEST_requestSummarizer */
293
-
294
286
  /* Excluded from this release type: TombstoneResponseHeaderKey */
295
287
 
296
288
  /* Excluded from this release type: TypedEventEmitter */