@fluidframework/container-runtime 2.41.0 → 2.42.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 (134) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/channelCollection.d.ts +1 -1
  4. package/dist/channelCollection.d.ts.map +1 -1
  5. package/dist/channelCollection.js +4 -4
  6. package/dist/channelCollection.js.map +1 -1
  7. package/dist/compatUtils.d.ts +22 -1
  8. package/dist/compatUtils.d.ts.map +1 -1
  9. package/dist/compatUtils.js +109 -7
  10. package/dist/compatUtils.js.map +1 -1
  11. package/dist/containerRuntime.d.ts +34 -13
  12. package/dist/containerRuntime.d.ts.map +1 -1
  13. package/dist/containerRuntime.js +158 -59
  14. package/dist/containerRuntime.js.map +1 -1
  15. package/dist/dataStore.d.ts.map +1 -1
  16. package/dist/dataStore.js +5 -0
  17. package/dist/dataStore.js.map +1 -1
  18. package/dist/gc/garbageCollection.d.ts.map +1 -1
  19. package/dist/gc/garbageCollection.js +2 -0
  20. package/dist/gc/garbageCollection.js.map +1 -1
  21. package/dist/gc/gcDefinitions.d.ts +1 -1
  22. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  23. package/dist/gc/gcDefinitions.js.map +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/messageTypes.d.ts +5 -4
  28. package/dist/messageTypes.d.ts.map +1 -1
  29. package/dist/messageTypes.js.map +1 -1
  30. package/dist/metadata.d.ts +1 -1
  31. package/dist/metadata.d.ts.map +1 -1
  32. package/dist/metadata.js.map +1 -1
  33. package/dist/opLifecycle/definitions.d.ts +6 -5
  34. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  35. package/dist/opLifecycle/definitions.js.map +1 -1
  36. package/dist/opLifecycle/index.d.ts +1 -1
  37. package/dist/opLifecycle/index.d.ts.map +1 -1
  38. package/dist/opLifecycle/index.js.map +1 -1
  39. package/dist/opLifecycle/opGroupingManager.d.ts +9 -0
  40. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  41. package/dist/opLifecycle/opGroupingManager.js +6 -4
  42. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  43. package/dist/opLifecycle/opSerialization.d.ts +2 -1
  44. package/dist/opLifecycle/opSerialization.d.ts.map +1 -1
  45. package/dist/opLifecycle/opSerialization.js.map +1 -1
  46. package/dist/packageVersion.d.ts +1 -1
  47. package/dist/packageVersion.js +1 -1
  48. package/dist/packageVersion.js.map +1 -1
  49. package/dist/pendingStateManager.d.ts +18 -5
  50. package/dist/pendingStateManager.d.ts.map +1 -1
  51. package/dist/pendingStateManager.js +20 -13
  52. package/dist/pendingStateManager.js.map +1 -1
  53. package/dist/summary/documentSchema.d.ts +42 -18
  54. package/dist/summary/documentSchema.d.ts.map +1 -1
  55. package/dist/summary/documentSchema.js +62 -52
  56. package/dist/summary/documentSchema.js.map +1 -1
  57. package/dist/summary/index.d.ts +1 -1
  58. package/dist/summary/index.d.ts.map +1 -1
  59. package/dist/summary/index.js.map +1 -1
  60. package/lib/channelCollection.d.ts +1 -1
  61. package/lib/channelCollection.d.ts.map +1 -1
  62. package/lib/channelCollection.js +4 -4
  63. package/lib/channelCollection.js.map +1 -1
  64. package/lib/compatUtils.d.ts +22 -1
  65. package/lib/compatUtils.d.ts.map +1 -1
  66. package/lib/compatUtils.js +102 -3
  67. package/lib/compatUtils.js.map +1 -1
  68. package/lib/containerRuntime.d.ts +34 -13
  69. package/lib/containerRuntime.d.ts.map +1 -1
  70. package/lib/containerRuntime.js +160 -61
  71. package/lib/containerRuntime.js.map +1 -1
  72. package/lib/dataStore.d.ts.map +1 -1
  73. package/lib/dataStore.js +5 -0
  74. package/lib/dataStore.js.map +1 -1
  75. package/lib/gc/garbageCollection.d.ts.map +1 -1
  76. package/lib/gc/garbageCollection.js +2 -0
  77. package/lib/gc/garbageCollection.js.map +1 -1
  78. package/lib/gc/gcDefinitions.d.ts +1 -1
  79. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  80. package/lib/gc/gcDefinitions.js.map +1 -1
  81. package/lib/index.d.ts +1 -1
  82. package/lib/index.d.ts.map +1 -1
  83. package/lib/index.js.map +1 -1
  84. package/lib/messageTypes.d.ts +5 -4
  85. package/lib/messageTypes.d.ts.map +1 -1
  86. package/lib/messageTypes.js.map +1 -1
  87. package/lib/metadata.d.ts +1 -1
  88. package/lib/metadata.d.ts.map +1 -1
  89. package/lib/metadata.js.map +1 -1
  90. package/lib/opLifecycle/definitions.d.ts +6 -5
  91. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  92. package/lib/opLifecycle/definitions.js.map +1 -1
  93. package/lib/opLifecycle/index.d.ts +1 -1
  94. package/lib/opLifecycle/index.d.ts.map +1 -1
  95. package/lib/opLifecycle/index.js.map +1 -1
  96. package/lib/opLifecycle/opGroupingManager.d.ts +9 -0
  97. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  98. package/lib/opLifecycle/opGroupingManager.js +6 -4
  99. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  100. package/lib/opLifecycle/opSerialization.d.ts +2 -1
  101. package/lib/opLifecycle/opSerialization.d.ts.map +1 -1
  102. package/lib/opLifecycle/opSerialization.js.map +1 -1
  103. package/lib/packageVersion.d.ts +1 -1
  104. package/lib/packageVersion.js +1 -1
  105. package/lib/packageVersion.js.map +1 -1
  106. package/lib/pendingStateManager.d.ts +18 -5
  107. package/lib/pendingStateManager.d.ts.map +1 -1
  108. package/lib/pendingStateManager.js +20 -13
  109. package/lib/pendingStateManager.js.map +1 -1
  110. package/lib/summary/documentSchema.d.ts +42 -18
  111. package/lib/summary/documentSchema.d.ts.map +1 -1
  112. package/lib/summary/documentSchema.js +62 -52
  113. package/lib/summary/documentSchema.js.map +1 -1
  114. package/lib/summary/index.d.ts +1 -1
  115. package/lib/summary/index.d.ts.map +1 -1
  116. package/lib/summary/index.js.map +1 -1
  117. package/package.json +18 -18
  118. package/src/channelCollection.ts +4 -4
  119. package/src/compatUtils.ts +145 -10
  120. package/src/containerRuntime.ts +209 -73
  121. package/src/dataStore.ts +7 -0
  122. package/src/gc/garbageCollection.ts +2 -0
  123. package/src/gc/gcDefinitions.ts +1 -1
  124. package/src/index.ts +2 -1
  125. package/src/messageTypes.ts +12 -5
  126. package/src/metadata.ts +1 -1
  127. package/src/opLifecycle/definitions.ts +7 -3
  128. package/src/opLifecycle/index.ts +1 -0
  129. package/src/opLifecycle/opGroupingManager.ts +17 -4
  130. package/src/opLifecycle/opSerialization.ts +6 -1
  131. package/src/packageVersion.ts +1 -1
  132. package/src/pendingStateManager.ts +49 -22
  133. package/src/summary/documentSchema.ts +111 -86
  134. package/src/summary/index.ts +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"gcDefinitions.js","sourceRoot":"","sources":["../../src/gc/gcDefinitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8BH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAc,CAAC,CAAC;AAC5C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAc,CAAC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAClE;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,0CAA0C,CAAC;AAC9E;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAC1C,qDAAqD,CAAC;AACvD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8CAA8C,CAAC;AAEtF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,QAAQ,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,SAAS;AAC/D,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC,UAAU;AACvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,QAAQ;AA0K/D;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,kCAAkC;IAClC,SAAS,EAAE,WAAW;IACtB,8DAA8D;IAC9D,YAAY,EAAE,cAAc;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM;IACZ,+DAA+D;IAC/D,KAAK,EAAE,OAAO;CACL,CAAC;AAOX;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,eAAe,EAAE,iBAAiB;CACzB,CAAC;AAuUX;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;IACH,QAAQ,EAAE,UAAU;IACpB;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAChC;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tITelemetryContext,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeResult,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { ReadAndParseBlob } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\ttype ITelemetryPropertiesExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { RuntimeHeaderData } from \"../containerRuntime.js\";\nimport { ContainerRuntimeGCMessage } from \"../messageTypes.js\";\nimport {\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIRefreshSummaryResult,\n} from \"../summary/index.js\";\n\n/**\n * @internal\n */\nexport type GCVersion = number;\n\n/**\n * The stable/default version of GC Data\n */\nexport const stableGCVersion: GCVersion = 3;\n/**\n * The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files.\n */\nexport const nextGCVersion: GCVersion = 4;\n\n/**\n * This undocumented GC Option (on ContainerRuntime Options) allows configuring which documents can have Sweep enabled.\n * This provides a way to disable both Tombstone Enforcement and Sweep.\n *\n * If unset, Tombstone Enforcement + Sweep will operate as otherwise configured.\n * Otherwise, the Sweep Phase will be disabled for documents where persisted value doesn't match what is passed into this session.\n * This provides a way to disallow Sweep for old documents that may be too difficult for an app to repair,\n * in case a bug is found that violates GC's assumptions.\n *\n * @see GCFeatureMatrix (gcGeneration)\n */\nexport const gcGenerationOptionName = \"gcGeneration\";\n\n/**\n * Config key to turn GC test mode on / off.\n */\nexport const gcTestModeKey = \"Fluid.GarbageCollection.GCTestMode\";\n/**\n * Config key to expire a session after a set period of time. Defaults to true.\n */\nexport const runSessionExpiryKey = \"Fluid.GarbageCollection.RunSessionExpiry\";\n/**\n * Config key to disable throwing an error when tombstone object is loaded (requested).\n */\nexport const disableThrowOnTombstoneLoadKey =\n\t\"Fluid.GarbageCollection.DisableThrowOnTombstoneLoad\";\n/**\n * Config key to enable GC version upgrade.\n */\nexport const gcVersionUpgradeToV4Key = \"Fluid.GarbageCollection.GCVersionUpgradeToV4\";\n\n// One day in milliseconds.\nexport const oneDayMs = 1 * 24 * 60 * 60 * 1000;\n\n/**\n * The maximum snapshot cache expiry in the driver. This is used to calculate the tombstone timeout.\n * Tombstone timeout = session expiry timeout + snapshot cache expiry timeout + a buffer.\n * The snapshot cache expiry timeout cannot be known precisely but the upper bound is 5 days, i.e., any snapshot\n * in cache will be invalidated before 5 days.\n */\nexport const maxSnapshotCacheExpiryMs = 5 * oneDayMs;\n\nexport const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days\nexport const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days\nexport const defaultSweepGracePeriodMs = 1 * oneDayMs; // 1 day\n\n/**\n * @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName\n * @internal\n */\nexport type GCFeatureMatrix =\n\t| {\n\t\t\t/**\n\t\t\t * The GC Generation value in effect when this file was created.\n\t\t\t * Gives a way for an app to disqualify old files from GC Sweep.\n\t\t\t * Provided via Container Runtime Options.\n\t\t\t */\n\t\t\tgcGeneration?: number;\n\t\t\t/**\n\t\t\t * Deprecated property from legacy type. Will not be set concurrently with gcGeneration\n\t\t\t */\n\t\t\ttombstoneGeneration?: undefined;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Tombstone Generation value in effect when this file was created.\n\t\t\t * Legacy - new containers would get gcGeneration instead (if anything)\n\t\t\t */\n\t\t\ttombstoneGeneration: number;\n\t };\n\n/**\n * Deprecated properties formerly included in @see IGCMetadata.\n * These may be found in old snapshots, so we need to support them for backwards compatibility.\n */\nexport interface IGCMetadata_Deprecated {\n\t/**\n\t * How long to wait after an object is unreferenced before deleting it via GC Sweep\n\t *\n\t * @deprecated Replaced by @see IGCMetadata.tombstoneTimeoutMs\n\t */\n\treadonly sweepTimeoutMs?: number;\n}\n\n/**\n * GC-specific metadata to be written into the summary.\n *\n * @internal\n */\nexport interface IGCMetadata {\n\t/**\n\t * The version of the GC code that was run to generate the GC data that is written in the summary.\n\t * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.\n\t * Also, used to determine whether GC is enabled for this container or not:\n\t * - A value of 0 or undefined means GC is disabled.\n\t * - A value greater than 0 means GC is enabled.\n\t */\n\treadonly gcFeature?: GCVersion;\n\n\t/**\n\t * A collection of different numerical \"Generations\" for different features,\n\t * used to determine feature availability over time.\n\t * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),\n\t * and pertains to aspects of the document that may be fixed for its lifetime.\n\t *\n\t * For each dimension, if the persisted value doesn't match the currently provided value,\n\t * then this file does not support the corresponding feature as currently implemented.\n\t *\n\t * Guidance is that if no value is provided at runtime, it should result in the current default behavior.\n\t */\n\treadonly gcFeatureMatrix?: GCFeatureMatrix;\n\t/**\n\t * Tells whether the GC sweep phase is enabled for this container.\n\t * - True means sweep phase is enabled.\n\t * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n\t *\n\t * @deprecated use GCFeatureMatrix.gcGeneration instead. @see GCFeatureMatrix.gcGeneration\n\t */\n\treadonly sweepEnabled?: boolean;\n\t/**\n\t * If this is present, the session for this container will expire after this time and the container will close\n\t */\n\treadonly sessionExpiryTimeoutMs?: number;\n\t/**\n\t * How long to wait after an object is unreferenced before it becomes a Tombstone.\n\t *\n\t * After this point, there's a grace period before the object is deleted.\n\t * @see IGCRuntimeOptions.sweepGracePeriodMs\n\t *\n\t * So the full sweep timeout in a session is tombstoneTimeoutMs + sweepGracePeriodMs.\n\t */\n\treadonly tombstoneTimeoutMs?: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection mark phase run.\n * @internal\n */\nexport interface IMarkPhaseStats {\n\t/**\n\t * The number of nodes in the container.\n\t */\n\tnodeCount: number;\n\t/**\n\t * The number of data stores in the container.\n\t */\n\tdataStoreCount: number;\n\t/**\n\t * The number of attachment blobs in the container.\n\t */\n\tattachmentBlobCount: number;\n\t/**\n\t * The number of unreferenced nodes in the container.\n\t */\n\tunrefNodeCount: number;\n\t/**\n\t * The number of unreferenced data stores in the container.\n\t */\n\tunrefDataStoreCount: number;\n\t/**\n\t * The number of unreferenced attachment blobs in the container.\n\t */\n\tunrefAttachmentBlobCount: number;\n\t/**\n\t * The number of nodes whose reference state updated since last GC run.\n\t */\n\tupdatedNodeCount: number;\n\t/**\n\t * The number of data stores whose reference state updated since last GC run.\n\t */\n\tupdatedDataStoreCount: number;\n\t/**\n\t * The number of attachment blobs whose reference state updated since last GC run.\n\t */\n\tupdatedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection sweep phase run.\n * @internal\n */\nexport interface ISweepPhaseStats {\n\t/**\n\t * The number of nodes in the lifetime of the container.\n\t */\n\tlifetimeNodeCount: number;\n\t/**\n\t * The number of data stores in the lifetime of the container.\n\t */\n\tlifetimeDataStoreCount: number;\n\t/**\n\t * The number of attachment blobs in the lifetime of the container.\n\t */\n\tlifetimeAttachmentBlobCount: number;\n\t/**\n\t * The number of deleted nodes in the container.\n\t */\n\tdeletedNodeCount: number;\n\t/**\n\t * The number of deleted data stores in the container.\n\t */\n\tdeletedDataStoreCount: number;\n\t/**\n\t * The number of deleted attachment blobs in the container.\n\t */\n\tdeletedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection run.\n * @internal\n */\nexport interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}\n\n/**\n * The types of GC nodes in the GC reference graph.\n * @internal\n */\nexport const GCNodeType = {\n\t// Nodes that are for data stores.\n\tDataStore: \"DataStore\",\n\t// Nodes that are within a data store. For example, DDS nodes.\n\tSubDataStore: \"SubDataStore\",\n\t// Nodes that are for attachment blobs, i.e., blobs uploaded via BlobManager.\n\tBlob: \"Blob\",\n\t// Nodes that are neither of the above. For example, root node.\n\tOther: \"Other\",\n} as const;\n\n/**\n * @internal\n */\nexport type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];\n\n/**\n * The type of a garbage collection message.\n * @internal\n */\nexport const GarbageCollectionMessageType = {\n\t/**\n\t * Message sent directing GC to delete the given nodes\n\t */\n\tSweep: \"Sweep\",\n\t/**\n\t * Message sent notifying GC that a Tombstoned object was Loaded\n\t */\n\tTombstoneLoaded: \"TombstoneLoaded\",\n} as const;\n\n/**\n * @internal\n */\nexport type GarbageCollectionMessageType =\n\t(typeof GarbageCollectionMessageType)[keyof typeof GarbageCollectionMessageType];\n\n/**\n * The garbage collection sweep message.\n * @internal\n */\nexport interface ISweepMessage {\n\t/**\n\t * @see GarbageCollectionMessageType.Sweep\n\t */\n\ttype: typeof GarbageCollectionMessageType.Sweep;\n\t/**\n\t * The ids of nodes that are deleted.\n\t */\n\tdeletedNodeIds: string[];\n}\n\n/**\n * The GC TombstoneLoaded message.\n * @internal\n */\nexport interface ITombstoneLoadedMessage {\n\t/**\n\t * @see GarbageCollectionMessageType.TombstoneLoaded\n\t */\n\ttype: typeof GarbageCollectionMessageType.TombstoneLoaded;\n\t/**\n\t * The id of Tombstoned node that was loaded.\n\t */\n\tnodePath: string;\n}\n\n/**\n * Type for a message to be used for sending / received garbage collection messages.\n * @internal\n */\nexport type GarbageCollectionMessage = ISweepMessage | ITombstoneLoadedMessage;\n\n/**\n * Defines the APIs for the runtime object to be passed to the garbage collector.\n *\n * @internal\n */\nexport interface IGarbageCollectionRuntime {\n\t/**\n\t * Returns the garbage collection data of the runtime.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\t/**\n\t * After GC has run, called to notify the runtime of routes that are used in it.\n\t */\n\tupdateUsedRoutes(usedRoutes: readonly string[]): void;\n\t/**\n\t * After GC has run and identified nodes that are sweep ready, called to delete the sweep ready nodes. The runtime\n\t * should return the routes of nodes that were deleted.\n\t * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.\n\t */\n\tdeleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[];\n\t/**\n\t * Called to notify the runtime of routes that are tombstones.\n\t */\n\tupdateTombstonedRoutes(tombstoneRoutes: readonly string[]): void;\n\t/**\n\t * Returns a referenced timestamp to be used to track unreferenced nodes.\n\t */\n\tgetCurrentReferenceTimestampMs(): number | undefined;\n\t/**\n\t * Returns the type of the GC node.\n\t */\n\tgetNodeType(nodePath: string): GCNodeType;\n\t/**\n\t * Called when the runtime should close because of an error.\n\t */\n\tcloseFn: (error?: ICriticalContainerError) => void;\n}\n\n/**\n * Defines the contract for the garbage collector.\n */\nexport interface IGarbageCollector {\n\t/**\n\t * Tells the time at which session expiry timer started in a previous container.\n\t * This is only set when loading from a stashed container and will be equal to the\n\t * original container's local client time when it was loaded (and started the session expiry timer).\n\t */\n\treadonly sessionExpiryTimerStarted: number | undefined;\n\t/**\n\t * Tells whether GC should run or not.\n\t */\n\treadonly shouldRunGC: boolean;\n\t/**\n\t * The count of data stores whose GC state updated since the last summary.\n\t */\n\treadonly updatedDSCountSinceLastSummary: number;\n\t/**\n\t * Initialize the state from the base snapshot after its creation.\n\t */\n\tinitializeBaseState(): Promise<void>;\n\t/**\n\t * Run garbage collection and update the reference / used state of the system.\n\t */\n\tcollectGarbage(\n\t\toptions: {\n\t\t\tlogger?: ITelemetryLoggerExt;\n\t\t\trunSweep?: boolean;\n\t\t\tfullGC?: boolean;\n\t\t},\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<IGCStats | undefined>;\n\t/**\n\t * Summarizes the GC data and returns it as a summary tree.\n\t */\n\tsummarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummarizeResult | undefined;\n\t/**\n\t * Returns the garbage collector specific metadata to be written into the summary.\n\t */\n\tgetMetadata(): IGCMetadata;\n\t/**\n\t * Returns the GC details generated from the base snapshot.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\t/**\n\t * Called when the latest summary of the system has been refreshed.\n\t */\n\trefreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;\n\t/**\n\t * Called when a node with the given path is updated. If the node is inactive or tombstoned, this will log an error\n\t * or throw an error if failing on incorrect usage is configured.\n\t */\n\tnodeUpdated(props: IGCNodeUpdatedProps): void;\n\t/**\n\t * Called when a reference is added to a node. Used to identify nodes that were referenced between summaries.\n\t */\n\taddedOutboundReference(\n\t\tfromNodePath: string,\n\t\ttoNodePath: string,\n\t\ttimestampMs: number,\n\t\tautorecovery?: true,\n\t): void;\n\t/**\n\t * Called to process garbage collection messages\n\t */\n\tprocessMessages(\n\t\tmessageContents: GarbageCollectionMessage[],\n\t\tmessageTimestampMs: number,\n\t\tlocal: boolean,\n\t): void;\n\t/**\n\t * Returns true if this node has been deleted by GC during sweep phase.\n\t */\n\tisNodeDeleted(nodePath: string): boolean;\n\tsetConnectionState(connected: boolean, clientId?: string): void;\n\tdispose(): void;\n}\n\n/**\n * Info needed by GC when notified that a node was updated (loaded or changed)\n * @internal\n */\nexport interface IGCNodeUpdatedProps {\n\t/**\n\t * Type and path of the updated node\n\t */\n\tnode: { type: (typeof GCNodeType)[\"DataStore\" | \"Blob\"]; path: string };\n\t/**\n\t * Whether the node (or a subpath) was loaded or changed.\n\t */\n\treason: \"Loaded\" | \"Changed\" | \"Realized\";\n\t/**\n\t * The op-based timestamp when the node changed. If the update is from receiving an op, this should\n\t * be the timestamp of the op. If not, this should be the timestamp of the last op processed.\n\t */\n\ttimestampMs: number | undefined;\n\t/**\n\t * The package path of the node. This may not be available if the node hasn't been loaded yet\n\t */\n\tpackagePath?: readonly string[];\n\t/**\n\t * The original request for loads to preserve it in telemetry\n\t */\n\trequest?: IRequest;\n\t/**\n\t * If the node was loaded via request path, the header data. May be modified from the original request\n\t */\n\theaderData?: RuntimeHeaderData;\n\t/**\n\t * Any other properties to be logged.\n\t */\n\tadditionalProps?: ITelemetryPropertiesExt;\n}\n\n/**\n * Parameters necessary for creating a GarbageCollector.\n */\nexport interface IGarbageCollectorCreateParams {\n\treadonly runtime: IGarbageCollectionRuntime;\n\treadonly gcOptions: IGCRuntimeOptions;\n\treadonly baseLogger: ITelemetryLoggerExt;\n\treadonly existing: boolean;\n\n\treadonly metadata: IContainerRuntimeMetadata | undefined;\n\n\treadonly createContainerMetadata: ICreateContainerMetadata;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly isSummarizerClient: boolean;\n\treadonly getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>;\n\treadonly getLastSummaryTimestampMs: () => number | undefined;\n\treadonly readAndParseBlob: ReadAndParseBlob;\n\treadonly submitMessage: (message: ContainerRuntimeGCMessage) => void;\n\treadonly sessionExpiryTimerStarted?: number | undefined;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IGCRuntimeOptions {\n\t/**\n\t * Flag that if true, will enable the full Sweep Phase of garbage collection for this session,\n\t * where Tombstoned objects are permanently deleted from the container.\n\t *\n\t * IMPORTANT: This only applies if this document is allowed to run Sweep Phase.\n\t *\n\t * Current default behavior is for Sweep Phase not to delete Tombstoned objects,\n\t * but merely to prevent them from being loaded.\n\t */\n\tenableGCSweep?: true;\n\n\t/**\n\t * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node\n\t * changed or not.\n\t */\n\trunFullGC?: boolean;\n\n\t/**\n\t * Maximum session duration for a new container. If not present, a default value will be used.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tsessionExpiryTimeoutMs?: number;\n\n\t/**\n\t * Delay between when Tombstone should run and when the object should be deleted.\n\t * This grace period gives a chance to intervene to recover if needed, before Sweep deletes the object.\n\t * If not present, a default (non-zero) value will be used.\n\t */\n\tsweepGracePeriodMs?: number;\n\n\t/**\n\t * Allows additional GC options to be passed.\n\t */\n\t// TODO: Use unknown (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key: string]: any;\n}\n\n/**\n * The configurations for Garbage Collector that determines what runs and how.\n */\nexport interface IGarbageCollectorConfigs {\n\t/**\n\t * Tracks if GC is allowed for this document. GC may not be allowed for old documents created pre-GC.\n\t * If GC is allowed for a document, it will always be enabled. It cannot be disabled per session.\n\t */\n\treadonly gcAllowed: boolean;\n\t/**\n\t * Tracks whether sweep phase is allowed for this document. Sweep can be disabled per session via the sweepEnabled\n\t * flag defined below.\n\t */\n\treadonly sweepAllowed: boolean;\n\t/**\n\t * Tracks if sweep phase is enabled to run in this session or not\n\t */\n\treadonly sweepEnabled: boolean;\n\t/**\n\t * If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.\n\t */\n\treadonly runFullGC: boolean | undefined;\n\t/**\n\t * The time in ms to expire a session for a client for gc.\n\t */\n\treadonly sessionExpiryTimeoutMs: number | undefined;\n\t/**\n\t * The time after which an unreferenced node can be Tombstoned - i.e. GC knows it can't be referenced again (revived).\n\t */\n\treadonly tombstoneTimeoutMs: number | undefined;\n\t/**\n\t * The delay between tombstone and sweep. Not persisted, so concurrent sessions may use different values.\n\t * Sweep is implemented in an eventually-consistent way so this is acceptable.\n\t */\n\treadonly sweepGracePeriodMs: number;\n\t/**\n\t * The time after which an unreferenced node is inactive.\n\t */\n\treadonly inactiveTimeoutMs: number;\n\t/**\n\t * Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately.\n\t */\n\treadonly testMode: boolean;\n\t/**\n\t * @see GCFeatureMatrix.\n\t */\n\treadonly persistedGcFeatureMatrix: GCFeatureMatrix | undefined;\n\t/**\n\t * The version of GC in the base snapshot.\n\t */\n\treadonly gcVersionInBaseSnapshot: GCVersion | undefined;\n\t/**\n\t * The current version of GC data in the running code\n\t */\n\treadonly gcVersionInEffect: GCVersion;\n\t/**\n\t * If true, throw an error when a tombstone data store is retrieved\n\t */\n\treadonly throwOnTombstoneLoad: boolean;\n}\n\n/**\n * The state of node that is unreferenced.\n */\nexport const UnreferencedState = {\n\t/**\n\t * The node is active, i.e., it can become referenced again.\n\t */\n\tActive: \"Active\",\n\t/**\n\t * The node is inactive, i.e., it should not become referenced.\n\t */\n\tInactive: \"Inactive\",\n\t/**\n\t * The node is ready to be tombstoned\n\t */\n\tTombstoneReady: \"TombstoneReady\",\n\t/**\n\t * The node is ready to be deleted by the sweep phase.\n\t */\n\tSweepReady: \"SweepReady\",\n} as const;\nexport type UnreferencedState = (typeof UnreferencedState)[keyof typeof UnreferencedState];\n\n/**\n * Represents the result of a GC run.\n */\nexport interface IGCResult {\n\t/**\n\t * The ids of nodes that are referenced in the referenced graph\n\t */\n\treferencedNodeIds: string[];\n\t/**\n\t * The ids of nodes that are not-referenced or deleted in the referenced graph\n\t */\n\tdeletedNodeIds: string[];\n}\n"]}
1
+ {"version":3,"file":"gcDefinitions.js","sourceRoot":"","sources":["../../src/gc/gcDefinitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8BH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAc,CAAC,CAAC;AAC5C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAc,CAAC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAClE;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,0CAA0C,CAAC;AAC9E;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAC1C,qDAAqD,CAAC;AACvD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8CAA8C,CAAC;AAEtF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,QAAQ,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,SAAS;AAC/D,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC,UAAU;AACvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,QAAQ;AA0K/D;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,kCAAkC;IAClC,SAAS,EAAE,WAAW;IACtB,8DAA8D;IAC9D,YAAY,EAAE,cAAc;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM;IACZ,+DAA+D;IAC/D,KAAK,EAAE,OAAO;CACL,CAAC;AAOX;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,eAAe,EAAE,iBAAiB;CACzB,CAAC;AAuUX;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;IACH,QAAQ,EAAE,UAAU;IACpB;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAChC;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tITelemetryContext,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeResult,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { ReadAndParseBlob } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\ttype ITelemetryPropertiesExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { RuntimeHeaderData } from \"../containerRuntime.js\";\nimport { ContainerRuntimeGCMessage } from \"../messageTypes.js\";\nimport {\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIRefreshSummaryResult,\n} from \"../summary/index.js\";\n\n/**\n * @internal\n */\nexport type GCVersion = number;\n\n/**\n * The stable/default version of GC Data\n */\nexport const stableGCVersion: GCVersion = 3;\n/**\n * The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files.\n */\nexport const nextGCVersion: GCVersion = 4;\n\n/**\n * This undocumented GC Option (on ContainerRuntime Options) allows configuring which documents can have Sweep enabled.\n * This provides a way to disable both Tombstone Enforcement and Sweep.\n *\n * If unset, Tombstone Enforcement + Sweep will operate as otherwise configured.\n * Otherwise, the Sweep Phase will be disabled for documents where persisted value doesn't match what is passed into this session.\n * This provides a way to disallow Sweep for old documents that may be too difficult for an app to repair,\n * in case a bug is found that violates GC's assumptions.\n *\n * @see GCFeatureMatrix (gcGeneration)\n */\nexport const gcGenerationOptionName = \"gcGeneration\";\n\n/**\n * Config key to turn GC test mode on / off.\n */\nexport const gcTestModeKey = \"Fluid.GarbageCollection.GCTestMode\";\n/**\n * Config key to expire a session after a set period of time. Defaults to true.\n */\nexport const runSessionExpiryKey = \"Fluid.GarbageCollection.RunSessionExpiry\";\n/**\n * Config key to disable throwing an error when tombstone object is loaded (requested).\n */\nexport const disableThrowOnTombstoneLoadKey =\n\t\"Fluid.GarbageCollection.DisableThrowOnTombstoneLoad\";\n/**\n * Config key to enable GC version upgrade.\n */\nexport const gcVersionUpgradeToV4Key = \"Fluid.GarbageCollection.GCVersionUpgradeToV4\";\n\n// One day in milliseconds.\nexport const oneDayMs = 1 * 24 * 60 * 60 * 1000;\n\n/**\n * The maximum snapshot cache expiry in the driver. This is used to calculate the tombstone timeout.\n * Tombstone timeout = session expiry timeout + snapshot cache expiry timeout + a buffer.\n * The snapshot cache expiry timeout cannot be known precisely but the upper bound is 5 days, i.e., any snapshot\n * in cache will be invalidated before 5 days.\n */\nexport const maxSnapshotCacheExpiryMs = 5 * oneDayMs;\n\nexport const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days\nexport const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days\nexport const defaultSweepGracePeriodMs = 1 * oneDayMs; // 1 day\n\n/**\n * @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName\n * @internal\n */\nexport type GCFeatureMatrix =\n\t| {\n\t\t\t/**\n\t\t\t * The GC Generation value in effect when this file was created.\n\t\t\t * Gives a way for an app to disqualify old files from GC Sweep.\n\t\t\t * Provided via Container Runtime Options.\n\t\t\t */\n\t\t\tgcGeneration?: number;\n\t\t\t/**\n\t\t\t * Deprecated property from legacy type. Will not be set concurrently with gcGeneration\n\t\t\t */\n\t\t\ttombstoneGeneration?: undefined;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Tombstone Generation value in effect when this file was created.\n\t\t\t * Legacy - new containers would get gcGeneration instead (if anything)\n\t\t\t */\n\t\t\ttombstoneGeneration: number;\n\t };\n\n/**\n * Deprecated properties formerly included in @see IGCMetadata.\n * These may be found in old snapshots, so we need to support them for backwards compatibility.\n */\nexport interface IGCMetadata_Deprecated {\n\t/**\n\t * How long to wait after an object is unreferenced before deleting it via GC Sweep\n\t *\n\t * @deprecated Replaced by @see IGCMetadata.tombstoneTimeoutMs\n\t */\n\treadonly sweepTimeoutMs?: number;\n}\n\n/**\n * GC-specific metadata to be written into the summary.\n *\n * @internal\n */\nexport interface IGCMetadata {\n\t/**\n\t * The version of the GC code that was run to generate the GC data that is written in the summary.\n\t * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.\n\t * Also, used to determine whether GC is enabled for this container or not:\n\t * - A value of 0 or undefined means GC is disabled.\n\t * - A value greater than 0 means GC is enabled.\n\t */\n\treadonly gcFeature?: GCVersion;\n\n\t/**\n\t * A collection of different numerical \"Generations\" for different features,\n\t * used to determine feature availability over time.\n\t * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),\n\t * and pertains to aspects of the document that may be fixed for its lifetime.\n\t *\n\t * For each dimension, if the persisted value doesn't match the currently provided value,\n\t * then this file does not support the corresponding feature as currently implemented.\n\t *\n\t * Guidance is that if no value is provided at runtime, it should result in the current default behavior.\n\t */\n\treadonly gcFeatureMatrix?: GCFeatureMatrix;\n\t/**\n\t * Tells whether the GC sweep phase is enabled for this container.\n\t * - True means sweep phase is enabled.\n\t * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n\t *\n\t * @deprecated use GCFeatureMatrix.gcGeneration instead. @see GCFeatureMatrix.gcGeneration\n\t */\n\treadonly sweepEnabled?: boolean;\n\t/**\n\t * If this is present, the session for this container will expire after this time and the container will close\n\t */\n\treadonly sessionExpiryTimeoutMs?: number;\n\t/**\n\t * How long to wait after an object is unreferenced before it becomes a Tombstone.\n\t *\n\t * After this point, there's a grace period before the object is deleted.\n\t * @see IGCRuntimeOptions.sweepGracePeriodMs\n\t *\n\t * So the full sweep timeout in a session is tombstoneTimeoutMs + sweepGracePeriodMs.\n\t */\n\treadonly tombstoneTimeoutMs?: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection mark phase run.\n * @internal\n */\nexport interface IMarkPhaseStats {\n\t/**\n\t * The number of nodes in the container.\n\t */\n\tnodeCount: number;\n\t/**\n\t * The number of data stores in the container.\n\t */\n\tdataStoreCount: number;\n\t/**\n\t * The number of attachment blobs in the container.\n\t */\n\tattachmentBlobCount: number;\n\t/**\n\t * The number of unreferenced nodes in the container.\n\t */\n\tunrefNodeCount: number;\n\t/**\n\t * The number of unreferenced data stores in the container.\n\t */\n\tunrefDataStoreCount: number;\n\t/**\n\t * The number of unreferenced attachment blobs in the container.\n\t */\n\tunrefAttachmentBlobCount: number;\n\t/**\n\t * The number of nodes whose reference state updated since last GC run.\n\t */\n\tupdatedNodeCount: number;\n\t/**\n\t * The number of data stores whose reference state updated since last GC run.\n\t */\n\tupdatedDataStoreCount: number;\n\t/**\n\t * The number of attachment blobs whose reference state updated since last GC run.\n\t */\n\tupdatedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection sweep phase run.\n * @internal\n */\nexport interface ISweepPhaseStats {\n\t/**\n\t * The number of nodes in the lifetime of the container.\n\t */\n\tlifetimeNodeCount: number;\n\t/**\n\t * The number of data stores in the lifetime of the container.\n\t */\n\tlifetimeDataStoreCount: number;\n\t/**\n\t * The number of attachment blobs in the lifetime of the container.\n\t */\n\tlifetimeAttachmentBlobCount: number;\n\t/**\n\t * The number of deleted nodes in the container.\n\t */\n\tdeletedNodeCount: number;\n\t/**\n\t * The number of deleted data stores in the container.\n\t */\n\tdeletedDataStoreCount: number;\n\t/**\n\t * The number of deleted attachment blobs in the container.\n\t */\n\tdeletedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection run.\n * @internal\n */\nexport interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}\n\n/**\n * The types of GC nodes in the GC reference graph.\n * @internal\n */\nexport const GCNodeType = {\n\t// Nodes that are for data stores.\n\tDataStore: \"DataStore\",\n\t// Nodes that are within a data store. For example, DDS nodes.\n\tSubDataStore: \"SubDataStore\",\n\t// Nodes that are for attachment blobs, i.e., blobs uploaded via BlobManager.\n\tBlob: \"Blob\",\n\t// Nodes that are neither of the above. For example, root node.\n\tOther: \"Other\",\n} as const;\n\n/**\n * @internal\n */\nexport type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];\n\n/**\n * The type of a garbage collection message.\n * @internal\n */\nexport const GarbageCollectionMessageType = {\n\t/**\n\t * Message sent directing GC to delete the given nodes\n\t */\n\tSweep: \"Sweep\",\n\t/**\n\t * Message sent notifying GC that a Tombstoned object was Loaded\n\t */\n\tTombstoneLoaded: \"TombstoneLoaded\",\n} as const;\n\n/**\n * @internal\n */\nexport type GarbageCollectionMessageType =\n\t(typeof GarbageCollectionMessageType)[keyof typeof GarbageCollectionMessageType];\n\n/**\n * The garbage collection sweep message.\n * @internal\n */\nexport interface ISweepMessage {\n\t/**\n\t * @see GarbageCollectionMessageType.Sweep\n\t */\n\ttype: typeof GarbageCollectionMessageType.Sweep;\n\t/**\n\t * The ids of nodes that are deleted.\n\t */\n\tdeletedNodeIds: string[];\n}\n\n/**\n * The GC TombstoneLoaded message.\n * @internal\n */\nexport interface ITombstoneLoadedMessage {\n\t/**\n\t * @see GarbageCollectionMessageType.TombstoneLoaded\n\t */\n\ttype: typeof GarbageCollectionMessageType.TombstoneLoaded;\n\t/**\n\t * The id of Tombstoned node that was loaded.\n\t */\n\tnodePath: string;\n}\n\n/**\n * Type for a message to be used for sending / received garbage collection messages.\n * @internal\n */\nexport type GarbageCollectionMessage = ISweepMessage | ITombstoneLoadedMessage;\n\n/**\n * Defines the APIs for the runtime object to be passed to the garbage collector.\n *\n * @internal\n */\nexport interface IGarbageCollectionRuntime {\n\t/**\n\t * Returns the garbage collection data of the runtime.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\t/**\n\t * After GC has run, called to notify the runtime of routes that are used in it.\n\t */\n\tupdateUsedRoutes(usedRoutes: readonly string[]): void;\n\t/**\n\t * After GC has run and identified nodes that are sweep ready, called to delete the sweep ready nodes. The runtime\n\t * should return the routes of nodes that were deleted.\n\t * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.\n\t */\n\tdeleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[];\n\t/**\n\t * Called to notify the runtime of routes that are tombstones.\n\t */\n\tupdateTombstonedRoutes(tombstoneRoutes: readonly string[]): void;\n\t/**\n\t * Returns a referenced timestamp to be used to track unreferenced nodes.\n\t */\n\tgetCurrentReferenceTimestampMs(): number | undefined;\n\t/**\n\t * Returns the type of the GC node.\n\t */\n\tgetNodeType(nodePath: string): GCNodeType;\n\t/**\n\t * Called when the runtime should close because of an error.\n\t */\n\tcloseFn: (error?: ICriticalContainerError) => void;\n}\n\n/**\n * Defines the contract for the garbage collector.\n */\nexport interface IGarbageCollector {\n\t/**\n\t * Tells the time at which session expiry timer started in a previous container.\n\t * This is only set when loading from a stashed container and will be equal to the\n\t * original container's local client time when it was loaded (and started the session expiry timer).\n\t */\n\treadonly sessionExpiryTimerStarted: number | undefined;\n\t/**\n\t * Tells whether GC should run or not.\n\t */\n\treadonly shouldRunGC: boolean;\n\t/**\n\t * The count of data stores whose GC state updated since the last summary.\n\t */\n\treadonly updatedDSCountSinceLastSummary: number;\n\t/**\n\t * Initialize the state from the base snapshot after its creation.\n\t */\n\tinitializeBaseState(): Promise<void>;\n\t/**\n\t * Run garbage collection and update the reference / used state of the system.\n\t */\n\tcollectGarbage(\n\t\toptions: {\n\t\t\tlogger?: ITelemetryLoggerExt;\n\t\t\trunSweep?: boolean;\n\t\t\tfullGC?: boolean;\n\t\t},\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<IGCStats | undefined>;\n\t/**\n\t * Summarizes the GC data and returns it as a summary tree.\n\t */\n\tsummarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummarizeResult | undefined;\n\t/**\n\t * Returns the garbage collector specific metadata to be written into the summary.\n\t */\n\tgetMetadata(): IGCMetadata;\n\t/**\n\t * Returns the GC details generated from the base snapshot.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\t/**\n\t * Called when the latest summary of the system has been refreshed.\n\t */\n\trefreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;\n\t/**\n\t * Called when a node with the given path is updated. If the node is inactive or tombstoned, this will log an error\n\t * or throw an error if failing on incorrect usage is configured.\n\t */\n\tnodeUpdated(props: IGCNodeUpdatedProps): void;\n\t/**\n\t * Called when a reference is added to a node. Used to identify nodes that were referenced between summaries.\n\t */\n\taddedOutboundReference(\n\t\tfromNodePath: string,\n\t\ttoNodePath: string,\n\t\ttimestampMs: number,\n\t\tautorecovery?: true,\n\t): void;\n\t/**\n\t * Called to process garbage collection messages\n\t */\n\tprocessMessages(\n\t\tmessageContents: GarbageCollectionMessage[],\n\t\tmessageTimestampMs: number,\n\t\tlocal: boolean,\n\t): void;\n\t/**\n\t * Returns true if this node has been deleted by GC during sweep phase.\n\t */\n\tisNodeDeleted(nodePath: string): boolean;\n\tsetConnectionState(canSendOps: boolean, clientId?: string): void;\n\tdispose(): void;\n}\n\n/**\n * Info needed by GC when notified that a node was updated (loaded or changed)\n * @internal\n */\nexport interface IGCNodeUpdatedProps {\n\t/**\n\t * Type and path of the updated node\n\t */\n\tnode: { type: (typeof GCNodeType)[\"DataStore\" | \"Blob\"]; path: string };\n\t/**\n\t * Whether the node (or a subpath) was loaded or changed.\n\t */\n\treason: \"Loaded\" | \"Changed\" | \"Realized\";\n\t/**\n\t * The op-based timestamp when the node changed. If the update is from receiving an op, this should\n\t * be the timestamp of the op. If not, this should be the timestamp of the last op processed.\n\t */\n\ttimestampMs: number | undefined;\n\t/**\n\t * The package path of the node. This may not be available if the node hasn't been loaded yet\n\t */\n\tpackagePath?: readonly string[];\n\t/**\n\t * The original request for loads to preserve it in telemetry\n\t */\n\trequest?: IRequest;\n\t/**\n\t * If the node was loaded via request path, the header data. May be modified from the original request\n\t */\n\theaderData?: RuntimeHeaderData;\n\t/**\n\t * Any other properties to be logged.\n\t */\n\tadditionalProps?: ITelemetryPropertiesExt;\n}\n\n/**\n * Parameters necessary for creating a GarbageCollector.\n */\nexport interface IGarbageCollectorCreateParams {\n\treadonly runtime: IGarbageCollectionRuntime;\n\treadonly gcOptions: IGCRuntimeOptions;\n\treadonly baseLogger: ITelemetryLoggerExt;\n\treadonly existing: boolean;\n\n\treadonly metadata: IContainerRuntimeMetadata | undefined;\n\n\treadonly createContainerMetadata: ICreateContainerMetadata;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly isSummarizerClient: boolean;\n\treadonly getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>;\n\treadonly getLastSummaryTimestampMs: () => number | undefined;\n\treadonly readAndParseBlob: ReadAndParseBlob;\n\treadonly submitMessage: (message: ContainerRuntimeGCMessage) => void;\n\treadonly sessionExpiryTimerStarted?: number | undefined;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IGCRuntimeOptions {\n\t/**\n\t * Flag that if true, will enable the full Sweep Phase of garbage collection for this session,\n\t * where Tombstoned objects are permanently deleted from the container.\n\t *\n\t * IMPORTANT: This only applies if this document is allowed to run Sweep Phase.\n\t *\n\t * Current default behavior is for Sweep Phase not to delete Tombstoned objects,\n\t * but merely to prevent them from being loaded.\n\t */\n\tenableGCSweep?: true;\n\n\t/**\n\t * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node\n\t * changed or not.\n\t */\n\trunFullGC?: boolean;\n\n\t/**\n\t * Maximum session duration for a new container. If not present, a default value will be used.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tsessionExpiryTimeoutMs?: number;\n\n\t/**\n\t * Delay between when Tombstone should run and when the object should be deleted.\n\t * This grace period gives a chance to intervene to recover if needed, before Sweep deletes the object.\n\t * If not present, a default (non-zero) value will be used.\n\t */\n\tsweepGracePeriodMs?: number;\n\n\t/**\n\t * Allows additional GC options to be passed.\n\t */\n\t// TODO: Use unknown (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key: string]: any;\n}\n\n/**\n * The configurations for Garbage Collector that determines what runs and how.\n */\nexport interface IGarbageCollectorConfigs {\n\t/**\n\t * Tracks if GC is allowed for this document. GC may not be allowed for old documents created pre-GC.\n\t * If GC is allowed for a document, it will always be enabled. It cannot be disabled per session.\n\t */\n\treadonly gcAllowed: boolean;\n\t/**\n\t * Tracks whether sweep phase is allowed for this document. Sweep can be disabled per session via the sweepEnabled\n\t * flag defined below.\n\t */\n\treadonly sweepAllowed: boolean;\n\t/**\n\t * Tracks if sweep phase is enabled to run in this session or not\n\t */\n\treadonly sweepEnabled: boolean;\n\t/**\n\t * If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.\n\t */\n\treadonly runFullGC: boolean | undefined;\n\t/**\n\t * The time in ms to expire a session for a client for gc.\n\t */\n\treadonly sessionExpiryTimeoutMs: number | undefined;\n\t/**\n\t * The time after which an unreferenced node can be Tombstoned - i.e. GC knows it can't be referenced again (revived).\n\t */\n\treadonly tombstoneTimeoutMs: number | undefined;\n\t/**\n\t * The delay between tombstone and sweep. Not persisted, so concurrent sessions may use different values.\n\t * Sweep is implemented in an eventually-consistent way so this is acceptable.\n\t */\n\treadonly sweepGracePeriodMs: number;\n\t/**\n\t * The time after which an unreferenced node is inactive.\n\t */\n\treadonly inactiveTimeoutMs: number;\n\t/**\n\t * Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately.\n\t */\n\treadonly testMode: boolean;\n\t/**\n\t * @see GCFeatureMatrix.\n\t */\n\treadonly persistedGcFeatureMatrix: GCFeatureMatrix | undefined;\n\t/**\n\t * The version of GC in the base snapshot.\n\t */\n\treadonly gcVersionInBaseSnapshot: GCVersion | undefined;\n\t/**\n\t * The current version of GC data in the running code\n\t */\n\treadonly gcVersionInEffect: GCVersion;\n\t/**\n\t * If true, throw an error when a tombstone data store is retrieved\n\t */\n\treadonly throwOnTombstoneLoad: boolean;\n}\n\n/**\n * The state of node that is unreferenced.\n */\nexport const UnreferencedState = {\n\t/**\n\t * The node is active, i.e., it can become referenced again.\n\t */\n\tActive: \"Active\",\n\t/**\n\t * The node is inactive, i.e., it should not become referenced.\n\t */\n\tInactive: \"Inactive\",\n\t/**\n\t * The node is ready to be tombstoned\n\t */\n\tTombstoneReady: \"TombstoneReady\",\n\t/**\n\t * The node is ready to be deleted by the sweep phase.\n\t */\n\tSweepReady: \"SweepReady\",\n} as const;\nexport type UnreferencedState = (typeof UnreferencedState)[keyof typeof UnreferencedState];\n\n/**\n * Represents the result of a GC run.\n */\nexport interface IGCResult {\n\t/**\n\t * The ids of nodes that are referenced in the referenced graph\n\t */\n\treferencedNodeIds: string[];\n\t/**\n\t * The ids of nodes that are not-referenced or deleted in the referenced graph\n\t */\n\tdeletedNodeIds: string[];\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -11,6 +11,6 @@ export { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
11
11
  export { detectOutboundReferences, ChannelCollectionFactory, AllowTombstoneRequestHeaderKey, } from "./channelCollection.js";
12
12
  export type { MinimumVersionForCollab } from "./compatUtils.js";
13
13
  export { GCNodeType, IGCMetadata, GCFeatureMatrix, GCVersion, IGarbageCollectionRuntime, IGCRuntimeOptions, IMarkPhaseStats, ISweepPhaseStats, IGCNodeUpdatedProps, IGCStats, } from "./gc/index.js";
14
- export { IAckedSummary, ISummarizer, ISummarizeResults, ISummaryCancellationToken, neverCancelledSummaryToken, Summarizer, SummaryCollection, EnqueueSummarizeResult, IAckSummaryResult, IBaseSummarizeResult, IBroadcastSummaryResult, ICancellationToken, IConnectableRuntime, IContainerRuntimeMetadata, ICreateContainerMetadata, IEnqueueSummarizeOptions, IGenerateSummaryTreeResult, IGeneratedSummaryStats, INackSummaryResult, IOnDemandSummarizeOptions, IRefreshSummaryAckOptions, ISubmitSummaryOpResult, ISubmitSummaryOptions, ISerializedElection, ISummarizeOptions, ISummarizerInternalsProvider, ISummarizerRuntime, ISummarizingWarning, IUploadSummaryResult, SubmitSummaryResult, SummarizeResultPart, IClientSummaryWatcher, ISummary, ISummaryCollectionOpEvents, ISummaryAckMessage, ISummaryMetadataMessage, ISummaryNackMessage, ISummaryOpMessage, OpActionEventListener, OpActionEventName, ICancellableSummarizerController, SubmitSummaryFailureData, SummaryStage, IRetriableFailureError, IdCompressorMode, IDocumentSchema, DocumentSchemaValueType, IDocumentSchemaCurrent, currentDocumentVersionSchema, DocumentsSchemaController, IDocumentSchemaChangeMessage, IDocumentSchemaFeatures, ReadFluidDataStoreAttributes, IFluidDataStoreAttributes0, IFluidDataStoreAttributes1, IFluidDataStoreAttributes2, OmitAttributesVersions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, ISummaryConfiguration, DefaultSummaryConfiguration, } from "./summary/index.js";
14
+ export { IAckedSummary, ISummarizer, ISummarizeResults, ISummaryCancellationToken, neverCancelledSummaryToken, Summarizer, SummaryCollection, EnqueueSummarizeResult, IAckSummaryResult, IBaseSummarizeResult, IBroadcastSummaryResult, ICancellationToken, IConnectableRuntime, IContainerRuntimeMetadata, ICreateContainerMetadata, IEnqueueSummarizeOptions, IGenerateSummaryTreeResult, IGeneratedSummaryStats, INackSummaryResult, IOnDemandSummarizeOptions, IRefreshSummaryAckOptions, ISubmitSummaryOpResult, ISubmitSummaryOptions, ISerializedElection, ISummarizeOptions, ISummarizerInternalsProvider, ISummarizerRuntime, ISummarizingWarning, IUploadSummaryResult, SubmitSummaryResult, SummarizeResultPart, IClientSummaryWatcher, ISummary, ISummaryCollectionOpEvents, ISummaryAckMessage, ISummaryMetadataMessage, ISummaryNackMessage, ISummaryOpMessage, OpActionEventListener, OpActionEventName, ICancellableSummarizerController, SubmitSummaryFailureData, SummaryStage, IRetriableFailureError, IdCompressorMode, IDocumentSchema, DocumentSchemaValueType, IDocumentSchemaCurrent, currentDocumentVersionSchema, DocumentsSchemaController, IDocumentSchemaChangeMessageIncoming, IDocumentSchemaChangeMessageOutgoing, IDocumentSchemaFeatures, ReadFluidDataStoreAttributes, IFluidDataStoreAttributes0, IFluidDataStoreAttributes1, IFluidDataStoreAttributes2, OmitAttributesVersions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, ISummaryConfiguration, DefaultSummaryConfiguration, } from "./summary/index.js";
15
15
  export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle/index.js";
16
16
  //# 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,EACN,uBAAuB,EACvB,+BAA+B,EAC/B,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EACN,oBAAoB,EACpB,8BAA8B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBA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,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,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,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,oCAAoC,EACpC,oCAAoC,EACpC,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,qBAAqB,EACrB,2BAA2B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAMN,oBAAoB,EAEpB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,GAEzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EACN,oBAAoB,GAEpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACN,wBAAwB,EACxB,wBAAwB,EACxB,8BAA8B,GAC9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,UAAU,GAUV,MAAM,eAAe,CAAC;AACvB,OAAO,EAKN,0BAA0B,EAC1B,UAAU,EACV,iBAAiB,EA0CjB,4BAA4B,EAC5B,yBAAyB,EAazB,2BAA2B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAc,oBAAoB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tContainerRuntimeOptions,\n\tContainerRuntimeOptionsInternal,\n\tISummaryRuntimeOptions,\n\tIContainerRuntimeOptions,\n\tIContainerRuntimeOptionsInternal,\n\tloadContainerRuntime,\n\tLoadContainerRuntimeParams,\n\tagentSchedulerId,\n\tContainerRuntime,\n\tDeletedResponseHeaderKey,\n\tTombstoneResponseHeaderKey,\n\tInactiveResponseHeaderKey,\n\tRuntimeHeaderData,\n} from \"./containerRuntime.js\";\nexport type { ICompressionRuntimeOptions } from \"./compressionDefinitions.js\";\nexport { CompressionAlgorithms, disabledCompressionConfig } from \"./compressionDefinitions.js\";\nexport {\n\tContainerMessageType,\n\tUnknownContainerRuntimeMessage,\n} from \"./messageTypes.js\";\nexport { IBlobManagerLoadInfo } from \"./blobManager/index.js\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport {\n\tdetectOutboundReferences,\n\tChannelCollectionFactory,\n\tAllowTombstoneRequestHeaderKey,\n} from \"./channelCollection.js\";\nexport type { MinimumVersionForCollab } from \"./compatUtils.js\";\nexport {\n\tGCNodeType,\n\tIGCMetadata,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tIGarbageCollectionRuntime,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCNodeUpdatedProps,\n\tIGCStats,\n} from \"./gc/index.js\";\nexport {\n\tIAckedSummary,\n\tISummarizer,\n\tISummarizeResults,\n\tISummaryCancellationToken,\n\tneverCancelledSummaryToken,\n\tSummarizer,\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\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\tIRetriableFailureError,\n\tIdCompressorMode,\n\tIDocumentSchema,\n\tDocumentSchemaValueType,\n\tIDocumentSchemaCurrent,\n\tcurrentDocumentVersionSchema,\n\tDocumentsSchemaController,\n\tIDocumentSchemaChangeMessage,\n\tIDocumentSchemaFeatures,\n\tReadFluidDataStoreAttributes,\n\tIFluidDataStoreAttributes0,\n\tIFluidDataStoreAttributes1,\n\tIFluidDataStoreAttributes2,\n\tOmitAttributesVersions,\n\tISummaryBaseConfiguration,\n\tISummaryConfigurationHeuristics,\n\tISummaryConfigurationDisableSummarizer,\n\tISummaryConfigurationDisableHeuristics,\n\tISummaryConfiguration,\n\tDefaultSummaryConfiguration,\n} from \"./summary/index.js\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAMN,oBAAoB,EAEpB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,GAEzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EACN,oBAAoB,GAEpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACN,wBAAwB,EACxB,wBAAwB,EACxB,8BAA8B,GAC9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,UAAU,GAUV,MAAM,eAAe,CAAC;AACvB,OAAO,EAKN,0BAA0B,EAC1B,UAAU,EACV,iBAAiB,EA0CjB,4BAA4B,EAC5B,yBAAyB,EAczB,2BAA2B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAc,oBAAoB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tContainerRuntimeOptions,\n\tContainerRuntimeOptionsInternal,\n\tISummaryRuntimeOptions,\n\tIContainerRuntimeOptions,\n\tIContainerRuntimeOptionsInternal,\n\tloadContainerRuntime,\n\tLoadContainerRuntimeParams,\n\tagentSchedulerId,\n\tContainerRuntime,\n\tDeletedResponseHeaderKey,\n\tTombstoneResponseHeaderKey,\n\tInactiveResponseHeaderKey,\n\tRuntimeHeaderData,\n} from \"./containerRuntime.js\";\nexport type { ICompressionRuntimeOptions } from \"./compressionDefinitions.js\";\nexport { CompressionAlgorithms, disabledCompressionConfig } from \"./compressionDefinitions.js\";\nexport {\n\tContainerMessageType,\n\tUnknownContainerRuntimeMessage,\n} from \"./messageTypes.js\";\nexport { IBlobManagerLoadInfo } from \"./blobManager/index.js\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport {\n\tdetectOutboundReferences,\n\tChannelCollectionFactory,\n\tAllowTombstoneRequestHeaderKey,\n} from \"./channelCollection.js\";\nexport type { MinimumVersionForCollab } from \"./compatUtils.js\";\nexport {\n\tGCNodeType,\n\tIGCMetadata,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tIGarbageCollectionRuntime,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCNodeUpdatedProps,\n\tIGCStats,\n} from \"./gc/index.js\";\nexport {\n\tIAckedSummary,\n\tISummarizer,\n\tISummarizeResults,\n\tISummaryCancellationToken,\n\tneverCancelledSummaryToken,\n\tSummarizer,\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\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\tIRetriableFailureError,\n\tIdCompressorMode,\n\tIDocumentSchema,\n\tDocumentSchemaValueType,\n\tIDocumentSchemaCurrent,\n\tcurrentDocumentVersionSchema,\n\tDocumentsSchemaController,\n\tIDocumentSchemaChangeMessageIncoming,\n\tIDocumentSchemaChangeMessageOutgoing,\n\tIDocumentSchemaFeatures,\n\tReadFluidDataStoreAttributes,\n\tIFluidDataStoreAttributes0,\n\tIFluidDataStoreAttributes1,\n\tIFluidDataStoreAttributes2,\n\tOmitAttributesVersions,\n\tISummaryBaseConfiguration,\n\tISummaryConfigurationHeuristics,\n\tISummaryConfigurationDisableSummarizer,\n\tISummaryConfigurationDisableHeuristics,\n\tISummaryConfiguration,\n\tDefaultSummaryConfiguration,\n} from \"./summary/index.js\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle/index.js\";\n"]}
@@ -8,7 +8,7 @@ import { IAttachMessage, IEnvelope, InboundAttachMessage } from "@fluidframework
8
8
  import { IDataStoreAliasMessage } from "./dataStore.js";
9
9
  import { GarbageCollectionMessage } from "./gc/index.js";
10
10
  import { IChunkedOp } from "./opLifecycle/index.js";
11
- import { IDocumentSchemaChangeMessage } from "./summary/index.js";
11
+ import { type IDocumentSchemaChangeMessageIncoming, type IDocumentSchemaChangeMessageOutgoing } from "./summary/index.js";
12
12
  /**
13
13
  * @legacy
14
14
  * @alpha
@@ -62,7 +62,8 @@ export type ContainerRuntimeRejoinMessage = TypedContainerRuntimeMessage<Contain
62
62
  export type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage<ContainerMessageType.Alias, IDataStoreAliasMessage>;
63
63
  export type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<ContainerMessageType.IdAllocation, IdCreationRange>;
64
64
  export type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<ContainerMessageType.GC, GarbageCollectionMessage>;
65
- export type ContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<ContainerMessageType.DocumentSchemaChange, IDocumentSchemaChangeMessage>;
65
+ export type InboundContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<ContainerMessageType.DocumentSchemaChange, IDocumentSchemaChangeMessageIncoming>;
66
+ export type OutboundContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<ContainerMessageType.DocumentSchemaChange, IDocumentSchemaChangeMessageOutgoing>;
66
67
  /**
67
68
  * Represents an unrecognized TypedContainerRuntimeMessage, e.g. a message from a future version of the container runtime.
68
69
  * @internal
@@ -82,12 +83,12 @@ export interface UnknownContainerRuntimeMessage {
82
83
  /**
83
84
  * A {@link TypedContainerRuntimeMessage} that is received from the server and will be processed by the container runtime.
84
85
  */
85
- export type InboundContainerRuntimeMessage = ContainerRuntimeDataStoreOpMessage | InboundContainerRuntimeAttachMessage | ContainerRuntimeChunkedOpMessage | ContainerRuntimeBlobAttachMessage | ContainerRuntimeRejoinMessage | ContainerRuntimeAliasMessage | ContainerRuntimeIdAllocationMessage | ContainerRuntimeGCMessage | ContainerRuntimeDocumentSchemaMessage | UnknownContainerRuntimeMessage;
86
+ export type InboundContainerRuntimeMessage = ContainerRuntimeDataStoreOpMessage | InboundContainerRuntimeAttachMessage | ContainerRuntimeChunkedOpMessage | ContainerRuntimeBlobAttachMessage | ContainerRuntimeRejoinMessage | ContainerRuntimeAliasMessage | ContainerRuntimeIdAllocationMessage | ContainerRuntimeGCMessage | InboundContainerRuntimeDocumentSchemaMessage | UnknownContainerRuntimeMessage;
86
87
  /**
87
88
  * A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime, eventually to be sent to the ordering service.
88
89
  * These are messages generated by the local runtime, before the outbox's op virtualization step.
89
90
  */
90
- export type LocalContainerRuntimeMessage = ContainerRuntimeDataStoreOpMessage | OutboundContainerRuntimeAttachMessage | ContainerRuntimeBlobAttachMessage | ContainerRuntimeRejoinMessage | ContainerRuntimeAliasMessage | ContainerRuntimeIdAllocationMessage | ContainerRuntimeGCMessage | ContainerRuntimeDocumentSchemaMessage | UnknownContainerRuntimeMessage;
91
+ export type LocalContainerRuntimeMessage = ContainerRuntimeDataStoreOpMessage | OutboundContainerRuntimeAttachMessage | ContainerRuntimeBlobAttachMessage | ContainerRuntimeRejoinMessage | ContainerRuntimeAliasMessage | ContainerRuntimeIdAllocationMessage | ContainerRuntimeGCMessage | OutboundContainerRuntimeDocumentSchemaMessage | UnknownContainerRuntimeMessage;
91
92
  /**
92
93
  * An unpacked ISequencedDocumentMessage with the inner TypedContainerRuntimeMessage type/contents/etc
93
94
  * promoted up to the outer object
@@ -1 +1 @@
1
- {"version":3,"file":"messageTypes.d.ts","sourceRoot":"","sources":["../src/messageTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EACN,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAElE;;;GAGG;AACH,oBAAY,oBAAoB;IAE/B,gBAAgB,cAAc;IAG9B,MAAM,WAAW;IAGjB,SAAS,cAAc;IAGvB,UAAU,eAAe;IAGzB,MAAM,WAAW;IAGjB,KAAK,UAAU;IAEf;;;;OAIG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,oBAAoB,WAAW;IAE/B;;;OAGG;IACH,EAAE,OAAO;CACT;AAED;;;;;;GAMG;AACH,UAAU,4BAA4B,CAAC,KAAK,SAAS,oBAAoB,EAAE,SAAS;IACnF;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IACZ;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,MAAM,kCAAkC,GAAG,4BAA4B,CA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jC,6BAA6B,GAC7B,4BAA4B,GAC5B,mCAAmC,GACnC,yBAAyB,GACzB,4CAA4C,GAE5C,8BAA8B,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GACrC,kCAAkC,GAClC,qCAAqC,GACrC,iCAAiC,GACjC,6BAA6B,GAC7B,4BAA4B,GAC5B,mCAAmC,GACnC,yBAAyB,GACzB,6CAA6C,GAE7C,8BAA8B,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,uCAAuC,GAAG,IAAI,CACzD,yBAAyB,EACzB,MAAM,GAAG,UAAU,CACnB,GACA,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"messageTypes.js","sourceRoot":"","sources":["../src/messageTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAoCX;AApCD,WAAY,oBAAoB;IAC/B,iCAAiC;IACjC,sDAA8B,CAAA;IAE9B,sBAAsB;IACtB,yCAAiB,CAAA;IAEjB,qBAAqB;IACrB,+CAAuB,CAAA;IAEvB,yFAAyF;IACzF,iDAAyB,CAAA;IAEzB,oDAAoD;IACpD,yCAAiB,CAAA;IAEjB,sCAAsC;IACtC,uCAAe,CAAA;IAEf;;;;OAIG;IACH,qDAA6B,CAAA;IAE7B;;OAEG;IACH,uDAA+B,CAAA;IAE/B;;;OAGG;IACH,iCAAS,CAAA;AACV,CAAC,EApCW,oBAAoB,KAApB,oBAAoB,QAoC/B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type { IdCreationRange } from \"@fluidframework/id-compressor/internal\";\nimport {\n\tIAttachMessage,\n\tIEnvelope,\n\tInboundAttachMessage,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport { IDataStoreAliasMessage } from \"./dataStore.js\";\nimport { GarbageCollectionMessage } from \"./gc/index.js\";\nimport { IChunkedOp } from \"./opLifecycle/index.js\";\nimport { IDocumentSchemaChangeMessage } from \"./summary/index.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport enum ContainerMessageType {\n\t// An op to be delivered to store\n\tFluidDataStoreOp = \"component\",\n\n\t// Creates a new store\n\tAttach = \"attach\",\n\n\t// Chunked operation.\n\tChunkedOp = \"chunkedOp\",\n\n\t// Signifies that a blob has been attached and should not be garbage collected by storage\n\tBlobAttach = \"blobAttach\",\n\n\t// Ties our new clientId to our old one on reconnect\n\tRejoin = \"rejoin\",\n\n\t// Sets the alias of a root data store\n\tAlias = \"alias\",\n\n\t/**\n\t * An op containing an IdRange of Ids allocated using the runtime's IdCompressor since\n\t * the last allocation op was sent.\n\t * See the [IdCompressor README](./id-compressor/README.md) for more details.\n\t */\n\tIdAllocation = \"idAllocation\",\n\n\t/**\n\t * An op that changes document schema\n\t */\n\tDocumentSchemaChange = \"schema\",\n\n\t/**\n\t * Garbage collection specific op. This is sent by the summarizer client when GC runs. It's used to synchronize GC\n\t * state across all clients.\n\t */\n\tGC = \"GC\",\n}\n\n/**\n * The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime.\n * Message type are differentiated via a `type` string and contain different contents depending on their type.\n *\n * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.\n * This way stringified values can be compared.\n */\ninterface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents> {\n\t/**\n\t * Type of the op, within the ContainerRuntime's domain\n\t */\n\ttype: TType;\n\t/**\n\t * Domain-specific contents, interpreted according to the type\n\t */\n\tcontents: TContents;\n}\n\nexport type ContainerRuntimeDataStoreOpMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.FluidDataStoreOp,\n\tIEnvelope\n>;\nexport type InboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Attach,\n\tInboundAttachMessage\n>;\nexport type OutboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Attach,\n\tIAttachMessage\n>;\nexport type ContainerRuntimeChunkedOpMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.ChunkedOp,\n\tIChunkedOp\n>;\nexport type ContainerRuntimeBlobAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.BlobAttach,\n\tundefined\n>;\nexport type ContainerRuntimeRejoinMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Rejoin,\n\tundefined\n>;\nexport type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Alias,\n\tIDataStoreAliasMessage\n>;\nexport type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.IdAllocation,\n\tIdCreationRange\n>;\nexport type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.GC,\n\tGarbageCollectionMessage\n>;\nexport type ContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.DocumentSchemaChange,\n\tIDocumentSchemaChangeMessage\n>;\n\n/**\n * Represents an unrecognized TypedContainerRuntimeMessage, e.g. a message from a future version of the container runtime.\n * @internal\n */\nexport interface UnknownContainerRuntimeMessage {\n\t/**\n\t * Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime.\n\t * This is useful for type narrowing but should never be used as an actual message type at runtime.\n\t * Actual value will not be \"__unknown...\", but the type `Exclude<string, ContainerMessageType>` is not supported.\n\t */\n\ttype: \"__unknown_container_message_type__never_use_as_value__\";\n\n\t/**\n\t * Domain-specific contents, but not decipherable by an unknown op.\n\t */\n\tcontents: unknown;\n}\n\n/**\n * A {@link TypedContainerRuntimeMessage} that is received from the server and will be processed by the container runtime.\n */\nexport type InboundContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| InboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeChunkedOpMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage\n\t| ContainerRuntimeDocumentSchemaMessage\n\t// Inbound messages may include unknown types from other clients, so we include that as a special case here\n\t| UnknownContainerRuntimeMessage;\n\n/**\n * A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime, eventually to be sent to the ordering service.\n * These are messages generated by the local runtime, before the outbox's op virtualization step.\n */\nexport type LocalContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| OutboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage\n\t| ContainerRuntimeDocumentSchemaMessage\n\t// In rare cases (e.g. related to stashed ops) we could have a local message of an unknown type\n\t| UnknownContainerRuntimeMessage;\n\n/**\n * An unpacked ISequencedDocumentMessage with the inner TypedContainerRuntimeMessage type/contents/etc\n * promoted up to the outer object\n */\nexport type InboundSequencedContainerRuntimeMessage = Omit<\n\tISequencedDocumentMessage,\n\t\"type\" | \"contents\"\n> &\n\tInboundContainerRuntimeMessage;\n"]}
1
+ {"version":3,"file":"messageTypes.js","sourceRoot":"","sources":["../src/messageTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAoCX;AApCD,WAAY,oBAAoB;IAC/B,iCAAiC;IACjC,sDAA8B,CAAA;IAE9B,sBAAsB;IACtB,yCAAiB,CAAA;IAEjB,qBAAqB;IACrB,+CAAuB,CAAA;IAEvB,yFAAyF;IACzF,iDAAyB,CAAA;IAEzB,oDAAoD;IACpD,yCAAiB,CAAA;IAEjB,sCAAsC;IACtC,uCAAe,CAAA;IAEf;;;;OAIG;IACH,qDAA6B,CAAA;IAE7B;;OAEG;IACH,uDAA+B,CAAA;IAE/B;;;OAGG;IACH,iCAAS,CAAA;AACV,CAAC,EApCW,oBAAoB,KAApB,oBAAoB,QAoC/B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type { IdCreationRange } from \"@fluidframework/id-compressor/internal\";\nimport {\n\tIAttachMessage,\n\tIEnvelope,\n\tInboundAttachMessage,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport { IDataStoreAliasMessage } from \"./dataStore.js\";\nimport { GarbageCollectionMessage } from \"./gc/index.js\";\nimport { IChunkedOp } from \"./opLifecycle/index.js\";\nimport {\n\ttype IDocumentSchemaChangeMessageIncoming,\n\ttype IDocumentSchemaChangeMessageOutgoing,\n} from \"./summary/index.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport enum ContainerMessageType {\n\t// An op to be delivered to store\n\tFluidDataStoreOp = \"component\",\n\n\t// Creates a new store\n\tAttach = \"attach\",\n\n\t// Chunked operation.\n\tChunkedOp = \"chunkedOp\",\n\n\t// Signifies that a blob has been attached and should not be garbage collected by storage\n\tBlobAttach = \"blobAttach\",\n\n\t// Ties our new clientId to our old one on reconnect\n\tRejoin = \"rejoin\",\n\n\t// Sets the alias of a root data store\n\tAlias = \"alias\",\n\n\t/**\n\t * An op containing an IdRange of Ids allocated using the runtime's IdCompressor since\n\t * the last allocation op was sent.\n\t * See the [IdCompressor README](./id-compressor/README.md) for more details.\n\t */\n\tIdAllocation = \"idAllocation\",\n\n\t/**\n\t * An op that changes document schema\n\t */\n\tDocumentSchemaChange = \"schema\",\n\n\t/**\n\t * Garbage collection specific op. This is sent by the summarizer client when GC runs. It's used to synchronize GC\n\t * state across all clients.\n\t */\n\tGC = \"GC\",\n}\n\n/**\n * The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime.\n * Message type are differentiated via a `type` string and contain different contents depending on their type.\n *\n * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.\n * This way stringified values can be compared.\n */\ninterface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents> {\n\t/**\n\t * Type of the op, within the ContainerRuntime's domain\n\t */\n\ttype: TType;\n\t/**\n\t * Domain-specific contents, interpreted according to the type\n\t */\n\tcontents: TContents;\n}\n\nexport type ContainerRuntimeDataStoreOpMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.FluidDataStoreOp,\n\tIEnvelope\n>;\nexport type InboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Attach,\n\tInboundAttachMessage\n>;\nexport type OutboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Attach,\n\tIAttachMessage\n>;\nexport type ContainerRuntimeChunkedOpMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.ChunkedOp,\n\tIChunkedOp\n>;\nexport type ContainerRuntimeBlobAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.BlobAttach,\n\tundefined\n>;\nexport type ContainerRuntimeRejoinMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Rejoin,\n\tundefined\n>;\nexport type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Alias,\n\tIDataStoreAliasMessage\n>;\nexport type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.IdAllocation,\n\tIdCreationRange\n>;\nexport type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.GC,\n\tGarbageCollectionMessage\n>;\nexport type InboundContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.DocumentSchemaChange,\n\tIDocumentSchemaChangeMessageIncoming\n>;\nexport type OutboundContainerRuntimeDocumentSchemaMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.DocumentSchemaChange,\n\tIDocumentSchemaChangeMessageOutgoing\n>;\n\n/**\n * Represents an unrecognized TypedContainerRuntimeMessage, e.g. a message from a future version of the container runtime.\n * @internal\n */\nexport interface UnknownContainerRuntimeMessage {\n\t/**\n\t * Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime.\n\t * This is useful for type narrowing but should never be used as an actual message type at runtime.\n\t * Actual value will not be \"__unknown...\", but the type `Exclude<string, ContainerMessageType>` is not supported.\n\t */\n\ttype: \"__unknown_container_message_type__never_use_as_value__\";\n\n\t/**\n\t * Domain-specific contents, but not decipherable by an unknown op.\n\t */\n\tcontents: unknown;\n}\n\n/**\n * A {@link TypedContainerRuntimeMessage} that is received from the server and will be processed by the container runtime.\n */\nexport type InboundContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| InboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeChunkedOpMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage\n\t| InboundContainerRuntimeDocumentSchemaMessage\n\t// Inbound messages may include unknown types from other clients, so we include that as a special case here\n\t| UnknownContainerRuntimeMessage;\n\n/**\n * A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime, eventually to be sent to the ordering service.\n * These are messages generated by the local runtime, before the outbox's op virtualization step.\n */\nexport type LocalContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| OutboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage\n\t| OutboundContainerRuntimeDocumentSchemaMessage\n\t// In rare cases (e.g. related to stashed ops) we could have a local message of an unknown type\n\t| UnknownContainerRuntimeMessage;\n\n/**\n * An unpacked ISequencedDocumentMessage with the inner TypedContainerRuntimeMessage type/contents/etc\n * promoted up to the outer object\n */\nexport type InboundSequencedContainerRuntimeMessage = Omit<\n\tISequencedDocumentMessage,\n\t\"type\" | \"contents\"\n> &\n\tInboundContainerRuntimeMessage;\n"]}
package/lib/metadata.d.ts CHANGED
@@ -15,7 +15,7 @@ export declare function asEmptyBatchLocalOpMetadata(localOpMetadata: unknown): I
15
15
  * Properties put on the localOpMetadata object for empty batches
16
16
  */
17
17
  export interface IEmptyBatchMetadata {
18
- emptyBatch?: boolean;
18
+ emptyBatch?: true;
19
19
  }
20
20
  /**
21
21
  * Properties put on the op metadata object for batch tracking
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,CAEtF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAC1C,eAAe,EAAE,OAAO,GACtB,mBAAmB,GAAG,SAAS,CAEjC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAEnC,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB"}
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,CAEtF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAC1C,eAAe,EAAE,OAAO,GACtB,mBAAmB,GAAG,SAAS,CAEjC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAEnC,UAAU,CAAC,EAAE,IAAI,CAAC;CAClB;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB"}
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAiB;IAChD,OAAO,QAA+C,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAC1C,eAAwB;IAExB,OAAO,eAAkD,CAAC;AAC3D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { BatchId } from \"./opLifecycle/index.js\";\n\n/**\n * Syntactic sugar for casting\n */\nexport function asBatchMetadata(metadata: unknown): Partial<IBatchMetadata> | undefined {\n\treturn metadata as Partial<IBatchMetadata> | undefined;\n}\n\n/**\n * Syntactic sugar for casting\n */\nexport function asEmptyBatchLocalOpMetadata(\n\tlocalOpMetadata: unknown,\n): IEmptyBatchMetadata | undefined {\n\treturn localOpMetadata as IEmptyBatchMetadata | undefined;\n}\n\n/**\n * Properties put on the localOpMetadata object for empty batches\n */\nexport interface IEmptyBatchMetadata {\n\t// Set to true on localOpMetadata for empty batches\n\temptyBatch?: boolean;\n}\n/**\n * Properties put on the op metadata object for batch tracking\n */\nexport interface IBatchMetadata {\n\t/**\n\t * Set on first/last messages of a multi-message batch, to true/false respectively\n\t */\n\tbatch?: boolean;\n\t/**\n\t * Maybe set on first message of a batch, to the batchId generated when resubmitting (set/fixed on first resubmit)\n\t */\n\tbatchId?: BatchId;\n}\n\n/**\n * Blob handling makes assumptions about what might be on the metadata. This interface codifies those assumptions, but does not validate them.\n */\nexport interface IBlobMetadata {\n\tblobId?: string;\n\tlocalId?: string;\n}\n\n/**\n * ContainerRuntime needs to know if this is a replayed savedOp as those need to be skipped in stashed ops scenarios.\n */\nexport interface ISavedOpMetadata {\n\tsavedOp?: boolean;\n}\n"]}
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAiB;IAChD,OAAO,QAA+C,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAC1C,eAAwB;IAExB,OAAO,eAAkD,CAAC;AAC3D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { BatchId } from \"./opLifecycle/index.js\";\n\n/**\n * Syntactic sugar for casting\n */\nexport function asBatchMetadata(metadata: unknown): Partial<IBatchMetadata> | undefined {\n\treturn metadata as Partial<IBatchMetadata> | undefined;\n}\n\n/**\n * Syntactic sugar for casting\n */\nexport function asEmptyBatchLocalOpMetadata(\n\tlocalOpMetadata: unknown,\n): IEmptyBatchMetadata | undefined {\n\treturn localOpMetadata as IEmptyBatchMetadata | undefined;\n}\n\n/**\n * Properties put on the localOpMetadata object for empty batches\n */\nexport interface IEmptyBatchMetadata {\n\t// Set to true on localOpMetadata for empty batches\n\temptyBatch?: true;\n}\n/**\n * Properties put on the op metadata object for batch tracking\n */\nexport interface IBatchMetadata {\n\t/**\n\t * Set on first/last messages of a multi-message batch, to true/false respectively\n\t */\n\tbatch?: boolean;\n\t/**\n\t * Maybe set on first message of a batch, to the batchId generated when resubmitting (set/fixed on first resubmit)\n\t */\n\tbatchId?: BatchId;\n}\n\n/**\n * Blob handling makes assumptions about what might be on the metadata. This interface codifies those assumptions, but does not validate them.\n */\nexport interface IBlobMetadata {\n\tblobId?: string;\n\tlocalId?: string;\n}\n\n/**\n * ContainerRuntime needs to know if this is a replayed savedOp as those need to be skipped in stashed ops scenarios.\n */\nexport interface ISavedOpMetadata {\n\tsavedOp?: boolean;\n}\n"]}
@@ -5,6 +5,8 @@
5
5
  import type { IBatchMessage } from "@fluidframework/container-definitions/internal";
6
6
  import { CompressionAlgorithms } from "../compressionDefinitions.js";
7
7
  import type { LocalContainerRuntimeMessage } from "../messageTypes.js";
8
+ import type { IEmptyBatchMetadata } from "../metadata.js";
9
+ import type { EmptyGroupedBatch } from "./opGroupingManager.js";
8
10
  /**
9
11
  * Local Batch message, before it is virtualized and sent to the ordering service
10
12
  */
@@ -30,7 +32,7 @@ export interface LocalBatchMessage {
30
32
  */
31
33
  staged?: boolean;
32
34
  /**
33
- * @deprecated Use serializedOp
35
+ * @deprecated Use runtimeOp
34
36
  */
35
37
  contents?: never;
36
38
  }
@@ -39,10 +41,9 @@ export interface LocalBatchMessage {
39
41
  */
40
42
  export interface LocalEmptyBatchPlaceholder {
41
43
  metadata?: Record<string, unknown>;
42
- localOpMetadata: {
43
- emptyBatch: true;
44
- };
44
+ localOpMetadata: Required<IEmptyBatchMetadata>;
45
45
  referenceSequenceNumber: number;
46
+ runtimeOp: EmptyGroupedBatch;
46
47
  }
47
48
  /**
48
49
  * Virtualized Batch message, on its way out the door to the ordering service
@@ -54,7 +55,7 @@ export type OutboundBatchMessage = IBatchMessage & {
54
55
  /**
55
56
  * @deprecated Use contents
56
57
  */
57
- serializedOp?: never;
58
+ runtimeOp?: never;
58
59
  };
59
60
  /**
60
61
  * A batch of messages we have accumulated locally, but haven't sent to the ordering service yet.
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/definitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAEpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,SAAS,EAAE,4BAA4B,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,eAAe,EAAE;QAAE,UAAU,EAAE,IAAI,CAAA;KAAE,CAAC;IACtC,uBAAuB,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IAClD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,qBAAqB,CAAC;IAEpC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,iBAAiB,EAAE,CAAC;IAC9D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,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E,SAAQ,MAAM,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAE3E;;;GAGG;AACH,UAAU,MAAM,CAAC,SAAS,SAAS,iBAAiB,EAAE,GAAG,oBAAoB,EAAE;IAC9E;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,uBAAuB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrD;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,KAAK,IAAI,CAAC;CACjE;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/opLifecycle/definitions.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IBatchMessage } from \"@fluidframework/container-definitions/internal\";\n\nimport { CompressionAlgorithms } from \"../compressionDefinitions.js\";\nimport type { LocalContainerRuntimeMessage } from \"../messageTypes.js\";\n\n/**\n * Local Batch message, before it is virtualized and sent to the ordering service\n */\nexport interface LocalBatchMessage {\n\t/**\n\t * The original local op\n\t */\n\truntimeOp: LocalContainerRuntimeMessage;\n\t/**\n\t * Optional metadata which is not to be serialized with the op, and is visible to the ordering service\n\t */\n\tmetadata?: Record<string, unknown>;\n\t/**\n\t * Metadata used by this local client in flows such as rebase\n\t */\n\tlocalOpMetadata?: unknown;\n\t/**\n\t * Reference sequence number this op is based on\n\t */\n\treferenceSequenceNumber: number;\n\t/**\n\t * If true, this op is not to be submitted to the ordering service yet, since it was submitted during Staging Mode\n\t */\n\tstaged?: boolean;\n\n\t/**\n\t * @deprecated Use serializedOp\n\t */\n\tcontents?: never; // To ensure we don't leave this one when converting from OutboundBatchMessage\n}\n\n/**\n * Placeholder for an empty batch, for tracking the pending local empty batch\n */\nexport interface LocalEmptyBatchPlaceholder {\n\tmetadata?: Record<string, unknown>;\n\tlocalOpMetadata: { emptyBatch: true };\n\treferenceSequenceNumber: number;\n}\n\n/**\n * Virtualized Batch message, on its way out the door to the ordering service\n */\nexport type OutboundBatchMessage = IBatchMessage & {\n\tlocalOpMetadata?: unknown;\n\treferenceSequenceNumber: number;\n\tcompression?: CompressionAlgorithms;\n\n\t/**\n\t * @deprecated Use contents\n\t */\n\tserializedOp?: never; // To ensure we don't leave this one when converting from LocalBatchMessage\n};\n\n/**\n * A batch of messages we have accumulated locally, but haven't sent to the ordering service yet.\n */\nexport interface LocalBatch extends IBatch<LocalBatchMessage[]> {\n\t/**\n\t * If true, this batch is not to be submitted to the ordering service yet, since it was submitted during Staging Mode\n\t */\n\tstaged?: boolean;\n}\n\n/**\n * A batch of messages that has been virtualized as needed (grouped, compressed, chunked)\n * and is ready to be sent to the ordering service.\n * At the very least, the op contents have been serialized to string.\n */\nexport interface OutboundBatch<\n\tTMessages extends OutboundBatchMessage[] = OutboundBatchMessage[],\n> extends IBatch<TMessages> {\n\t/**\n\t * Sum of the in-memory content sizes of all messages in the batch.\n\t * If the batch is compressed, this number reflects the post-compression size.\n\t */\n\treadonly contentSizeInBytes: number;\n}\n\n/**\n * An {@link OutboundBatch} with exactly one message\n * This type is helpful as Grouping yields this kind of batch, and Compression only operates on this type of batch.\n */\nexport type OutboundSingletonBatch = OutboundBatch<[OutboundBatchMessage]>;\n\n/**\n * Base batch interface used internally by the runtime.\n * See {@link LocalBatch} and {@link OutboundBatch} for the concrete types.\n */\ninterface IBatch<TMessages extends LocalBatchMessage[] | OutboundBatchMessage[]> {\n\t/**\n\t * All the messages in the batch\n\t */\n\treadonly messages: TMessages;\n\t/**\n\t * The reference sequence number for the batch\n\t */\n\treadonly referenceSequenceNumber: number | undefined;\n\t/**\n\t * Wether or not the batch contains at least one op which was produced as the result\n\t * of processing another op. This means that the batch must be rebased before\n\t * submitted, to ensure that all ops have the same reference sequence numbers and a\n\t * consistent view of the data model. This happens when the op is created within a\n\t * 'changed' event handler of a DDS and will have a different reference sequence number\n\t * than the rest of the ops in the batch, meaning that it has a different view of the\n\t * state of the data model, therefore all ops must be resubmitted and rebased to the current\n\t * reference sequence number to be in agreement about the data model state.\n\t */\n\treadonly hasReentrantOps?: boolean;\n}\n\nexport interface IBatchCheckpoint {\n\trollback: (action: (message: LocalBatchMessage) => void) => void;\n}\n\n/**\n * @internal\n */\nexport interface IChunkedOp {\n\tchunkId: number;\n\ttotalChunks: number;\n\tcontents: string;\n\toriginalMetadata?: Record<string, unknown>;\n\toriginalCompression?: string;\n}\n\n/**\n * The state of remote message processing:\n * `Processed` - the message can be considered processed\n * `Skipped` - the message was ignored by the processor\n * `Accepted` - the message was processed partially. Eventually, a message\n * will make the processor return `Processed`.\n */\nexport type ProcessingState = \"Processed\" | \"Skipped\" | \"Accepted\";\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/opLifecycle/definitions.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IBatchMessage } from \"@fluidframework/container-definitions/internal\";\n\nimport { CompressionAlgorithms } from \"../compressionDefinitions.js\";\nimport type { LocalContainerRuntimeMessage } from \"../messageTypes.js\";\nimport type { IEmptyBatchMetadata } from \"../metadata.js\";\n\nimport type { EmptyGroupedBatch } from \"./opGroupingManager.js\";\n\n/**\n * Local Batch message, before it is virtualized and sent to the ordering service\n */\nexport interface LocalBatchMessage {\n\t/**\n\t * The original local op\n\t */\n\truntimeOp: LocalContainerRuntimeMessage;\n\t/**\n\t * Optional metadata which is not to be serialized with the op, and is visible to the ordering service\n\t */\n\tmetadata?: Record<string, unknown>;\n\t/**\n\t * Metadata used by this local client in flows such as rebase\n\t */\n\tlocalOpMetadata?: unknown;\n\t/**\n\t * Reference sequence number this op is based on\n\t */\n\treferenceSequenceNumber: number;\n\t/**\n\t * If true, this op is not to be submitted to the ordering service yet, since it was submitted during Staging Mode\n\t */\n\tstaged?: boolean;\n\n\t/**\n\t * @deprecated Use runtimeOp\n\t */\n\tcontents?: never; // To ensure we don't leave this one when converting from OutboundBatchMessage\n}\n\n/**\n * Placeholder for an empty batch, for tracking the pending local empty batch\n */\nexport interface LocalEmptyBatchPlaceholder {\n\tmetadata?: Record<string, unknown>;\n\tlocalOpMetadata: Required<IEmptyBatchMetadata>;\n\treferenceSequenceNumber: number;\n\truntimeOp: EmptyGroupedBatch;\n}\n\n/**\n * Virtualized Batch message, on its way out the door to the ordering service\n */\nexport type OutboundBatchMessage = IBatchMessage & {\n\tlocalOpMetadata?: unknown;\n\treferenceSequenceNumber: number;\n\tcompression?: CompressionAlgorithms;\n\n\t/**\n\t * @deprecated Use contents\n\t */\n\truntimeOp?: never; // To ensure we don't leave this one when converting from LocalBatchMessage\n};\n\n/**\n * A batch of messages we have accumulated locally, but haven't sent to the ordering service yet.\n */\nexport interface LocalBatch extends IBatch<LocalBatchMessage[]> {\n\t/**\n\t * If true, this batch is not to be submitted to the ordering service yet, since it was submitted during Staging Mode\n\t */\n\tstaged?: boolean;\n}\n\n/**\n * A batch of messages that has been virtualized as needed (grouped, compressed, chunked)\n * and is ready to be sent to the ordering service.\n * At the very least, the op contents have been serialized to string.\n */\nexport interface OutboundBatch<\n\tTMessages extends OutboundBatchMessage[] = OutboundBatchMessage[],\n> extends IBatch<TMessages> {\n\t/**\n\t * Sum of the in-memory content sizes of all messages in the batch.\n\t * If the batch is compressed, this number reflects the post-compression size.\n\t */\n\treadonly contentSizeInBytes: number;\n}\n\n/**\n * An {@link OutboundBatch} with exactly one message\n * This type is helpful as Grouping yields this kind of batch, and Compression only operates on this type of batch.\n */\nexport type OutboundSingletonBatch = OutboundBatch<[OutboundBatchMessage]>;\n\n/**\n * Base batch interface used internally by the runtime.\n * See {@link LocalBatch} and {@link OutboundBatch} for the concrete types.\n */\ninterface IBatch<TMessages extends LocalBatchMessage[] | OutboundBatchMessage[]> {\n\t/**\n\t * All the messages in the batch\n\t */\n\treadonly messages: TMessages;\n\t/**\n\t * The reference sequence number for the batch\n\t */\n\treadonly referenceSequenceNumber: number | undefined;\n\t/**\n\t * Wether or not the batch contains at least one op which was produced as the result\n\t * of processing another op. This means that the batch must be rebased before\n\t * submitted, to ensure that all ops have the same reference sequence numbers and a\n\t * consistent view of the data model. This happens when the op is created within a\n\t * 'changed' event handler of a DDS and will have a different reference sequence number\n\t * than the rest of the ops in the batch, meaning that it has a different view of the\n\t * state of the data model, therefore all ops must be resubmitted and rebased to the current\n\t * reference sequence number to be in agreement about the data model state.\n\t */\n\treadonly hasReentrantOps?: boolean;\n}\n\nexport interface IBatchCheckpoint {\n\trollback: (action: (message: LocalBatchMessage) => void) => void;\n}\n\n/**\n * @internal\n */\nexport interface IChunkedOp {\n\tchunkId: number;\n\ttotalChunks: number;\n\tcontents: string;\n\toriginalMetadata?: Record<string, unknown>;\n\toriginalCompression?: string;\n}\n\n/**\n * The state of remote message processing:\n * `Processed` - the message can be considered processed\n * `Skipped` - the message was ignored by the processor\n * `Accepted` - the message was processed partially. Eventually, a message\n * will make the processor return `Processed`.\n */\nexport type ProcessingState = \"Processed\" | \"Skipped\" | \"Accepted\";\n"]}
@@ -11,5 +11,5 @@ export { OpCompressor } from "./opCompressor.js";
11
11
  export { OpDecompressor } from "./opDecompressor.js";
12
12
  export { OpSplitter, splitOp, isChunkedMessage } from "./opSplitter.js";
13
13
  export { InboundMessageResult, BatchStartInfo, RemoteMessageProcessor, unpackRuntimeMessage, } from "./remoteMessageProcessor.js";
14
- export { OpGroupingManager, OpGroupingManagerConfig, isGroupedBatch, } from "./opGroupingManager.js";
14
+ export { EmptyGroupedBatch, OpGroupingManager, OpGroupingManagerConfig, isGroupedBatch, } from "./opGroupingManager.js";
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,UAAU,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,WAAW,EACX,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,MAAM,EACN,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACN,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,GACd,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,UAAU,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,WAAW,EACX,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,MAAM,EACN,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACN,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,GACd,MAAM,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/opLifecycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,YAAY,EAEZ,mBAAmB,EACnB,eAAe,GAEf,MAAM,mBAAmB,CAAC;AAW3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,WAAW,EACX,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEN,kBAAkB,EAClB,yBAAyB,EACzB,MAAM,EACN,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAGN,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,iBAAiB,EAEjB,cAAc,GACd,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tBatchId,\n\tBatchManager,\n\tBatchSequenceNumbers,\n\tgetEffectiveBatchId,\n\tgenerateBatchId,\n\tIBatchManagerOptions,\n} from \"./batchManager.js\";\nexport {\n\tLocalBatch,\n\tLocalBatchMessage,\n\tLocalEmptyBatchPlaceholder,\n\tOutboundBatch,\n\tOutboundBatchMessage,\n\tOutboundSingletonBatch,\n\tIBatchCheckpoint,\n\tIChunkedOp,\n} from \"./definitions.js\";\nexport { DuplicateBatchDetector } from \"./duplicateBatchDetector.js\";\nexport {\n\tserializeOp,\n\tensureContentsDeserialized,\n} from \"./opSerialization.js\";\nexport {\n\tBatchResubmitInfo,\n\testimateSocketSize,\n\tlocalBatchToOutboundBatch,\n\tOutbox,\n\tgetLongStack,\n} from \"./outbox.js\";\nexport { OpCompressor } from \"./opCompressor.js\";\nexport { OpDecompressor } from \"./opDecompressor.js\";\nexport { OpSplitter, splitOp, isChunkedMessage } from \"./opSplitter.js\";\nexport {\n\tInboundMessageResult,\n\tBatchStartInfo,\n\tRemoteMessageProcessor,\n\tunpackRuntimeMessage,\n} from \"./remoteMessageProcessor.js\";\nexport {\n\tOpGroupingManager,\n\tOpGroupingManagerConfig,\n\tisGroupedBatch,\n} from \"./opGroupingManager.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/opLifecycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,YAAY,EAEZ,mBAAmB,EACnB,eAAe,GAEf,MAAM,mBAAmB,CAAC;AAW3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACN,WAAW,EACX,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEN,kBAAkB,EAClB,yBAAyB,EACzB,MAAM,EACN,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAGN,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEN,iBAAiB,EAEjB,cAAc,GACd,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tBatchId,\n\tBatchManager,\n\tBatchSequenceNumbers,\n\tgetEffectiveBatchId,\n\tgenerateBatchId,\n\tIBatchManagerOptions,\n} from \"./batchManager.js\";\nexport {\n\tLocalBatch,\n\tLocalBatchMessage,\n\tLocalEmptyBatchPlaceholder,\n\tOutboundBatch,\n\tOutboundBatchMessage,\n\tOutboundSingletonBatch,\n\tIBatchCheckpoint,\n\tIChunkedOp,\n} from \"./definitions.js\";\nexport { DuplicateBatchDetector } from \"./duplicateBatchDetector.js\";\nexport {\n\tserializeOp,\n\tensureContentsDeserialized,\n} from \"./opSerialization.js\";\nexport {\n\tBatchResubmitInfo,\n\testimateSocketSize,\n\tlocalBatchToOutboundBatch,\n\tOutbox,\n\tgetLongStack,\n} from \"./outbox.js\";\nexport { OpCompressor } from \"./opCompressor.js\";\nexport { OpDecompressor } from \"./opDecompressor.js\";\nexport { OpSplitter, splitOp, isChunkedMessage } from \"./opSplitter.js\";\nexport {\n\tInboundMessageResult,\n\tBatchStartInfo,\n\tRemoteMessageProcessor,\n\tunpackRuntimeMessage,\n} from \"./remoteMessageProcessor.js\";\nexport {\n\tEmptyGroupedBatch,\n\tOpGroupingManager,\n\tOpGroupingManagerConfig,\n\tisGroupedBatch,\n} from \"./opGroupingManager.js\";\n"]}
@@ -9,6 +9,15 @@ export declare function isGroupedBatch(op: ISequencedDocumentMessage): boolean;
9
9
  export interface OpGroupingManagerConfig {
10
10
  readonly groupedBatchingEnabled: boolean;
11
11
  }
12
+ /**
13
+ * This is the type of an empty grouped batch we send over the wire
14
+ * We also put this in the placeholder for an empty batch in the PendingStateManager.
15
+ * But most places throughout the ContainerRuntime, this will not be used (just as Grouped Batches in general don't appear outside opLifecycle dir)
16
+ */
17
+ export interface EmptyGroupedBatch {
18
+ type: typeof OpGroupingManager.groupedBatchOp;
19
+ contents: readonly unknown[];
20
+ }
12
21
  export declare class OpGroupingManager {
13
22
  private readonly config;
14
23
  static readonly groupedBatchOp = "groupedBatch";
@@ -1 +1 @@
1
- {"version":3,"file":"opGroupingManager.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/opGroupingManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAMxF,OAAO,EACN,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,MAAM,kBAAkB,CAAC;AAuB1B,w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AAQ,EAAE,SAAS,OAAO,EAAE,CAAC;CAC7B;AAED,qBAAa,iBAAiB;IAK5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJxB,MAAM,CAAC,QAAQ,CAAC,cAAc,kBAAkB;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAG3B,MAAM,EAAE,uBAAuB,EAChD,MAAM,EAAE,oBAAoB;IAK7B;;;;;;OAMG;IACI,uBAAuB,CAC7B,mBAAmB,EAAE,MAAM,EAC3B,uBAAuB,EAAE,MAAM,GAC7B;QACF,aAAa,EAAE,sBAAsB,CAAC;QACtC,kBAAkB,EAAE,0BAA0B,CAAC;KAC/C;IA0BD;;;;;;;;OAQG;IACI,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,sBAAsB;IAkDxD,SAAS,CAAC,EAAE,EAAE,yBAAyB,GAAG,yBAAyB,EAAE;IAcrE,sBAAsB,IAAI,OAAO;CAGxC"}
@@ -25,18 +25,20 @@ export class OpGroupingManager {
25
25
  */
26
26
  createEmptyGroupedBatch(resubmittingBatchId, referenceSequenceNumber) {
27
27
  assert(this.config.groupedBatchingEnabled, 0xa00 /* cannot create empty grouped batch when grouped batching is disabled */);
28
- const serializedOp = JSON.stringify({
29
- type: OpGroupingManager.groupedBatchOp,
28
+ const emptyGroupedBatch = {
29
+ type: "groupedBatch",
30
30
  contents: [],
31
- });
31
+ };
32
+ const serializedOp = JSON.stringify(emptyGroupedBatch);
32
33
  const placeholderMessage = {
33
34
  metadata: { batchId: resubmittingBatchId },
34
35
  localOpMetadata: { emptyBatch: true },
35
36
  referenceSequenceNumber,
37
+ runtimeOp: emptyGroupedBatch,
36
38
  };
37
39
  const outboundBatch = {
38
40
  contentSizeInBytes: 0,
39
- messages: [{ ...placeholderMessage, contents: serializedOp }],
41
+ messages: [{ ...placeholderMessage, runtimeOp: undefined, contents: serializedOp }],
40
42
  referenceSequenceNumber,
41
43
  };
42
44
  return { outboundBatch, placeholderMessage };
@@ -1 +1 @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BAAsB,CAAC;IAC3C,CAAC;;AAzHe,gCAAc,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tcreateChildLogger,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype LocalEmptyBatchPlaceholder,\n\ttype OutboundBatch,\n\ttype OutboundSingletonBatch,\n} from \"./definitions.js\";\n\n/**\n * Grouping makes assumptions about the shape of message contents. This interface codifies those assumptions, but does not validate them.\n */\ninterface IGroupedBatchMessageContents {\n\ttype: typeof OpGroupingManager.groupedBatchOp;\n\tcontents: IGroupedMessage[];\n}\n\ninterface IGroupedMessage {\n\tcontents?: unknown;\n\tmetadata?: Record<string, unknown>;\n\tcompression?: string;\n}\n\nfunction isGroupContents(opContents: unknown): opContents is IGroupedBatchMessageContents {\n\treturn (\n\t\t(opContents as Partial<IGroupedBatchMessageContents>)?.type ===\n\t\tOpGroupingManager.groupedBatchOp\n\t);\n}\n\nexport function isGroupedBatch(op: ISequencedDocumentMessage): boolean {\n\treturn isGroupContents(op.contents);\n}\n\nexport interface OpGroupingManagerConfig {\n\treadonly groupedBatchingEnabled: boolean;\n}\n\nexport class OpGroupingManager {\n\tstatic readonly groupedBatchOp = \"groupedBatch\";\n\tprivate readonly logger: ITelemetryLoggerExt;\n\n\tconstructor(\n\t\tprivate readonly config: OpGroupingManagerConfig,\n\t\tlogger: ITelemetryBaseLogger,\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpGroupingManager\" });\n\t}\n\n\t/**\n\t * Creates a new batch with a single message of type \"groupedBatch\" and empty contents.\n\t * This is needed as a placeholder if a batch becomes empty on resubmit, but we are tracking batch IDs.\n\t * @param resubmittingBatchId - batch ID of the resubmitting batch\n\t * @param referenceSequenceNumber - reference sequence number\n\t * @returns - The outbound batch as well as the interior placeholder message\n\t */\n\tpublic createEmptyGroupedBatch(\n\t\tresubmittingBatchId: string,\n\t\treferenceSequenceNumber: number,\n\t): {\n\t\toutboundBatch: OutboundSingletonBatch;\n\t\tplaceholderMessage: LocalEmptyBatchPlaceholder;\n\t} {\n\t\tassert(\n\t\t\tthis.config.groupedBatchingEnabled,\n\t\t\t0xa00 /* cannot create empty grouped batch when grouped batching is disabled */,\n\t\t);\n\t\tconst serializedOp = JSON.stringify({\n\t\t\ttype: OpGroupingManager.groupedBatchOp,\n\t\t\tcontents: [],\n\t\t});\n\n\t\tconst placeholderMessage: LocalEmptyBatchPlaceholder = {\n\t\t\tmetadata: { batchId: resubmittingBatchId },\n\t\t\tlocalOpMetadata: { emptyBatch: true },\n\t\t\treferenceSequenceNumber,\n\t\t};\n\t\tconst outboundBatch: OutboundSingletonBatch = {\n\t\t\tcontentSizeInBytes: 0,\n\t\t\tmessages: [{ ...placeholderMessage, contents: serializedOp }],\n\t\t\treferenceSequenceNumber,\n\t\t};\n\t\treturn { outboundBatch, placeholderMessage };\n\t}\n\n\t/**\n\t * Converts the given batch into a \"grouped batch\" - a batch with a single message of type \"groupedBatch\",\n\t * with contents being an array of the original batch's messages.\n\t *\n\t * If the batch already has only 1 message, it is returned as-is.\n\t *\n\t * @remarks - Remember that a BatchMessage has its content JSON serialized, so the incoming batch message contents\n\t * must be parsed first, and then the type and contents mentioned above are hidden in that JSON serialization.\n\t */\n\tpublic groupBatch(batch: OutboundBatch): OutboundSingletonBatch {\n\t\tassert(this.groupedBatchingEnabled(), 0xb79 /* grouping disabled! */);\n\t\tassert(batch.messages.length > 0, 0xb7a /* Unexpected attempt to group an empty batch */);\n\n\t\tif (batch.messages.length === 1) {\n\t\t\treturn batch as OutboundSingletonBatch;\n\t\t}\n\n\t\tif (batch.messages.length >= 1000) {\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"GroupLargeBatch\",\n\t\t\t\tlength: batch.messages.length,\n\t\t\t\treentrant: batch.hasReentrantOps,\n\t\t\t\treferenceSequenceNumber: batch.messages[0].referenceSequenceNumber,\n\t\t\t});\n\t\t}\n\t\t// We expect this will be on the first message, if present at all.\n\t\tlet groupedBatchId;\n\t\tfor (const message of batch.messages) {\n\t\t\tif (message.metadata) {\n\t\t\t\tconst { batch: _batch, batchId, ...rest } = message.metadata;\n\t\t\t\tif (batchId) {\n\t\t\t\t\tgroupedBatchId = batchId;\n\t\t\t\t}\n\t\t\t\tassert(Object.keys(rest).length === 0, 0x5dd /* cannot group ops with metadata */);\n\t\t\t}\n\t\t}\n\n\t\tconst serializedContent = JSON.stringify({\n\t\t\ttype: OpGroupingManager.groupedBatchOp,\n\t\t\tcontents: batch.messages.map<IGroupedMessage>((message) => ({\n\t\t\t\tcontents: message.contents === undefined ? undefined : JSON.parse(message.contents),\n\t\t\t\tmetadata: message.metadata,\n\t\t\t\tcompression: message.compression,\n\t\t\t})),\n\t\t});\n\n\t\tconst groupedBatch: OutboundSingletonBatch = {\n\t\t\t...batch,\n\t\t\tmessages: [\n\t\t\t\t{\n\t\t\t\t\tmetadata: { batchId: groupedBatchId },\n\t\t\t\t\treferenceSequenceNumber: batch.messages[0].referenceSequenceNumber,\n\t\t\t\t\tcontents: serializedContent,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t\treturn groupedBatch;\n\t}\n\n\tpublic ungroupOp(op: ISequencedDocumentMessage): ISequencedDocumentMessage[] {\n\t\tassert(isGroupContents(op.contents), 0x947 /* can only ungroup a grouped batch */);\n\t\tconst contents: IGroupedBatchMessageContents = op.contents;\n\n\t\tlet fakeCsn = 1;\n\t\treturn contents.contents.map((subMessage) => ({\n\t\t\t...op,\n\t\t\tclientSequenceNumber: fakeCsn++,\n\t\t\tcontents: subMessage.contents,\n\t\t\tmetadata: subMessage.metadata,\n\t\t\tcompression: subMessage.compression,\n\t\t}));\n\t}\n\n\tpublic groupedBatchingEnabled(): boolean {\n\t\treturn this.config.groupedBatchingEnabled;\n\t}\n}\n"]}
1
+ {"version":3,"file":"opGroupingManager.js","sourceRoot":"","sources":["../../src/opLifecycle/opGroupingManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EACN,iBAAiB,GAEjB,MAAM,0CAA0C,CAAC;AAsBlD,SAAS,eAAe,CAAC,UAAmB;IAC3C,OAAO,CACL,UAAoD,EAAE,IAAI;QAC3D,iBAAiB,CAAC,cAAc,CAChC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAA6B;IAC3D,OAAO,eAAe,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAgBD,MAAM,OAAO,iBAAiB;IAI7B,YACkB,MAA+B,EAChD,MAA4B;QADX,WAAM,GAAN,MAAM,CAAyB;QAGhD,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;OAMG;IACI,uBAAuB,CAC7B,mBAA2B,EAC3B,uBAA+B;QAK/B,MAAM,CACL,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAClC,KAAK,CAAC,yEAAyE,CAC/E,CAAC;QAEF,MAAM,iBAAiB,GAAsB;YAC5C,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE,EAAE;SACZ,CAAC;QACF,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAEvD,MAAM,kBAAkB,GAA+B;YACtD,QAAQ,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE;YAC1C,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;YACrC,uBAAuB;YACvB,SAAS,EAAE,iBAAiB;SAC5B,CAAC;QACF,MAAM,aAAa,GAA2B;Y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AAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,WAAW,EAAE,UAAU,CAAC,WAAW;SACnC,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,sBAAsB;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC;IAC3C,CAAC;;AA5He,gCAAc,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tcreateChildLogger,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype LocalEmptyBatchPlaceholder,\n\ttype OutboundBatch,\n\ttype OutboundSingletonBatch,\n} from \"./definitions.js\";\n\n/**\n * Grouping makes assumptions about the shape of message contents. This interface codifies those assumptions, but does not validate them.\n */\ninterface IGroupedBatchMessageContents {\n\ttype: typeof OpGroupingManager.groupedBatchOp;\n\tcontents: IGroupedMessage[];\n}\n\ninterface IGroupedMessage {\n\tcontents?: unknown;\n\tmetadata?: Record<string, unknown>;\n\tcompression?: string;\n}\n\nfunction isGroupContents(opContents: unknown): opContents is IGroupedBatchMessageContents {\n\treturn (\n\t\t(opContents as Partial<IGroupedBatchMessageContents>)?.type ===\n\t\tOpGroupingManager.groupedBatchOp\n\t);\n}\n\nexport function isGroupedBatch(op: ISequencedDocumentMessage): boolean {\n\treturn isGroupContents(op.contents);\n}\n\nexport interface OpGroupingManagerConfig {\n\treadonly groupedBatchingEnabled: boolean;\n}\n\n/**\n * This is the type of an empty grouped batch we send over the wire\n * We also put this in the placeholder for an empty batch in the PendingStateManager.\n * But most places throughout the ContainerRuntime, this will not be used (just as Grouped Batches in general don't appear outside opLifecycle dir)\n */\nexport interface EmptyGroupedBatch {\n\ttype: typeof OpGroupingManager.groupedBatchOp;\n\tcontents: readonly unknown[];\n}\n\nexport class OpGroupingManager {\n\tstatic readonly groupedBatchOp = \"groupedBatch\";\n\tprivate readonly logger: ITelemetryLoggerExt;\n\n\tconstructor(\n\t\tprivate readonly config: OpGroupingManagerConfig,\n\t\tlogger: ITelemetryBaseLogger,\n\t) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpGroupingManager\" });\n\t}\n\n\t/**\n\t * Creates a new batch with a single message of type \"groupedBatch\" and empty contents.\n\t * This is needed as a placeholder if a batch becomes empty on resubmit, but we are tracking batch IDs.\n\t * @param resubmittingBatchId - batch ID of the resubmitting batch\n\t * @param referenceSequenceNumber - reference sequence number\n\t * @returns - The outbound batch as well as the interior placeholder message\n\t */\n\tpublic createEmptyGroupedBatch(\n\t\tresubmittingBatchId: string,\n\t\treferenceSequenceNumber: number,\n\t): {\n\t\toutboundBatch: OutboundSingletonBatch;\n\t\tplaceholderMessage: LocalEmptyBatchPlaceholder;\n\t} {\n\t\tassert(\n\t\t\tthis.config.groupedBatchingEnabled,\n\t\t\t0xa00 /* cannot create empty grouped batch when grouped batching is disabled */,\n\t\t);\n\n\t\tconst emptyGroupedBatch: EmptyGroupedBatch = {\n\t\t\ttype: \"groupedBatch\",\n\t\t\tcontents: [],\n\t\t};\n\t\tconst serializedOp = JSON.stringify(emptyGroupedBatch);\n\n\t\tconst placeholderMessage: LocalEmptyBatchPlaceholder = {\n\t\t\tmetadata: { batchId: resubmittingBatchId },\n\t\t\tlocalOpMetadata: { emptyBatch: true },\n\t\t\treferenceSequenceNumber,\n\t\t\truntimeOp: emptyGroupedBatch,\n\t\t};\n\t\tconst outboundBatch: OutboundSingletonBatch = {\n\t\t\tcontentSizeInBytes: 0,\n\t\t\tmessages: [{ ...placeholderMessage, runtimeOp: undefined, contents: serializedOp }],\n\t\t\treferenceSequenceNumber,\n\t\t};\n\t\treturn { outboundBatch, placeholderMessage };\n\t}\n\n\t/**\n\t * Converts the given batch into a \"grouped batch\" - a batch with a single message of type \"groupedBatch\",\n\t * with contents being an array of the original batch's messages.\n\t *\n\t * If the batch already has only 1 message, it is returned as-is.\n\t *\n\t * @remarks - Remember that a BatchMessage has its content JSON serialized, so the incoming batch message contents\n\t * must be parsed first, and then the type and contents mentioned above are hidden in that JSON serialization.\n\t */\n\tpublic groupBatch(batch: OutboundBatch): OutboundSingletonBatch {\n\t\tassert(this.groupedBatchingEnabled(), 0xb79 /* grouping disabled! */);\n\t\tassert(batch.messages.length > 0, 0xb7a /* Unexpected attempt to group an empty batch */);\n\n\t\tif (batch.messages.length === 1) {\n\t\t\treturn batch as OutboundSingletonBatch;\n\t\t}\n\n\t\tif (batch.messages.length >= 1000) {\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"GroupLargeBatch\",\n\t\t\t\tlength: batch.messages.length,\n\t\t\t\treentrant: batch.hasReentrantOps,\n\t\t\t\treferenceSequenceNumber: batch.messages[0].referenceSequenceNumber,\n\t\t\t});\n\t\t}\n\t\t// We expect this will be on the first message, if present at all.\n\t\tlet groupedBatchId;\n\t\tfor (const message of batch.messages) {\n\t\t\tif (message.metadata) {\n\t\t\t\tconst { batch: _batch, batchId, ...rest } = message.metadata;\n\t\t\t\tif (batchId) {\n\t\t\t\t\tgroupedBatchId = batchId;\n\t\t\t\t}\n\t\t\t\tassert(Object.keys(rest).length === 0, 0x5dd /* cannot group ops with metadata */);\n\t\t\t}\n\t\t}\n\n\t\tconst serializedContent = JSON.stringify({\n\t\t\ttype: OpGroupingManager.groupedBatchOp,\n\t\t\tcontents: batch.messages.map<IGroupedMessage>((message) => ({\n\t\t\t\tcontents: message.contents === undefined ? undefined : JSON.parse(message.contents),\n\t\t\t\tmetadata: message.metadata,\n\t\t\t\tcompression: message.compression,\n\t\t\t})),\n\t\t});\n\n\t\tconst groupedBatch: OutboundSingletonBatch = {\n\t\t\t...batch,\n\t\t\tmessages: [\n\t\t\t\t{\n\t\t\t\t\tmetadata: { batchId: groupedBatchId },\n\t\t\t\t\treferenceSequenceNumber: batch.messages[0].referenceSequenceNumber,\n\t\t\t\t\tcontents: serializedContent,\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t\treturn groupedBatch;\n\t}\n\n\tpublic ungroupOp(op: ISequencedDocumentMessage): ISequencedDocumentMessage[] {\n\t\tassert(isGroupContents(op.contents), 0x947 /* can only ungroup a grouped batch */);\n\t\tconst contents: IGroupedBatchMessageContents = op.contents;\n\n\t\tlet fakeCsn = 1;\n\t\treturn contents.contents.map((subMessage) => ({\n\t\t\t...op,\n\t\t\tclientSequenceNumber: fakeCsn++,\n\t\t\tcontents: subMessage.contents,\n\t\t\tmetadata: subMessage.metadata,\n\t\t\tcompression: subMessage.compression,\n\t\t}));\n\t}\n\n\tpublic groupedBatchingEnabled(): boolean {\n\t\treturn this.config.groupedBatchingEnabled;\n\t}\n}\n"]}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
6
6
  import type { LocalContainerRuntimeMessage } from "../messageTypes.js";
7
+ import type { EmptyGroupedBatch } from "./opGroupingManager.js";
7
8
  /**
8
9
  * Takes an incoming runtime message (outer type "op"), JSON.parses the message's contents in place,
9
10
  * if needed (old Loader does this for us).
@@ -18,5 +19,5 @@ export declare function ensureContentsDeserialized(mutableMessage: ISequencedDoc
18
19
  *
19
20
  * @param toSerialize - op message to serialize. Also supports an array of ops.
20
21
  */
21
- export declare function serializeOp(toSerialize: LocalContainerRuntimeMessage | LocalContainerRuntimeMessage[]): string;
22
+ export declare function serializeOp(toSerialize: EmptyGroupedBatch | LocalContainerRuntimeMessage | LocalContainerRuntimeMessage[]): string;
22
23
  //# sourceMappingURL=opSerialization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"opSerialization.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/opSerialization.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAO7F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,yBAAyB,GAAG,IAAI,CAM1F;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,WAAW,EAAE,4BAA4B,GAAG,4BAA4B,EAAE,GACxE,MAAM,CAYR"}
1
+ {"version":3,"file":"opSerialization.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/opSerialization.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAO7F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,yBAAyB,GAAG,IAAI,CAM1F;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,WAAW,EACR,iBAAiB,GACjB,4BAA4B,GAC5B,4BAA4B,EAAE,GAC/B,MAAM,CAYR"}
@@ -1 +1 @@
1
- {"version":3,"file":"opSerialization.js","sourceRoot":"","sources":["../../src/opLifecycle/opSerialization.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,4BAA4B,EAC5B,aAAa,EACb,qBAAqB,GACrB,MAAM,wCAAwC,CAAC;AAIhD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,cAAyC;IACnF,yEAAyE;IACzE,qFAAqF;IACrF,IAAI,OAAO,cAAc,CAAC,QAAQ,KAAK,QAAQ,IAAI,cAAc,CAAC,QAAQ,KAAK,EAAE,EAAE,CAAC;QACnF,cAAc,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAC1B,WAA0E;IAE1E,OAAO,IAAI,CAAC,SAAS,CACpB,WAAW;IACX,YAAY;IACZ,CAAC,GAAG,EAAE,KAAc,EAAE,EAAE;QACvB,yDAAyD;QACzD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,4BAA4B,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tencodeHandleForSerialization,\n\tisFluidHandle,\n\ttoFluidHandleInternal,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport type { LocalContainerRuntimeMessage } from \"../messageTypes.js\";\n\n/**\n * Takes an incoming runtime message (outer type \"op\"), JSON.parses the message's contents in place,\n * if needed (old Loader does this for us).\n * Only to be used for runtime messages. The contents here would be the virtualized payload for a batch of ops.\n * @remarks - Serialization during submit happens via {@link serializeOp}\n * @param mutableMessage - op message received\n */\nexport function ensureContentsDeserialized(mutableMessage: ISequencedDocumentMessage): void {\n\t// This should become unconditional once Loader LTS reaches 2.4 or later.\n\t// There will be a long time of needing both cases, until LTS advances to that point.\n\tif (typeof mutableMessage.contents === \"string\" && mutableMessage.contents !== \"\") {\n\t\tmutableMessage.contents = JSON.parse(mutableMessage.contents);\n\t}\n}\n\n/**\n * Before submitting an op to the Outbox, its contents must be serialized using this function.\n * @remarks - The deserialization on process happens via the function {@link ensureContentsDeserialized}.\n *\n * @param toSerialize - op message to serialize. Also supports an array of ops.\n */\nexport function serializeOp(\n\ttoSerialize: LocalContainerRuntimeMessage | LocalContainerRuntimeMessage[],\n): string {\n\treturn JSON.stringify(\n\t\ttoSerialize,\n\t\t// replacer:\n\t\t(key, value: unknown) => {\n\t\t\t// If 'value' is an IFluidHandle return its encoded form.\n\t\t\tif (isFluidHandle(value)) {\n\t\t\t\treturn encodeHandleForSerialization(toFluidHandleInternal(value));\n\t\t\t}\n\t\t\treturn value;\n\t\t},\n\t);\n}\n"]}
1
+ {"version":3,"file":"opSerialization.js","sourceRoot":"","sources":["../../src/opLifecycle/opSerialization.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,4BAA4B,EAC5B,aAAa,EACb,qBAAqB,GACrB,MAAM,wCAAwC,CAAC;AAMhD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,cAAyC;IACnF,yEAAyE;IACzE,qFAAqF;IACrF,IAAI,OAAO,cAAc,CAAC,QAAQ,KAAK,QAAQ,IAAI,cAAc,CAAC,QAAQ,KAAK,EAAE,EAAE,CAAC;QACnF,cAAc,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAC1B,WAGiC;IAEjC,OAAO,IAAI,CAAC,SAAS,CACpB,WAAW;IACX,YAAY;IACZ,CAAC,GAAG,EAAE,KAAc,EAAE,EAAE;QACvB,yDAAyD;QACzD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,4BAA4B,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tencodeHandleForSerialization,\n\tisFluidHandle,\n\ttoFluidHandleInternal,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport type { LocalContainerRuntimeMessage } from \"../messageTypes.js\";\n\nimport type { EmptyGroupedBatch } from \"./opGroupingManager.js\";\n\n/**\n * Takes an incoming runtime message (outer type \"op\"), JSON.parses the message's contents in place,\n * if needed (old Loader does this for us).\n * Only to be used for runtime messages. The contents here would be the virtualized payload for a batch of ops.\n * @remarks - Serialization during submit happens via {@link serializeOp}\n * @param mutableMessage - op message received\n */\nexport function ensureContentsDeserialized(mutableMessage: ISequencedDocumentMessage): void {\n\t// This should become unconditional once Loader LTS reaches 2.4 or later.\n\t// There will be a long time of needing both cases, until LTS advances to that point.\n\tif (typeof mutableMessage.contents === \"string\" && mutableMessage.contents !== \"\") {\n\t\tmutableMessage.contents = JSON.parse(mutableMessage.contents);\n\t}\n}\n\n/**\n * Before submitting an op to the Outbox, its contents must be serialized using this function.\n * @remarks - The deserialization on process happens via the function {@link ensureContentsDeserialized}.\n *\n * @param toSerialize - op message to serialize. Also supports an array of ops.\n */\nexport function serializeOp(\n\ttoSerialize:\n\t\t| EmptyGroupedBatch\n\t\t| LocalContainerRuntimeMessage\n\t\t| LocalContainerRuntimeMessage[],\n): string {\n\treturn JSON.stringify(\n\t\ttoSerialize,\n\t\t// replacer:\n\t\t(key, value: unknown) => {\n\t\t\t// If 'value' is an IFluidHandle return its encoded form.\n\t\t\tif (isFluidHandle(value)) {\n\t\t\t\treturn encodeHandleForSerialization(toFluidHandleInternal(value));\n\t\t\t}\n\t\t\treturn value;\n\t\t},\n\t);\n}\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.41.0";
8
+ export declare const pkgVersion = "2.42.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/container-runtime";
8
- export const pkgVersion = "2.41.0";
8
+ export const pkgVersion = "2.42.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,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-runtime\";\nexport const pkgVersion = \"2.41.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,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-runtime\";\nexport const pkgVersion = \"2.42.0\";\n"]}