@fluidframework/container-loader 2.70.0-361788 → 2.71.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 (68) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/api-report/container-loader.legacy.alpha.api.md +13 -0
  3. package/dist/container.d.ts +7 -4
  4. package/dist/container.d.ts.map +1 -1
  5. package/dist/container.js +98 -15
  6. package/dist/container.js.map +1 -1
  7. package/dist/containerContext.d.ts +1 -0
  8. package/dist/containerContext.d.ts.map +1 -1
  9. package/dist/containerContext.js +1 -0
  10. package/dist/containerContext.js.map +1 -1
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +3 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/legacyAlpha.d.ts +1 -0
  16. package/dist/packageVersion.d.ts +1 -1
  17. package/dist/packageVersion.d.ts.map +1 -1
  18. package/dist/packageVersion.js +1 -1
  19. package/dist/packageVersion.js.map +1 -1
  20. package/dist/pendingLocalStateStore.d.ts +84 -0
  21. package/dist/pendingLocalStateStore.d.ts.map +1 -0
  22. package/dist/pendingLocalStateStore.js +157 -0
  23. package/dist/pendingLocalStateStore.js.map +1 -0
  24. package/dist/protocol.d.ts +1 -0
  25. package/dist/protocol.d.ts.map +1 -1
  26. package/dist/protocol.js +43 -1
  27. package/dist/protocol.js.map +1 -1
  28. package/dist/utils.d.ts +1 -0
  29. package/dist/utils.d.ts.map +1 -1
  30. package/dist/utils.js +0 -4
  31. package/dist/utils.js.map +1 -1
  32. package/lib/container.d.ts +7 -4
  33. package/lib/container.d.ts.map +1 -1
  34. package/lib/container.js +99 -16
  35. package/lib/container.js.map +1 -1
  36. package/lib/containerContext.d.ts +1 -0
  37. package/lib/containerContext.d.ts.map +1 -1
  38. package/lib/containerContext.js +1 -0
  39. package/lib/containerContext.js.map +1 -1
  40. package/lib/index.d.ts +1 -0
  41. package/lib/index.d.ts.map +1 -1
  42. package/lib/index.js +1 -0
  43. package/lib/index.js.map +1 -1
  44. package/lib/legacyAlpha.d.ts +1 -0
  45. package/lib/packageVersion.d.ts +1 -1
  46. package/lib/packageVersion.d.ts.map +1 -1
  47. package/lib/packageVersion.js +1 -1
  48. package/lib/packageVersion.js.map +1 -1
  49. package/lib/pendingLocalStateStore.d.ts +84 -0
  50. package/lib/pendingLocalStateStore.d.ts.map +1 -0
  51. package/lib/pendingLocalStateStore.js +153 -0
  52. package/lib/pendingLocalStateStore.js.map +1 -0
  53. package/lib/protocol.d.ts +1 -0
  54. package/lib/protocol.d.ts.map +1 -1
  55. package/lib/protocol.js +41 -0
  56. package/lib/protocol.js.map +1 -1
  57. package/lib/utils.d.ts +1 -0
  58. package/lib/utils.d.ts.map +1 -1
  59. package/lib/utils.js +0 -4
  60. package/lib/utils.js.map +1 -1
  61. package/package.json +15 -15
  62. package/src/container.ts +133 -31
  63. package/src/containerContext.ts +2 -0
  64. package/src/index.ts +1 -0
  65. package/src/packageVersion.ts +1 -1
  66. package/src/pendingLocalStateStore.ts +160 -0
  67. package/src/protocol.ts +49 -0
  68. package/src/utils.ts +6 -0
@@ -46,6 +46,7 @@ export declare class ContainerContext implements Required<Omit<IContainerContext
46
46
  readonly storage: IContainerStorageService;
47
47
  readonly quorum: IQuorumClients;
48
48
  readonly audience: IAudience;
49
+ readonly signalAudience: IAudience;
49
50
  readonly loader: ILoader;
50
51
  readonly submitFn: (type: MessageType, contents: unknown, batch: boolean, appData: unknown) => number;
51
52
  readonly submitSummaryFn: (summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number;
@@ -1 +1 @@
1
- {"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,0BAA0B,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,MAAM,uCAAuC,CA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AAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACnE,SAAgB,yBAAyB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,SAAgB,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACrF,SAAgB,aAAa,EAAE,cAAc,CAAC;IAC9C,SAAgB,QAAQ,EAAE,OAAO,CAAC;IAClC,SAAgB,YAAY,EAAE,mBAAmB,CAAC;IAClD,SAAgB,iBAAiB,EAAE,OAAO,CAAC;IAC3C,SAAgB,oBAAoB,CAAC,EAAE,SAAS,CAAC;IAEjD,SAAgB,kBAAkB,EAAE,MAAM,eAAe,CAAC;IAE1D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2B;IACxD,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA2B;IACrE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoB;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAE/C,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAExC;IAED;;OAEG;IACH,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED;;;OAGG;IACH,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED;;;OAGG;IACH,IAAW,mBAAmB,IAAI,mBAAmB,CAEpD;gBAEW,MAAM,EAAE,uBAAuB;IAkCpC,oBAAoB,IAAI,QAAQ,GAAG,SAAS;IAInD,IAAW,WAAW,IAAI,WAAW,CAEpC;CACD"}
@@ -52,6 +52,7 @@ class ContainerContext {
52
52
  this.storage = config.storage;
53
53
  this.quorum = config.quorum;
54
54
  this.audience = config.audience;
55
+ this.signalAudience = config.signalAudience;
55
56
  this.loader = config.loader;
56
57
  this.submitFn = config.submitFn;
57
58
  this.submitSummaryFn = config.submitSummaryFn;
@@ -1 +1 @@
1
- {"version":3,"file":"containerContext.js","sour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AAC,cAAc,CAAC;QAC5C,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,yBAAyB,GAAG,MAAM,CAAC,yBAAyB,CAAC;QAClE,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAClD,IAAI,MAAM,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;YAC/C,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;QACzD,CAAC;QAED,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,yBAAyB,GAAG,MAAM,CAAC,wBAAwB,CAAC;QACjE,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,CAAC;IAEM,oBAAoB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACD;AAzID,4CAyIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tIProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\nimport type {\n\tAttachState,\n\tIAudience,\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nimport type {\n\tIBatchMessage,\n\tIContainerContext,\n\tILoader,\n\tILoaderOptions,\n\tIDeltaManager,\n\tIContainerStorageService,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { FluidObject } from \"@fluidframework/core-interfaces\";\nimport type { ISignalEnvelope } from \"@fluidframework/core-interfaces/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ConnectionState } from \"./connectionState.js\";\nimport { loaderCompatDetailsForRuntime } from \"./loaderLayerCompatState.js\";\n\n/**\n * Configuration object for ContainerContext constructor.\n *\n * @remarks\n * A large subset of properties are from {@link IContainerContext}. Select\n * properties are explicitly omitted so that, as {@link ContainerContext} is\n * extended, newly added properties are not overlooked (but may also be\n * explicitly omitted here by adding to the list).\n */\nexport interface IContainerContextConfig\n\textends Readonly<\n\t\tRequired<\n\t\t\tOmit<\n\t\t\t\tIContainerContext,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"connected\"\n\t\t\t\t| \"attachState\"\n\t\t\t\t| \"getLoadedFromVersion\"\n\t\t\t\t| \"supportedFeatures\"\n\t\t\t\t| \"id\"\n\t\t\t\t| \"snapshotWithContents\"\n\t\t\t>\n\t\t>\n\t> {\n\t// This overrides IContainerContext.options with specific type.\n\treadonly options: ILoaderOptions;\n\treadonly version: IVersion | undefined;\n\treadonly getContainerDiagnosticId: () => string | undefined;\n\treadonly getClientId: () => string | undefined;\n\treadonly getAttachState: () => AttachState;\n\treadonly getConnected: () => boolean;\n\treadonly existing: boolean;\n\treadonly taggedLogger: ITelemetryLoggerExt;\n\t// This \"overrides\" IContainerContext.snapshotWithContents to be required but allow `undefined`.\n\treadonly snapshotWithContents: IContainerContext[\"snapshotWithContents\"] | undefined;\n}\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext\n\timplements\n\t\tRequired<Omit<IContainerContext, \"snapshotWithContents\">>,\n\t\tPick<IContainerContext, \"snapshotWithContents\">,\n\t\tIProvideLayerCompatDetails\n{\n\t/**\n\t * @deprecated This has been replaced by ILayerCompatDetails.\n\t */\n\tpublic readonly supportedFeatures: ReadonlyMap<string, unknown> = new Map([\n\t\t/**\n\t\t * This version of the loader accepts `referenceSequenceNumber`, provided by the container runtime,\n\t\t * as a parameter to the `submitBatchFn` and `submitSummaryFn` functions.\n\t\t * This is then used to set the reference sequence numbers of the submitted ops in the DeltaManager.\n\t\t */\n\t\t[\"referenceSequenceNumbers\", true],\n\t]);\n\n\tpublic readonly options: ILoaderOptions;\n\tpublic readonly scope: FluidObject;\n\tpublic readonly baseSnapshot: ISnapshotTree | undefined;\n\tpublic readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\tpublic readonly storage: IContainerStorageService;\n\tpublic readonly quorum: IQuorumClients;\n\tpublic readonly audience: IAudience;\n\tpublic readonly loader: ILoader;\n\tpublic readonly submitFn: (\n\t\ttype: MessageType,\n\t\tcontents: unknown,\n\t\tbatch: boolean,\n\t\tappData: unknown,\n\t) => number;\n\tpublic readonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\tpublic readonly submitBatchFn: (\n\t\tbatch: IBatchMessage[],\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * `unknown` should be removed once `@alpha` tag is removed from IContainerContext\n\t * @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n\t * Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s\n\t */\n\tpublic readonly submitSignalFn: (\n\t\tcontent: unknown | ISignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n\tpublic readonly disposeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly closeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly updateDirtyContainerState: (dirty: boolean) => void;\n\tpublic readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;\n\tpublic readonly clientDetails: IClientDetails;\n\tpublic readonly existing: boolean;\n\tpublic readonly taggedLogger: ITelemetryLoggerExt;\n\tpublic readonly pendingLocalState: unknown;\n\tpublic readonly snapshotWithContents?: ISnapshot;\n\n\tpublic readonly getConnectionState: () => ConnectionState;\n\n\tprivate readonly _getClientId: () => string | undefined;\n\tprivate readonly _getContainerDiagnosticId: () => string | undefined;\n\tprivate readonly _getConnected: () => boolean;\n\tprivate readonly _getAttachState: () => AttachState;\n\tprivate readonly version: IVersion | undefined;\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._getClientId();\n\t}\n\n\t/**\n\t * DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.\n\t */\n\tpublic get id(): string {\n\t\treturn this._getContainerDiagnosticId() ?? \"\";\n\t}\n\n\t/**\n\t * When true, ops are free to flow\n\t * When false, ops should be kept as pending or rejected\n\t */\n\tpublic get connected(): boolean {\n\t\treturn this._getConnected();\n\t}\n\n\t/**\n\t * The compatibility details of the Loader layer that is exposed to the Runtime layer\n\t * for validating Runtime-Loader compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn loaderCompatDetailsForRuntime;\n\t}\n\n\tconstructor(config: IContainerContextConfig) {\n\t\tthis.options = config.options;\n\t\tthis.scope = config.scope;\n\t\tthis.baseSnapshot = config.baseSnapshot;\n\t\tthis.deltaManager = config.deltaManager;\n\t\tthis.storage = config.storage;\n\t\tthis.quorum = config.quorum;\n\t\tthis.audience = config.audience;\n\t\tthis.loader = config.loader;\n\t\tthis.submitFn = config.submitFn;\n\t\tthis.submitSummaryFn = config.submitSummaryFn;\n\t\tthis.submitBatchFn = config.submitBatchFn;\n\t\tthis.submitSignalFn = config.submitSignalFn;\n\t\tthis.disposeFn = config.disposeFn;\n\t\tthis.closeFn = config.closeFn;\n\t\tthis.updateDirtyContainerState = config.updateDirtyContainerState;\n\t\tthis.getAbsoluteUrl = config.getAbsoluteUrl;\n\t\tthis.clientDetails = config.clientDetails;\n\t\tthis.existing = config.existing;\n\t\tthis.taggedLogger = config.taggedLogger;\n\t\tthis.pendingLocalState = config.pendingLocalState;\n\t\tif (config.snapshotWithContents !== undefined) {\n\t\t\tthis.snapshotWithContents = config.snapshotWithContents;\n\t\t}\n\n\t\tthis.getConnectionState = config.getConnectionState;\n\t\tthis._getClientId = config.getClientId;\n\t\tthis._getContainerDiagnosticId = config.getContainerDiagnosticId;\n\t\tthis._getConnected = config.getConnected;\n\t\tthis._getAttachState = config.getAttachState;\n\t\tthis.version = config.version;\n\t}\n\n\tpublic getLoadedFromVersion(): IVersion | undefined {\n\t\treturn this.version;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._getAttachState();\n\t}\n}\n"]}
1
+ {"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAkCH,2EAA4E;AAuC5E;;GAEG;AACH,MAAa,gBAAgB;IAuE5B,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,yBAAyB,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACH,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,IAAW,mBAAmB;QAC7B,OAAO,yDAA6B,CAAC;IACtC,CAAC;IAED,YAAY,MAA+B;QA5F3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xC,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAClD,IAAI,MAAM,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;YAC/C,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;QACzD,CAAC;QAED,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,yBAAyB,GAAG,MAAM,CAAC,wBAAwB,CAAC;QACjE,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,CAAC;IAEM,oBAAoB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACD;AA3ID,4CA2IC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tIProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\nimport type {\n\tAttachState,\n\tIAudience,\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nimport type {\n\tIBatchMessage,\n\tIContainerContext,\n\tILoader,\n\tILoaderOptions,\n\tIDeltaManager,\n\tIContainerStorageService,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { FluidObject } from \"@fluidframework/core-interfaces\";\nimport type { ISignalEnvelope } from \"@fluidframework/core-interfaces/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { ConnectionState } from \"./connectionState.js\";\nimport { loaderCompatDetailsForRuntime } from \"./loaderLayerCompatState.js\";\n\n/**\n * Configuration object for ContainerContext constructor.\n *\n * @remarks\n * A large subset of properties are from {@link IContainerContext}. Select\n * properties are explicitly omitted so that, as {@link ContainerContext} is\n * extended, newly added properties are not overlooked (but may also be\n * explicitly omitted here by adding to the list).\n */\nexport interface IContainerContextConfig\n\textends Readonly<\n\t\tRequired<\n\t\t\tOmit<\n\t\t\t\tIContainerContext,\n\t\t\t\t| \"clientId\"\n\t\t\t\t| \"connected\"\n\t\t\t\t| \"attachState\"\n\t\t\t\t| \"getLoadedFromVersion\"\n\t\t\t\t| \"supportedFeatures\"\n\t\t\t\t| \"id\"\n\t\t\t\t| \"snapshotWithContents\"\n\t\t\t>\n\t\t>\n\t> {\n\t// This overrides IContainerContext.options with specific type.\n\treadonly options: ILoaderOptions;\n\treadonly version: IVersion | undefined;\n\treadonly getContainerDiagnosticId: () => string | undefined;\n\treadonly getClientId: () => string | undefined;\n\treadonly getAttachState: () => AttachState;\n\treadonly getConnected: () => boolean;\n\treadonly existing: boolean;\n\treadonly taggedLogger: ITelemetryLoggerExt;\n\t// This \"overrides\" IContainerContext.snapshotWithContents to be required but allow `undefined`.\n\treadonly snapshotWithContents: IContainerContext[\"snapshotWithContents\"] | undefined;\n}\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext\n\timplements\n\t\tRequired<Omit<IContainerContext, \"snapshotWithContents\">>,\n\t\tPick<IContainerContext, \"snapshotWithContents\">,\n\t\tIProvideLayerCompatDetails\n{\n\t/**\n\t * @deprecated This has been replaced by ILayerCompatDetails.\n\t */\n\tpublic readonly supportedFeatures: ReadonlyMap<string, unknown> = new Map([\n\t\t/**\n\t\t * This version of the loader accepts `referenceSequenceNumber`, provided by the container runtime,\n\t\t * as a parameter to the `submitBatchFn` and `submitSummaryFn` functions.\n\t\t * This is then used to set the reference sequence numbers of the submitted ops in the DeltaManager.\n\t\t */\n\t\t[\"referenceSequenceNumbers\", true],\n\t]);\n\n\tpublic readonly options: ILoaderOptions;\n\tpublic readonly scope: FluidObject;\n\tpublic readonly baseSnapshot: ISnapshotTree | undefined;\n\tpublic readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\tpublic readonly storage: IContainerStorageService;\n\tpublic readonly quorum: IQuorumClients;\n\tpublic readonly audience: IAudience;\n\tpublic readonly signalAudience: IAudience;\n\tpublic readonly loader: ILoader;\n\tpublic readonly submitFn: (\n\t\ttype: MessageType,\n\t\tcontents: unknown,\n\t\tbatch: boolean,\n\t\tappData: unknown,\n\t) => number;\n\tpublic readonly submitSummaryFn: (\n\t\tsummaryOp: ISummaryContent,\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * @returns clientSequenceNumber of last message in a batch\n\t */\n\tpublic readonly submitBatchFn: (\n\t\tbatch: IBatchMessage[],\n\t\treferenceSequenceNumber?: number,\n\t) => number;\n\t/**\n\t * `unknown` should be removed once `@alpha` tag is removed from IContainerContext\n\t * @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n\t * Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s\n\t */\n\tpublic readonly submitSignalFn: (\n\t\tcontent: unknown | ISignalEnvelope,\n\t\ttargetClientId?: string,\n\t) => void;\n\tpublic readonly disposeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly closeFn: (error?: ICriticalContainerError) => void;\n\tpublic readonly updateDirtyContainerState: (dirty: boolean) => void;\n\tpublic readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;\n\tpublic readonly clientDetails: IClientDetails;\n\tpublic readonly existing: boolean;\n\tpublic readonly taggedLogger: ITelemetryLoggerExt;\n\tpublic readonly pendingLocalState: unknown;\n\tpublic readonly snapshotWithContents?: ISnapshot;\n\n\tpublic readonly getConnectionState: () => ConnectionState;\n\n\tprivate readonly _getClientId: () => string | undefined;\n\tprivate readonly _getContainerDiagnosticId: () => string | undefined;\n\tprivate readonly _getConnected: () => boolean;\n\tprivate readonly _getAttachState: () => AttachState;\n\tprivate readonly version: IVersion | undefined;\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._getClientId();\n\t}\n\n\t/**\n\t * DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.\n\t */\n\tpublic get id(): string {\n\t\treturn this._getContainerDiagnosticId() ?? \"\";\n\t}\n\n\t/**\n\t * When true, ops are free to flow\n\t * When false, ops should be kept as pending or rejected\n\t */\n\tpublic get connected(): boolean {\n\t\treturn this._getConnected();\n\t}\n\n\t/**\n\t * The compatibility details of the Loader layer that is exposed to the Runtime layer\n\t * for validating Runtime-Loader compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn loaderCompatDetailsForRuntime;\n\t}\n\n\tconstructor(config: IContainerContextConfig) {\n\t\tthis.options = config.options;\n\t\tthis.scope = config.scope;\n\t\tthis.baseSnapshot = config.baseSnapshot;\n\t\tthis.deltaManager = config.deltaManager;\n\t\tthis.storage = config.storage;\n\t\tthis.quorum = config.quorum;\n\t\tthis.audience = config.audience;\n\t\tthis.signalAudience = config.signalAudience;\n\t\tthis.loader = config.loader;\n\t\tthis.submitFn = config.submitFn;\n\t\tthis.submitSummaryFn = config.submitSummaryFn;\n\t\tthis.submitBatchFn = config.submitBatchFn;\n\t\tthis.submitSignalFn = config.submitSignalFn;\n\t\tthis.disposeFn = config.disposeFn;\n\t\tthis.closeFn = config.closeFn;\n\t\tthis.updateDirtyContainerState = config.updateDirtyContainerState;\n\t\tthis.getAbsoluteUrl = config.getAbsoluteUrl;\n\t\tthis.clientDetails = config.clientDetails;\n\t\tthis.existing = config.existing;\n\t\tthis.taggedLogger = config.taggedLogger;\n\t\tthis.pendingLocalState = config.pendingLocalState;\n\t\tif (config.snapshotWithContents !== undefined) {\n\t\t\tthis.snapshotWithContents = config.snapshotWithContents;\n\t\t}\n\n\t\tthis.getConnectionState = config.getConnectionState;\n\t\tthis._getClientId = config.getClientId;\n\t\tthis._getContainerDiagnosticId = config.getContainerDiagnosticId;\n\t\tthis._getConnected = config.getConnected;\n\t\tthis._getAttachState = config.getAttachState;\n\t\tthis.version = config.version;\n\t}\n\n\tpublic getLoadedFromVersion(): IVersion | undefined {\n\t\treturn this.version;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._getAttachState();\n\t}\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -14,4 +14,5 @@ export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } f
14
14
  export type { IProtocolHandler, ProtocolHandlerBuilder } from "./protocol.js";
15
15
  export { tryParseCompatibleResolvedUrl, type IParsedUrl, } from "./utils.js";
16
16
  export type { IBaseProtocolHandler, IScribeProtocolState, IQuorumSnapshot, QuorumClientsSnapshot, QuorumProposalsSnapshot, } from "./protocol/index.js";
17
+ export { PendingLocalStateStore } from "./pendingLocalStateStore.js";
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,EACrC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,GAC9C,MAAM,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,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACN,6BAA6B,EAC7B,KAAK,UAAU,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,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.tryParseCompatibleResolvedUrl = exports.resolveWithLocationRedirectionHandling = exports.isLocationRedirectionError = exports.loadContainerPaused = exports.loaderCompatDetailsForRuntime = exports.runtimeSupportRequirementsForLoader = exports.loaderCoreCompatDetails = exports.driverSupportRequirementsForLoader = exports.Loader = exports.loadSummarizerContainerAndMakeSummary = exports.loadFrozenContainerFromPendingState = exports.rehydrateDetachedContainer = exports.loadExistingContainer = exports.createDetachedContainer = exports.createFrozenDocumentServiceFactory = exports.asLegacyAlpha = exports.waitContainerToCatchUp = exports.ConnectionState = void 0;
7
+ exports.PendingLocalStateStore = exports.tryParseCompatibleResolvedUrl = exports.resolveWithLocationRedirectionHandling = exports.isLocationRedirectionError = exports.loadContainerPaused = exports.loaderCompatDetailsForRuntime = exports.runtimeSupportRequirementsForLoader = exports.loaderCoreCompatDetails = exports.driverSupportRequirementsForLoader = exports.Loader = exports.loadSummarizerContainerAndMakeSummary = exports.loadFrozenContainerFromPendingState = exports.rehydrateDetachedContainer = exports.loadExistingContainer = exports.createDetachedContainer = exports.createFrozenDocumentServiceFactory = exports.asLegacyAlpha = exports.waitContainerToCatchUp = exports.ConnectionState = void 0;
8
8
  var connectionState_js_1 = require("./connectionState.js");
9
9
  Object.defineProperty(exports, "ConnectionState", { enumerable: true, get: function () { return connectionState_js_1.ConnectionState; } });
10
10
  var container_js_1 = require("./container.js");
@@ -32,4 +32,6 @@ Object.defineProperty(exports, "isLocationRedirectionError", { enumerable: true,
32
32
  Object.defineProperty(exports, "resolveWithLocationRedirectionHandling", { enumerable: true, get: function () { return index_js_1.resolveWithLocationRedirectionHandling; } });
33
33
  var utils_js_1 = require("./utils.js");
34
34
  Object.defineProperty(exports, "tryParseCompatibleResolvedUrl", { enumerable: true, get: function () { return utils_js_1.tryParseCompatibleResolvedUrl; } });
35
+ var pendingLocalStateStore_js_1 = require("./pendingLocalStateStore.js");
36
+ Object.defineProperty(exports, "PendingLocalStateStore", { enumerable: true, get: function () { return pendingLocalStateStore_js_1.PendingLocalStateStore; } });
35
37
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,+CAA4F;AAA9D,sHAAA,sBAAsB,OAAA;AAAE,6GAAA,aAAa,OAAA;AACnE,yDAAyE;AAAhE,uIAAA,kCAAkC,OAAA;AAC3C,mFAY0C;AAXzC,yIAAA,uBAAuB,OAAA;AACvB,uIAAA,qBAAqB,OAAA;AACrB,4IAAA,0BAA0B,OAAA;AAC1B,qJAAA,mCAAmC,OAAA;AACnC,uJAAA,qCAAqC,OAAA;AAatC,yCAMqB;AADpB,mGAAA,MAAM,OAAA;AAEP,yEAKqC;AAJpC,+IAAA,kCAAkC,OAAA;AAClC,oIAAA,uBAAuB,OAAA;AACvB,gJAAA,mCAAmC,OAAA;AACnC,0IAAA,6BAA6B,OAAA;AAE9B,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAC5B,sEAGmD;AAFlD,sHAAA,0BAA0B,OAAA;AAC1B,kIAAA,sCAAsC,OAAA;AAGvC,uCAGoB;AAFnB,yHAAA,6BAA6B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { type ContainerAlpha, waitContainerToCatchUp, asLegacyAlpha } from \"./container.js\";\nexport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nexport {\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tloadFrozenContainerFromPendingState,\n\tloadSummarizerContainerAndMakeSummary,\n\ttype ICreateAndLoadContainerProps,\n\ttype ICreateDetachedContainerProps,\n\ttype ILoadExistingContainerProps,\n\ttype ILoadSummarizerContainerProps,\n\ttype IRehydrateDetachedContainerProps,\n\ttype ILoadFrozenContainerFromPendingStateProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummaryStage,\n} from \"./summarizerResultTypes.js\";\nexport {\n\ttype ICodeDetailsLoader,\n\ttype IFluidModuleWithDetails,\n\ttype ILoaderProps,\n\ttype ILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport {\n\tdriverSupportRequirementsForLoader,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirementsForLoader,\n\tloaderCompatDetailsForRuntime,\n} from \"./loaderLayerCompatState.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport type { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\ttype IParsedUrl,\n} from \"./utils.js\";\nexport type {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,+CAA4F;AAA9D,sHAAA,sBAAsB,OAAA;AAAE,6GAAA,aAAa,OAAA;AACnE,yDAAyE;AAAhE,uIAAA,kCAAkC,OAAA;AAC3C,mFAY0C;AAXzC,yIAAA,uBAAuB,OAAA;AACvB,uIAAA,qBAAqB,OAAA;AACrB,4IAAA,0BAA0B,OAAA;AAC1B,qJAAA,mCAAmC,OAAA;AACnC,uJAAA,qCAAqC,OAAA;AAatC,yCAMqB;AADpB,mGAAA,MAAM,OAAA;AAEP,yEAKqC;AAJpC,+IAAA,kCAAkC,OAAA;AAClC,oIAAA,uBAAuB,OAAA;AACvB,gJAAA,mCAAmC,OAAA;AACnC,0IAAA,6BAA6B,OAAA;AAE9B,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAC5B,sEAGmD;AAFlD,sHAAA,0BAA0B,OAAA;AAC1B,kIAAA,sCAAsC,OAAA;AAGvC,uCAGoB;AAFnB,yHAAA,6BAA6B,OAAA;AAU9B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { type ContainerAlpha, waitContainerToCatchUp, asLegacyAlpha } from \"./container.js\";\nexport { createFrozenDocumentServiceFactory } from \"./frozenServices.js\";\nexport {\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tloadFrozenContainerFromPendingState,\n\tloadSummarizerContainerAndMakeSummary,\n\ttype ICreateAndLoadContainerProps,\n\ttype ICreateDetachedContainerProps,\n\ttype ILoadExistingContainerProps,\n\ttype ILoadSummarizerContainerProps,\n\ttype IRehydrateDetachedContainerProps,\n\ttype ILoadFrozenContainerFromPendingStateProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport type {\n\tLoadSummarizerSummaryResult,\n\tOnDemandSummaryResults,\n\tSummaryStage,\n} from \"./summarizerResultTypes.js\";\nexport {\n\ttype ICodeDetailsLoader,\n\ttype IFluidModuleWithDetails,\n\ttype ILoaderProps,\n\ttype ILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport {\n\tdriverSupportRequirementsForLoader,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirementsForLoader,\n\tloaderCompatDetailsForRuntime,\n} from \"./loaderLayerCompatState.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport type { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\ttype IParsedUrl,\n} from \"./utils.js\";\nexport type {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\nexport { PendingLocalStateStore } from \"./pendingLocalStateStore.js\";\n"]}
@@ -45,6 +45,7 @@ export {
45
45
  ILoadSummarizerContainerProps,
46
46
  LoadSummarizerSummaryResult,
47
47
  OnDemandSummaryResults,
48
+ PendingLocalStateStore,
48
49
  SummaryStage,
49
50
  asLegacyAlpha,
50
51
  createFrozenDocumentServiceFactory,
@@ -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-loader";
8
- export declare const pkgVersion = "2.70.0-361788";
8
+ export declare const pkgVersion = "2.71.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,WAAW,CAAC"}
@@ -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-loader";
11
- exports.pkgVersion = "2.70.0-361788";
11
+ exports.pkgVersion = "2.71.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,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,eAAe,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-loader\";\nexport const pkgVersion = \"2.70.0-361788\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,kCAAkC,CAAC;AAC7C,QAAA,UAAU,GAAG,QAAQ,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-loader\";\nexport const pkgVersion = \"2.71.0\";\n"]}
@@ -0,0 +1,84 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * A Map-like store for managing pending local container states from attached containers.
7
+ * Optimizes storage by deduplicating shared resources across stored states.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const store = new PendingLocalStateStore<string>();
12
+ *
13
+ * // Store pending state
14
+ * const pendingState = await attachedContainer.getPendingLocalState();
15
+ * store.set("session1", pendingState);
16
+ *
17
+ * // Load from stored state
18
+ * const restored = store.get("session1");
19
+ * const newContainer = await loadFrozenContainerFromPendingState({
20
+ * pendingLocalState: restored,
21
+ * // ... other loader options
22
+ * });
23
+ * ```
24
+ *
25
+ * @remarks
26
+ * Only use with attached containers from the same URL. Only store strings
27
+ * returned by `container.getPendingLocalState()`.
28
+ *
29
+ * @typeParam TKey - The type of keys used to identify stored states
30
+ *
31
+ * @legacy @alpha
32
+ */
33
+ export declare class PendingLocalStateStore<TKey> {
34
+ #private;
35
+ /**
36
+ * Removes all stored pending states.
37
+ */
38
+ clear(): void;
39
+ /**
40
+ * Removes the pending state for the specified key.
41
+ *
42
+ * @param key - The key to remove
43
+ * @returns `true` if the state existed and was removed, `false` otherwise
44
+ */
45
+ delete(key: TKey): boolean;
46
+ /**
47
+ * Retrieves the serialized pending state for the specified key.
48
+ *
49
+ * @param key - The key to retrieve
50
+ * @returns The serialized state as a JSON string, or `undefined` if not found
51
+ */
52
+ get(key: TKey): string | undefined;
53
+ /**
54
+ * Checks whether a pending state exists for the specified key.
55
+ */
56
+ has(key: TKey): boolean;
57
+ /**
58
+ * Stores a pending state from `container.getPendingLocalState()`.
59
+ *
60
+ * @param key - The key to associate with the state
61
+ * @param pendingLocalState - String returned by `getPendingLocalState()` from an attached container
62
+ * @returns This store instance for method chaining
63
+ *
64
+ * @throws When storing states from different container URLs
65
+ */
66
+ set(key: TKey, pendingLocalState: string): this;
67
+ /**
68
+ * Gets the number of stored pending states.
69
+ */
70
+ get size(): number;
71
+ /**
72
+ * Returns an iterator over [key, serializedState] pairs.
73
+ */
74
+ entries(): Iterator<[TKey, string]>;
75
+ /**
76
+ * Returns an iterator over the stored keys.
77
+ */
78
+ keys(): IterableIterator<TKey>;
79
+ /**
80
+ * Makes the store iterable with `for...of` loops.
81
+ */
82
+ [Symbol.iterator](): Iterator<[TKey, string]>;
83
+ }
84
+ //# sourceMappingURL=pendingLocalStateStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingLocalStateStore.d.ts","sourceRoot":"","sources":["../src/pendingLocalStateStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,sBAAsB,CAAC,IAAI;;IAOvC;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO;IAI1B;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS;IAIlC;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO;IAIvB;;;;;;;;OAQG;IACH,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI;IA8B/C;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,OAAO,IAAI,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAcnC;;OAEG;IACH,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC;IAI9B;;OAEG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;CAG7C"}
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
7
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
9
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
10
+ };
11
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
12
+ if (kind === "m") throw new TypeError("Private method is not writable");
13
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
14
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
+ };
17
+ var _PendingLocalStateStore_firstUrl, _PendingLocalStateStore_pendingStates, _PendingLocalStateStore_savedOps, _PendingLocalStateStore_blobs, _PendingLocalStateStore_loadingGroups;
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.PendingLocalStateStore = void 0;
20
+ const internal_1 = require("@fluidframework/telemetry-utils/internal");
21
+ const utils_js_1 = require("./utils.js");
22
+ /**
23
+ * A Map-like store for managing pending local container states from attached containers.
24
+ * Optimizes storage by deduplicating shared resources across stored states.
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const store = new PendingLocalStateStore<string>();
29
+ *
30
+ * // Store pending state
31
+ * const pendingState = await attachedContainer.getPendingLocalState();
32
+ * store.set("session1", pendingState);
33
+ *
34
+ * // Load from stored state
35
+ * const restored = store.get("session1");
36
+ * const newContainer = await loadFrozenContainerFromPendingState({
37
+ * pendingLocalState: restored,
38
+ * // ... other loader options
39
+ * });
40
+ * ```
41
+ *
42
+ * @remarks
43
+ * Only use with attached containers from the same URL. Only store strings
44
+ * returned by `container.getPendingLocalState()`.
45
+ *
46
+ * @typeParam TKey - The type of keys used to identify stored states
47
+ *
48
+ * @legacy @alpha
49
+ */
50
+ class PendingLocalStateStore {
51
+ constructor() {
52
+ _PendingLocalStateStore_firstUrl.set(this, void 0);
53
+ _PendingLocalStateStore_pendingStates.set(this, new Map());
54
+ _PendingLocalStateStore_savedOps.set(this, {});
55
+ _PendingLocalStateStore_blobs.set(this, {});
56
+ _PendingLocalStateStore_loadingGroups.set(this, {});
57
+ }
58
+ /**
59
+ * Removes all stored pending states.
60
+ */
61
+ clear() {
62
+ return __classPrivateFieldGet(this, _PendingLocalStateStore_pendingStates, "f").clear();
63
+ }
64
+ /**
65
+ * Removes the pending state for the specified key.
66
+ *
67
+ * @param key - The key to remove
68
+ * @returns `true` if the state existed and was removed, `false` otherwise
69
+ */
70
+ delete(key) {
71
+ return __classPrivateFieldGet(this, _PendingLocalStateStore_pendingStates, "f").delete(key);
72
+ }
73
+ /**
74
+ * Retrieves the serialized pending state for the specified key.
75
+ *
76
+ * @param key - The key to retrieve
77
+ * @returns The serialized state as a JSON string, or `undefined` if not found
78
+ */
79
+ get(key) {
80
+ return JSON.stringify(__classPrivateFieldGet(this, _PendingLocalStateStore_pendingStates, "f").get(key));
81
+ }
82
+ /**
83
+ * Checks whether a pending state exists for the specified key.
84
+ */
85
+ has(key) {
86
+ return __classPrivateFieldGet(this, _PendingLocalStateStore_pendingStates, "f").has(key);
87
+ }
88
+ /**
89
+ * Stores a pending state from `container.getPendingLocalState()`.
90
+ *
91
+ * @param key - The key to associate with the state
92
+ * @param pendingLocalState - String returned by `getPendingLocalState()` from an attached container
93
+ * @returns This store instance for method chaining
94
+ *
95
+ * @throws When storing states from different container URLs
96
+ */
97
+ set(key, pendingLocalState) {
98
+ const state = (0, utils_js_1.getAttachedContainerStateFromSerializedContainer)(pendingLocalState);
99
+ const { savedOps, snapshotBlobs, loadedGroupIdSnapshots, url } = state;
100
+ __classPrivateFieldSet(this, _PendingLocalStateStore_firstUrl, __classPrivateFieldGet(this, _PendingLocalStateStore_firstUrl, "f") ?? url, "f");
101
+ if (__classPrivateFieldGet(this, _PendingLocalStateStore_firstUrl, "f") !== url) {
102
+ throw new internal_1.UsageError("PendingLocalStateStore can only be used with a single container.");
103
+ }
104
+ for (let i = 0; i < savedOps.length; i++) {
105
+ savedOps[i] = __classPrivateFieldGet(this, _PendingLocalStateStore_savedOps, "f")[savedOps[i].sequenceNumber] ??= savedOps[i];
106
+ }
107
+ for (const [id, blob] of Object.entries(snapshotBlobs)) {
108
+ snapshotBlobs[id] = __classPrivateFieldGet(this, _PendingLocalStateStore_blobs, "f")[id] ??= blob;
109
+ }
110
+ if (loadedGroupIdSnapshots !== undefined) {
111
+ for (const [id, lg] of Object.entries(loadedGroupIdSnapshots)) {
112
+ if (__classPrivateFieldGet(this, _PendingLocalStateStore_loadingGroups, "f")[id] === undefined ||
113
+ lg.snapshotSequenceNumber < __classPrivateFieldGet(this, _PendingLocalStateStore_loadingGroups, "f")[id].snapshotSequenceNumber) {
114
+ loadedGroupIdSnapshots[id] = __classPrivateFieldGet(this, _PendingLocalStateStore_loadingGroups, "f")[id] = lg;
115
+ }
116
+ }
117
+ }
118
+ __classPrivateFieldGet(this, _PendingLocalStateStore_pendingStates, "f").set(key, state);
119
+ return this;
120
+ }
121
+ /**
122
+ * Gets the number of stored pending states.
123
+ */
124
+ get size() {
125
+ return __classPrivateFieldGet(this, _PendingLocalStateStore_pendingStates, "f").size;
126
+ }
127
+ /**
128
+ * Returns an iterator over [key, serializedState] pairs.
129
+ */
130
+ entries() {
131
+ const iterator = __classPrivateFieldGet(this, _PendingLocalStateStore_pendingStates, "f").entries();
132
+ return {
133
+ next: () => {
134
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
135
+ const { done, value } = iterator.next();
136
+ if (done === true) {
137
+ return { done, value: undefined };
138
+ }
139
+ return { done, value: [value[0], JSON.stringify(value[1])] };
140
+ },
141
+ };
142
+ }
143
+ /**
144
+ * Returns an iterator over the stored keys.
145
+ */
146
+ keys() {
147
+ return __classPrivateFieldGet(this, _PendingLocalStateStore_pendingStates, "f").keys();
148
+ }
149
+ /**
150
+ * Makes the store iterable with `for...of` loops.
151
+ */
152
+ [(_PendingLocalStateStore_firstUrl = new WeakMap(), _PendingLocalStateStore_pendingStates = new WeakMap(), _PendingLocalStateStore_savedOps = new WeakMap(), _PendingLocalStateStore_blobs = new WeakMap(), _PendingLocalStateStore_loadingGroups = new WeakMap(), Symbol.iterator)]() {
153
+ return this.entries();
154
+ }
155
+ }
156
+ exports.PendingLocalStateStore = PendingLocalStateStore;
157
+ //# sourceMappingURL=pendingLocalStateStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingLocalStateStore.js","sourceRoot":"","sources":["../src/pendingLocalStateStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAGH,uEAAsE;AAMtE,yCAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,sBAAsB;IAAnC;QACC,mDAA8B;QACrB,gDAAiB,IAAI,GAAG,EAAgC,EAAC;QACzD,2CAAuD,EAAE,EAAC;QAC1D,wCAAiC,EAAE,EAAC;QACpC,gDAAyD,EAAE,EAAC;IAgHtE,CAAC;IA9GA;;OAEG;IACH,KAAK;QACJ,OAAO,uBAAA,IAAI,6CAAe,CAAC,KAAK,EAAE,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,GAAS;QACf,OAAO,uBAAA,IAAI,6CAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,GAAS;QACZ,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAA,I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under the MIT License.\n */\n\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type {\n\tIPendingContainerState,\n\tSerializedSnapshotInfo,\n} from \"./serializedStateManager.js\";\nimport { getAttachedContainerStateFromSerializedContainer } from \"./utils.js\";\n\n/**\n * A Map-like store for managing pending local container states from attached containers.\n * Optimizes storage by deduplicating shared resources across stored states.\n *\n * @example\n * ```typescript\n * const store = new PendingLocalStateStore<string>();\n *\n * // Store pending state\n * const pendingState = await attachedContainer.getPendingLocalState();\n * store.set(\"session1\", pendingState);\n *\n * // Load from stored state\n * const restored = store.get(\"session1\");\n * const newContainer = await loadFrozenContainerFromPendingState({\n * pendingLocalState: restored,\n * // ... other loader options\n * });\n * ```\n *\n * @remarks\n * Only use with attached containers from the same URL. Only store strings\n * returned by `container.getPendingLocalState()`.\n *\n * @typeParam TKey - The type of keys used to identify stored states\n *\n * @legacy @alpha\n */\nexport class PendingLocalStateStore<TKey> {\n\t#firstUrl: string | undefined;\n\treadonly #pendingStates = new Map<TKey, IPendingContainerState>();\n\treadonly #savedOps: Record<number, ISequencedDocumentMessage> = {};\n\treadonly #blobs: Record<string, string> = {};\n\treadonly #loadingGroups: Record<string, SerializedSnapshotInfo> = {};\n\n\t/**\n\t * Removes all stored pending states.\n\t */\n\tclear(): void {\n\t\treturn this.#pendingStates.clear();\n\t}\n\n\t/**\n\t * Removes the pending state for the specified key.\n\t *\n\t * @param key - The key to remove\n\t * @returns `true` if the state existed and was removed, `false` otherwise\n\t */\n\tdelete(key: TKey): boolean {\n\t\treturn this.#pendingStates.delete(key);\n\t}\n\n\t/**\n\t * Retrieves the serialized pending state for the specified key.\n\t *\n\t * @param key - The key to retrieve\n\t * @returns The serialized state as a JSON string, or `undefined` if not found\n\t */\n\tget(key: TKey): string | undefined {\n\t\treturn JSON.stringify(this.#pendingStates.get(key));\n\t}\n\n\t/**\n\t * Checks whether a pending state exists for the specified key.\n\t */\n\thas(key: TKey): boolean {\n\t\treturn this.#pendingStates.has(key);\n\t}\n\n\t/**\n\t * Stores a pending state from `container.getPendingLocalState()`.\n\t *\n\t * @param key - The key to associate with the state\n\t * @param pendingLocalState - String returned by `getPendingLocalState()` from an attached container\n\t * @returns This store instance for method chaining\n\t *\n\t * @throws When storing states from different container URLs\n\t */\n\tset(key: TKey, pendingLocalState: string): this {\n\t\tconst state = getAttachedContainerStateFromSerializedContainer(pendingLocalState);\n\t\tconst { savedOps, snapshotBlobs, loadedGroupIdSnapshots, url } = state;\n\n\t\tthis.#firstUrl ??= url;\n\t\tif (this.#firstUrl !== url) {\n\t\t\tthrow new UsageError(\"PendingLocalStateStore can only be used with a single container.\");\n\t\t}\n\n\t\tfor (let i = 0; i < savedOps.length; i++) {\n\t\t\tsavedOps[i] = this.#savedOps[savedOps[i].sequenceNumber] ??= savedOps[i];\n\t\t}\n\t\tfor (const [id, blob] of Object.entries(snapshotBlobs)) {\n\t\t\tsnapshotBlobs[id] = this.#blobs[id] ??= blob;\n\t\t}\n\t\tif (loadedGroupIdSnapshots !== undefined) {\n\t\t\tfor (const [id, lg] of Object.entries(loadedGroupIdSnapshots)) {\n\t\t\t\tif (\n\t\t\t\t\tthis.#loadingGroups[id] === undefined ||\n\t\t\t\t\tlg.snapshotSequenceNumber < this.#loadingGroups[id].snapshotSequenceNumber\n\t\t\t\t) {\n\t\t\t\t\tloadedGroupIdSnapshots[id] = this.#loadingGroups[id] = lg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.#pendingStates.set(key, state);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Gets the number of stored pending states.\n\t */\n\tget size(): number {\n\t\treturn this.#pendingStates.size;\n\t}\n\n\t/**\n\t * Returns an iterator over [key, serializedState] pairs.\n\t */\n\tentries(): Iterator<[TKey, string]> {\n\t\tconst iterator = this.#pendingStates.entries();\n\t\treturn {\n\t\t\tnext: (): IteratorResult<[TKey, string]> => {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tconst { done, value } = iterator.next();\n\t\t\t\tif (done === true) {\n\t\t\t\t\treturn { done, value: undefined };\n\t\t\t\t}\n\t\t\t\treturn { done, value: [value[0], JSON.stringify(value[1])] };\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Returns an iterator over the stored keys.\n\t */\n\tkeys(): IterableIterator<TKey> {\n\t\treturn this.#pendingStates.keys();\n\t}\n\n\t/**\n\t * Makes the store iterable with `for...of` loops.\n\t */\n\t[Symbol.iterator](): Iterator<[TKey, string]> {\n\t\treturn this.entries();\n\t}\n}\n"]}
@@ -77,5 +77,6 @@ export declare class ProtocolHandler extends ProtocolOpHandler implements Protoc
77
77
  * and Clear signal types.
78
78
  */
79
79
  export declare function protocolHandlerShouldProcessSignal(message: ISignalMessage): message is AudienceSignal;
80
+ export declare function wrapProtocolHandlerBuilder(builder: ProtocolHandlerBuilder, signalAudience: IAudienceOwner): InternalProtocolHandlerBuilder;
80
81
  export {};
81
82
  //# sourceMappingURL=protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAElB,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,iBAAiB,EACjB,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX,UAAU,mBAAmB;IAC5B,IAAI,EAAE,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB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E,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,MAAM,KAC7C,uBAAuB,CAAC;AAE7B,qBAAa,eAAgB,SAAQ,iBAAkB,YAAW,uBAAuB;aAOvE,QAAQ,EAAE,cAAc;IACxC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBANrC,UAAU,EAAE,mBAAmB,EAC/B,cAAc,EAAE,eAAe,EAG/B,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,MAAM,EACjC,QAAQ,EAAE,cAAc,EACvB,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO;IAsB9D,cAAc,CACpB,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAE,OAAO,GACZ,qBAAqB;IAwBjB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;CAiCnD;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,OAAO,EAAE,cAAc,GACrB,OAAO,IAAI,cAAc,CAW3B;AAED,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,sBAAsB,EAC/B,cAAc,EAAE,cAAc,GAC5B,8BAA8B,CA4ChC"}
package/dist/protocol.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.protocolHandlerShouldProcessSignal = exports.ProtocolHandler = exports.SignalType = void 0;
7
+ exports.wrapProtocolHandlerBuilder = exports.protocolHandlerShouldProcessSignal = exports.ProtocolHandler = exports.SignalType = void 0;
8
8
  const internal_1 = require("@fluidframework/driver-definitions/internal");
9
9
  const internal_2 = require("@fluidframework/driver-utils/internal");
10
10
  const index_js_1 = require("./protocol/index.js");
@@ -100,4 +100,46 @@ function protocolHandlerShouldProcessSignal(message) {
100
100
  return false;
101
101
  }
102
102
  exports.protocolHandlerShouldProcessSignal = protocolHandlerShouldProcessSignal;
103
+ function wrapProtocolHandlerBuilder(builder, signalAudience) {
104
+ return (attributes, snapshot, sendProposal) => {
105
+ const baseHandler = builder(attributes, snapshot, sendProposal);
106
+ // Create proxy handler with an overridden processSignal method.
107
+ // Use a Proxy since base may use [dynamic] property getters.
108
+ return new Proxy(baseHandler, {
109
+ get(target, prop, receiver) {
110
+ if (prop === "processSignal") {
111
+ return (message) => {
112
+ const innerContent = message.content;
113
+ switch (innerContent.type) {
114
+ case exports.SignalType.Clear: {
115
+ const members = signalAudience.getMembers();
116
+ for (const clientId of members.keys()) {
117
+ signalAudience.removeMember(clientId);
118
+ }
119
+ break;
120
+ }
121
+ case exports.SignalType.ClientJoin: {
122
+ const newClient = innerContent.content;
123
+ signalAudience.addMember(newClient.clientId, newClient.client);
124
+ break;
125
+ }
126
+ case exports.SignalType.ClientLeave: {
127
+ const leftClientId = innerContent.content;
128
+ signalAudience.removeMember(leftClientId);
129
+ break;
130
+ }
131
+ default: {
132
+ break;
133
+ }
134
+ }
135
+ target.processSignal(message);
136
+ };
137
+ }
138
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
139
+ return Reflect.get(target, prop, receiver);
140
+ },
141
+ });
142
+ };
143
+ }
144
+ exports.wrapProtocolHandlerBuilder = wrapProtocolHandlerBuilder;
103
145
  //# sourceMappingURL=protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAOqD;AACrD,oEAAgF;AAEhF,kDAI6B;AAE7B,mDAAmD;AACtC,QAAA,UAAU,GAAG;IACzB,UAAU,EAAE,MAAM,EAAE,wCAAwC;IAC5D,WAAW,EAAE,OAAO,EAAE,yCAAyC;IAC/D,KAAK,EAAE,OAAO,EAAE,4CAA4C;CACnD,CAAC;AA6EX,MAAa,eAAgB,SAAQ,4BAAiB;IACrD,YACC,UAA+B,EAC/B,cAA+B;IAC/B,0CAA0C;IAC1C,8DAA8D;IAC9D,YAAiD,EACjC,Q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CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,KAAK,MAAM,EAAE,CAAC;oBAC5D,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;gBAC1C,CAAC;gBACD,MAAM;YACP,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM;YACP,CAAC;QACF,CAAC;IACF,CAAC;CACD;AA1FD,0CA0FC;AAED;;;;GAIG;AACH,SAAgB,kCAAkC,CACjD,OAAuB;IAEvB,gCAAgC;IAChC,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC/B,MAAM,YAAY,GAAG,OAAO,CAAC,OAA6C,CAAC;QAC3E,OAAO,CACN,YAAY,CAAC,IAAI,KAAK,kBAAU,CAAC,KAAK;YACtC,YAAY,CAAC,IAAI,KAAK,kBAAU,CAAC,UAAU;YAC3C,YAAY,CAAC,IAAI,KAAK,kBAAU,CAAC,WAAW,CAC5C,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAbD,gFAaC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IAudienceOwner } from \"@fluidframework/container-definitions/internal\";\nimport {\n\ttype IDocumentAttributes,\n\ttype IProcessMessageResult,\n\ttype ISignalClient,\n\tMessageType,\n\ttype ISequencedDocumentMessage,\n\ttype ISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { canBeCoalescedByService } from \"@fluidframework/driver-utils/internal\";\n\nimport {\n\ttype IBaseProtocolHandler,\n\ttype IQuorumSnapshot,\n\tProtocolOpHandler,\n} from \"./protocol/index.js\";\n\n// ADO: #1986: Start using enum from protocol-base.\nexport const SignalType = {\n\tClientJoin: \"join\", // same value as MessageType.ClientJoin,\n\tClientLeave: \"leave\", // same value as MessageType.ClientLeave,\n\tClear: \"clear\", // used only by client for synthetic signals\n} as const;\n\ninterface SystemSignalContent {\n\ttype: (typeof SignalType)[keyof typeof SignalType];\n\tcontent?: unknown;\n}\n\ninterface InboundSystemSignal<TSignalContent extends SystemSignalContent>\n\textends ISignalMessage<{ type: never; content: TSignalContent }> {\n\t// eslint-disable-next-line @rushstack/no-new-null -- `null` is used in JSON protocol to indicate system message\n\treadonly clientId: null;\n}\n\ntype ClientJoinSignal = InboundSystemSignal<{\n\ttype: typeof SignalType.ClientJoin;\n\tcontent: ISignalClient;\n}>;\n\ntype ClientLeaveSignal = InboundSystemSignal<{\n\ttype: typeof SignalType.ClientLeave;\n\tcontent: string; // clientId of leaving client\n}>;\n\ntype ClearClientsSignal = InboundSystemSignal<{\n\ttype: typeof SignalType.Clear;\n}>;\n\ntype AudienceSignal = ClientJoinSignal | ClientLeaveSignal | ClearClientsSignal;\n\n/**\n * Function to be used for creating a protocol handler.\n * @legacy @beta\n */\nexport type ProtocolHandlerBuilder = (\n\tattributes: IDocumentAttributes,\n\tsnapshot: IQuorumSnapshot,\n\t// TODO: use a real type (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendProposal: (key: string, value: any) => number,\n) => IProtocolHandler;\n\n/**\n * @legacy @beta\n */\nexport interface IProtocolHandler extends IBaseProtocolHandler {\n\treadonly audience: IAudienceOwner;\n\tprocessSignal(message: ISignalMessage);\n}\n\n/**\n * More specific version of {@link IProtocolHandler} with narrower call\n * constraints for {@link IProtocolHandler.processSignal}.\n */\nexport interface ProtocolHandlerInternal extends IProtocolHandler {\n\t/**\n\t * Process the audience related signal.\n\t * @privateRemarks\n\t * Internally, only {@link AudienceSignal} messages need handling.\n\t */\n\tprocessSignal(message: AudienceSignal): void;\n}\n\n/**\n * Function to be used for creating a protocol handler.\n *\n * @remarks This is the same are {@link ProtocolHandlerBuilder} but\n * returns the {@link ProtocolHandlerInternal} which has narrower\n * expectations for `processSignal`.\n */\nexport type InternalProtocolHandlerBuilder = (\n\tattributes: IDocumentAttributes,\n\tsnapshot: IQuorumSnapshot,\n\t// TODO: use a real type (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendProposal: (key: string, value: any) => number,\n) => ProtocolHandlerInternal;\n\nexport class ProtocolHandler extends ProtocolOpHandler implements ProtocolHandlerInternal {\n\tconstructor(\n\t\tattributes: IDocumentAttributes,\n\t\tquorumSnapshot: IQuorumSnapshot,\n\t\t// TODO: use a real type (breaking change)\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tsendProposal: (key: string, value: any) => number,\n\t\tpublic readonly audience: IAudienceOwner,\n\t\tprivate readonly shouldClientHaveLeft: (clientId: string) => boolean,\n\t) {\n\t\tsuper(\n\t\t\tattributes.minimumSequenceNumber,\n\t\t\tattributes.sequenceNumber,\n\t\t\tquorumSnapshot.members,\n\t\t\tquorumSnapshot.proposals,\n\t\t\tquorumSnapshot.values,\n\t\t\tsendProposal,\n\t\t);\n\n\t\tfor (const [clientId, member] of this.quorum.getMembers()) {\n\t\t\taudience.addMember(clientId, member.client);\n\t\t}\n\n\t\t// Join / leave signals are ignored for \"write\" clients in favor of join / leave ops\n\t\tthis.quorum.on(\"addMember\", (clientId, details) =>\n\t\t\taudience.addMember(clientId, details.client),\n\t\t);\n\t\tthis.quorum.on(\"removeMember\", (clientId) => audience.removeMember(clientId));\n\t}\n\n\tpublic processMessage(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t): IProcessMessageResult {\n\t\t// Check and report if we're getting messages from a clientId that we previously\n\t\t// flagged as shouldHaveLeft, or from a client that's not in the quorum but should be\n\t\t// eslint-disable-next-line unicorn/no-null\n\t\tif (message.clientId != null) {\n\t\t\tconst client = this.quorum.getMember(message.clientId);\n\n\t\t\tif (client === undefined && message.type !== MessageType.ClientJoin) {\n\t\t\t\t// pre-0.58 error message: messageClientIdMissingFromQuorum\n\t\t\t\tthrow new Error(\"Remote message's clientId is missing from the quorum\");\n\t\t\t}\n\n\t\t\t// Here checking canBeCoalescedByService is used as an approximation of \"is benign to process despite being unexpected\".\n\t\t\t// It's still not good to see these messages from unexpected clientIds, but since they don't harm the integrity of the\n\t\t\t// document we don't need to blow up aggressively.\n\t\t\tif (this.shouldClientHaveLeft(message.clientId) && !canBeCoalescedByService(message)) {\n\t\t\t\t// pre-0.58 error message: messageClientIdShouldHaveLeft\n\t\t\t\tthrow new Error(\"Remote message's clientId already should have left\");\n\t\t\t}\n\t\t}\n\n\t\treturn super.processMessage(message, local);\n\t}\n\n\tpublic processSignal(message: AudienceSignal): void {\n\t\tconst innerContent = message.content;\n\t\tswitch (innerContent.type) {\n\t\t\tcase SignalType.Clear: {\n\t\t\t\tconst members = this.audience.getMembers();\n\t\t\t\tfor (const [clientId, client] of members) {\n\t\t\t\t\tif (client.mode === \"read\") {\n\t\t\t\t\t\tthis.audience.removeMember(clientId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SignalType.ClientJoin: {\n\t\t\t\tconst newClient = innerContent.content;\n\t\t\t\t// Ignore write clients - quorum will control such clients.\n\t\t\t\tif (newClient.client.mode === \"read\") {\n\t\t\t\t\tthis.audience.addMember(newClient.clientId, newClient.client);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SignalType.ClientLeave: {\n\t\t\t\tconst leftClientId = innerContent.content;\n\t\t\t\t// Ignore write clients - quorum will control such clients.\n\t\t\t\tif (this.audience.getMember(leftClientId)?.mode === \"read\") {\n\t\t\t\t\tthis.audience.removeMember(leftClientId);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Function to check whether the protocol handler should process the Signal.\n * The protocol handler should strictly handle only ClientJoin, ClientLeave\n * and Clear signal types.\n */\nexport function protocolHandlerShouldProcessSignal(\n\tmessage: ISignalMessage,\n): message is AudienceSignal {\n\t// Signal originates from server\n\tif (message.clientId === null) {\n\t\tconst innerContent = message.content as { content: unknown; type: string };\n\t\treturn (\n\t\t\tinnerContent.type === SignalType.Clear ||\n\t\t\tinnerContent.type === SignalType.ClientJoin ||\n\t\t\tinnerContent.type === SignalType.ClientLeave\n\t\t);\n\t}\n\treturn false;\n}\n"]}
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,0EAOqD;AACrD,oEAAgF;AAEhF,kDAI6B;AAE7B,mDAAmD;AACtC,QAAA,UAAU,GAAG;IACzB,UAAU,EAAE,MAAM,EAAE,wCAAwC;IAC5D,WAAW,EAAE,OAAO,EAAE,yCAAyC;IAC/D,KAAK,EAAE,OAAO,EAAE,4CAA4C;CACnD,CAAC;AA6EX,MAAa,eAAgB,SAAQ,4BAAiB;IACrD,YACC,UAA+B,EAC/B,cAA+B;IAC/B,0CAA0C;IAC1C,8DAA8D;IAC9D,YAAiD,EACjC,QAAwB,EACvB,oBAAmD;QAEpE,KAAK,CACJ,UAAU,CAAC,qBAAqB,EAChC,UAAU,CAAC,cAAc,EACzB,cAAc,CAAC,OAAO,EACtB,cAAc,CAAC,SAAS,EACxB,cAAc,CAAC,MAAM,EACrB,YAAY,CACZ,CAAC;QAVc,aAAQ,GAAR,QAAQ,CAAgB;QACvB,yBAAoB,GAApB,oBAAoB,CAA+B;QAWpE,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;YAC3D,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC;QAED,oFAAoF;QACpF,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CACjD,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAC5C,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,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AAC,aAAa,CAAC,OAAO,CAAC,CAAC;oBAC/B,CAAC,CAAC;gBACH,CAAC;gBACD,+DAA+D;gBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC5C,CAAC;SACD,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AA/CD,gEA+CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IAudienceOwner } from \"@fluidframework/container-definitions/internal\";\nimport {\n\ttype IDocumentAttributes,\n\ttype IProcessMessageResult,\n\ttype ISignalClient,\n\tMessageType,\n\ttype ISequencedDocumentMessage,\n\ttype ISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { canBeCoalescedByService } from \"@fluidframework/driver-utils/internal\";\n\nimport {\n\ttype IBaseProtocolHandler,\n\ttype IQuorumSnapshot,\n\tProtocolOpHandler,\n} from \"./protocol/index.js\";\n\n// ADO: #1986: Start using enum from protocol-base.\nexport const SignalType = {\n\tClientJoin: \"join\", // same value as MessageType.ClientJoin,\n\tClientLeave: \"leave\", // same value as MessageType.ClientLeave,\n\tClear: \"clear\", // used only by client for synthetic signals\n} as const;\n\ninterface SystemSignalContent {\n\ttype: (typeof SignalType)[keyof typeof SignalType];\n\tcontent?: unknown;\n}\n\ninterface InboundSystemSignal<TSignalContent extends SystemSignalContent>\n\textends ISignalMessage<{ type: never; content: TSignalContent }> {\n\t// eslint-disable-next-line @rushstack/no-new-null -- `null` is used in JSON protocol to indicate system message\n\treadonly clientId: null;\n}\n\ntype ClientJoinSignal = InboundSystemSignal<{\n\ttype: typeof SignalType.ClientJoin;\n\tcontent: ISignalClient;\n}>;\n\ntype ClientLeaveSignal = InboundSystemSignal<{\n\ttype: typeof SignalType.ClientLeave;\n\tcontent: string; // clientId of leaving client\n}>;\n\ntype ClearClientsSignal = InboundSystemSignal<{\n\ttype: typeof SignalType.Clear;\n}>;\n\ntype AudienceSignal = ClientJoinSignal | ClientLeaveSignal | ClearClientsSignal;\n\n/**\n * Function to be used for creating a protocol handler.\n * @legacy @beta\n */\nexport type ProtocolHandlerBuilder = (\n\tattributes: IDocumentAttributes,\n\tsnapshot: IQuorumSnapshot,\n\t// TODO: use a real type (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendProposal: (key: string, value: any) => number,\n) => IProtocolHandler;\n\n/**\n * @legacy @beta\n */\nexport interface IProtocolHandler extends IBaseProtocolHandler {\n\treadonly audience: IAudienceOwner;\n\tprocessSignal(message: ISignalMessage);\n}\n\n/**\n * More specific version of {@link IProtocolHandler} with narrower call\n * constraints for {@link IProtocolHandler.processSignal}.\n */\nexport interface ProtocolHandlerInternal extends IProtocolHandler {\n\t/**\n\t * Process the audience related signal.\n\t * @privateRemarks\n\t * Internally, only {@link AudienceSignal} messages need handling.\n\t */\n\tprocessSignal(message: AudienceSignal): void;\n}\n\n/**\n * Function to be used for creating a protocol handler.\n *\n * @remarks This is the same are {@link ProtocolHandlerBuilder} but\n * returns the {@link ProtocolHandlerInternal} which has narrower\n * expectations for `processSignal`.\n */\nexport type InternalProtocolHandlerBuilder = (\n\tattributes: IDocumentAttributes,\n\tsnapshot: IQuorumSnapshot,\n\t// TODO: use a real type (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsendProposal: (key: string, value: any) => number,\n) => ProtocolHandlerInternal;\n\nexport class ProtocolHandler extends ProtocolOpHandler implements ProtocolHandlerInternal {\n\tconstructor(\n\t\tattributes: IDocumentAttributes,\n\t\tquorumSnapshot: IQuorumSnapshot,\n\t\t// TODO: use a real type (breaking change)\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tsendProposal: (key: string, value: any) => number,\n\t\tpublic readonly audience: IAudienceOwner,\n\t\tprivate readonly shouldClientHaveLeft: (clientId: string) => boolean,\n\t) {\n\t\tsuper(\n\t\t\tattributes.minimumSequenceNumber,\n\t\t\tattributes.sequenceNumber,\n\t\t\tquorumSnapshot.members,\n\t\t\tquorumSnapshot.proposals,\n\t\t\tquorumSnapshot.values,\n\t\t\tsendProposal,\n\t\t);\n\n\t\tfor (const [clientId, member] of this.quorum.getMembers()) {\n\t\t\taudience.addMember(clientId, member.client);\n\t\t}\n\n\t\t// Join / leave signals are ignored for \"write\" clients in favor of join / leave ops\n\t\tthis.quorum.on(\"addMember\", (clientId, details) =>\n\t\t\taudience.addMember(clientId, details.client),\n\t\t);\n\t\tthis.quorum.on(\"removeMember\", (clientId) => audience.removeMember(clientId));\n\t}\n\n\tpublic processMessage(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t): IProcessMessageResult {\n\t\t// Check and report if we're getting messages from a clientId that we previously\n\t\t// flagged as shouldHaveLeft, or from a client that's not in the quorum but should be\n\t\t// eslint-disable-next-line unicorn/no-null\n\t\tif (message.clientId != null) {\n\t\t\tconst client = this.quorum.getMember(message.clientId);\n\n\t\t\tif (client === undefined && message.type !== MessageType.ClientJoin) {\n\t\t\t\t// pre-0.58 error message: messageClientIdMissingFromQuorum\n\t\t\t\tthrow new Error(\"Remote message's clientId is missing from the quorum\");\n\t\t\t}\n\n\t\t\t// Here checking canBeCoalescedByService is used as an approximation of \"is benign to process despite being unexpected\".\n\t\t\t// It's still not good to see these messages from unexpected clientIds, but since they don't harm the integrity of the\n\t\t\t// document we don't need to blow up aggressively.\n\t\t\tif (this.shouldClientHaveLeft(message.clientId) && !canBeCoalescedByService(message)) {\n\t\t\t\t// pre-0.58 error message: messageClientIdShouldHaveLeft\n\t\t\t\tthrow new Error(\"Remote message's clientId already should have left\");\n\t\t\t}\n\t\t}\n\n\t\treturn super.processMessage(message, local);\n\t}\n\n\tpublic processSignal(message: AudienceSignal): void {\n\t\tconst innerContent = message.content;\n\t\tswitch (innerContent.type) {\n\t\t\tcase SignalType.Clear: {\n\t\t\t\tconst members = this.audience.getMembers();\n\t\t\t\tfor (const [clientId, client] of members) {\n\t\t\t\t\tif (client.mode === \"read\") {\n\t\t\t\t\t\tthis.audience.removeMember(clientId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SignalType.ClientJoin: {\n\t\t\t\tconst newClient = innerContent.content;\n\t\t\t\t// Ignore write clients - quorum will control such clients.\n\t\t\t\tif (newClient.client.mode === \"read\") {\n\t\t\t\t\tthis.audience.addMember(newClient.clientId, newClient.client);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase SignalType.ClientLeave: {\n\t\t\t\tconst leftClientId = innerContent.content;\n\t\t\t\t// Ignore write clients - quorum will control such clients.\n\t\t\t\tif (this.audience.getMember(leftClientId)?.mode === \"read\") {\n\t\t\t\t\tthis.audience.removeMember(leftClientId);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Function to check whether the protocol handler should process the Signal.\n * The protocol handler should strictly handle only ClientJoin, ClientLeave\n * and Clear signal types.\n */\nexport function protocolHandlerShouldProcessSignal(\n\tmessage: ISignalMessage,\n): message is AudienceSignal {\n\t// Signal originates from server\n\tif (message.clientId === null) {\n\t\tconst innerContent = message.content as { content: unknown; type: string };\n\t\treturn (\n\t\t\tinnerContent.type === SignalType.Clear ||\n\t\t\tinnerContent.type === SignalType.ClientJoin ||\n\t\t\tinnerContent.type === SignalType.ClientLeave\n\t\t);\n\t}\n\treturn false;\n}\n\nexport function wrapProtocolHandlerBuilder(\n\tbuilder: ProtocolHandlerBuilder,\n\tsignalAudience: IAudienceOwner,\n): InternalProtocolHandlerBuilder {\n\treturn (\n\t\tattributes: IDocumentAttributes,\n\t\tsnapshot: IQuorumSnapshot,\n\t\tsendProposal: (key: string, value: unknown) => number,\n\t): ProtocolHandlerInternal => {\n\t\tconst baseHandler = builder(attributes, snapshot, sendProposal);\n\t\t// Create proxy handler with an overridden processSignal method.\n\t\t// Use a Proxy since base may use [dynamic] property getters.\n\t\treturn new Proxy(baseHandler, {\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tif (prop === \"processSignal\") {\n\t\t\t\t\treturn (message: AudienceSignal) => {\n\t\t\t\t\t\tconst innerContent = message.content;\n\t\t\t\t\t\tswitch (innerContent.type) {\n\t\t\t\t\t\t\tcase SignalType.Clear: {\n\t\t\t\t\t\t\t\tconst members = signalAudience.getMembers();\n\t\t\t\t\t\t\t\tfor (const clientId of members.keys()) {\n\t\t\t\t\t\t\t\t\tsignalAudience.removeMember(clientId);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase SignalType.ClientJoin: {\n\t\t\t\t\t\t\t\tconst newClient = innerContent.content;\n\t\t\t\t\t\t\t\tsignalAudience.addMember(newClient.clientId, newClient.client);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase SignalType.ClientLeave: {\n\t\t\t\t\t\t\t\tconst leftClientId = innerContent.content;\n\t\t\t\t\t\t\t\tsignalAudience.removeMember(leftClientId);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdefault: {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttarget.processSignal(message);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t\t},\n\t\t});\n\t};\n}\n"]}
package/dist/utils.d.ts CHANGED
@@ -92,6 +92,7 @@ export declare function getDetachedContainerStateFromSerializedContainer(seriali
92
92
  * Blindly parses the given string into {@link IPendingContainerState} format.
93
93
  * This is the inverse of the JSON.stringify call in {@link SerializedStateManager.getPendingLocalState}
94
94
  */
95
+ export declare function getAttachedContainerStateFromSerializedContainer(serializedContainer: string): IPendingContainerState;
95
96
  export declare function getAttachedContainerStateFromSerializedContainer(serializedContainer: string | undefined): IPendingContainerState | undefined;
96
97
  /**
97
98
  * Ensures only a single instance of the provided async function is running.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACN,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EAGxC,MAAM,uCAAuC,CAAC;AAS/C,OAAO,KAAK,EACX,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,6BAA6B,CAAC;AAIrC,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IACnE,aAAa,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAC;IACnD,KAAK,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,6BAA6B,CAAA;KAAE,CAAC;CACzD;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAiBjF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC3C,UAAU,EAAE,YAAY,EACxB,eAAe,EAAE,YAAY,GAC3B,6BAA6B,C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,aAAa,CAE9E;AAED,eAAO,MAAM,mCAAmC,oCAG7C,KAAK,SAAS,EAAE,cAAc,GAAG,cAAc,CAAC,KAAG,6BAyBrD,CAAC;AAEF,wBAAgB,qCAAqC,CACpD,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,mCAAmC,CAO9C;AAmBD;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,QAAQ,EAAE,SAAS,GAAG,iBAAiB,CAS1F;AAED;;;;GAIG;AACH,wBAAgB,gDAAgD,CAC/D,mBAAmB,EAAE,MAAM,GACzB,8BAA8B,CAmBhC;AAED;;;GAGG;AACH,wBAAgB,gDAAgD,CAC/D,mBAAmB,EAAE,MAAM,GACzB,sBAAsB,CAAC;AAC1B,wBAAgB,gDAAgD,CAC/D,mBAAmB,EAAE,MAAM,GAAG,SAAS,GACrC,sBAAsB,GAAG,SAAS,CAAC;AAStC;;;GAGG;AAEH,eAAO,MAAM,SAAS,6BACf,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,KAC9B,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAsB7B,CAAC;AAEF,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,EAClD,IAAI,EAAE,aAAa,GAAG,SAAS,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CAiB9B"}
package/dist/utils.js CHANGED
@@ -264,10 +264,6 @@ function getDetachedContainerStateFromSerializedContainer(serializedContainer) {
264
264
  }
265
265
  }
266
266
  exports.getDetachedContainerStateFromSerializedContainer = getDetachedContainerStateFromSerializedContainer;
267
- /**
268
- * Blindly parses the given string into {@link IPendingContainerState} format.
269
- * This is the inverse of the JSON.stringify call in {@link SerializedStateManager.getPendingLocalState}
270
- */
271
267
  function getAttachedContainerStateFromSerializedContainer(serializedContainer) {
272
268
  return serializedContainer === undefined
273
269
  ? undefined