@fluidframework/runtime-definitions 2.0.0-internal.6.1.1 → 2.0.0-internal.6.2.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 (35) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +4 -3
  3. package/dist/dataStoreContext.d.ts +1 -2
  4. package/dist/dataStoreContext.d.ts.map +1 -1
  5. package/dist/dataStoreContext.js.map +1 -1
  6. package/dist/id-compressor/idCompressor.d.ts +32 -50
  7. package/dist/id-compressor/idCompressor.d.ts.map +1 -1
  8. package/dist/id-compressor/idCompressor.js.map +1 -1
  9. package/dist/id-compressor/identifiers.d.ts +10 -51
  10. package/dist/id-compressor/identifiers.d.ts.map +1 -1
  11. package/dist/id-compressor/identifiers.js.map +1 -1
  12. package/dist/id-compressor/index.d.ts +2 -2
  13. package/dist/id-compressor/index.d.ts.map +1 -1
  14. package/dist/id-compressor/index.js +3 -0
  15. package/dist/id-compressor/index.js.map +1 -1
  16. package/dist/id-compressor/persisted-types/0.0.1.d.ts +18 -136
  17. package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
  18. package/dist/id-compressor/persisted-types/0.0.1.js +6 -0
  19. package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -1
  20. package/dist/id-compressor/persisted-types/index.d.ts +1 -1
  21. package/dist/id-compressor/persisted-types/index.d.ts.map +1 -1
  22. package/dist/id-compressor/persisted-types/index.js +3 -0
  23. package/dist/id-compressor/persisted-types/index.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 +3 -1
  27. package/dist/index.js.map +1 -1
  28. package/package.json +126 -10
  29. package/src/dataStoreContext.ts +2 -1
  30. package/src/id-compressor/idCompressor.ts +32 -59
  31. package/src/id-compressor/identifiers.ts +10 -58
  32. package/src/id-compressor/index.ts +2 -19
  33. package/src/id-compressor/persisted-types/0.0.1.ts +18 -159
  34. package/src/id-compressor/persisted-types/index.ts +1 -8
  35. package/src/index.ts +1 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @fluidframework/runtime-definitions
2
2
 
3
+ ## 2.0.0-internal.6.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Remove use of @fluidframework/common-definitions ([#16638](https://github.com/microsoft/FluidFramework/issues/16638)) [a8c81509c9](https://github.com/microsoft/FluidFramework/commits/a8c81509c9bf09cfb2092ebcf7265205f9eb6dbf)
8
+
9
+ The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
10
+ imported from the **@fluidframework/core-interfaces** package:
11
+
12
+ - interface IDisposable
13
+ - interface IErrorEvent
14
+ - interface IErrorEvent
15
+ - interface IEvent
16
+ - interface IEventProvider
17
+ - interface ILoggingError
18
+ - interface ITaggedTelemetryPropertyType
19
+ - interface ITelemetryBaseEvent
20
+ - interface ITelemetryBaseLogger
21
+ - interface ITelemetryErrorEvent
22
+ - interface ITelemetryGenericEvent
23
+ - interface ITelemetryLogger
24
+ - interface ITelemetryPerformanceEvent
25
+ - interface ITelemetryProperties
26
+ - type ExtendEventProvider
27
+ - type IEventThisPlaceHolder
28
+ - type IEventTransformer
29
+ - type ReplaceIEventThisPlaceHolder
30
+ - type ReplaceIEventThisPlaceHolder
31
+ - type TelemetryEventCategory
32
+ - type TelemetryEventPropertyType
33
+
3
34
  ## 2.0.0-internal.6.1.0
4
35
 
5
36
  Dependency updates only.
package/README.md CHANGED
@@ -13,9 +13,10 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
13
13
  While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
14
14
  library consumers should always prefer `^`.
15
15
 
16
- Note that when depending on a library version of the form 2.0.0-internal.x.y.z, called the Fluid internal version
17
- scheme, you must use a `>= <` dependency range. Standard `^` and `~` ranges will not work as expected. See the
18
- [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
16
+ Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
17
+ you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
18
+ Standard `^` and `~` ranges will not work as expected.
19
+ See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
19
20
  package for more information including tools to convert between version schemes.
20
21
 
21
22
  <!-- prettier-ignore-end -->
@@ -2,8 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
6
- import { ITelemetryBaseLogger, IDisposable, IFluidRouter, IProvideFluidHandleContext, IFluidHandle, IRequest, IResponse, FluidObject } from "@fluidframework/core-interfaces";
5
+ import { IEvent, IEventProvider, ITelemetryBaseLogger, IDisposable, IFluidRouter, IProvideFluidHandleContext, IFluidHandle, IRequest, IResponse, FluidObject } from "@fluidframework/core-interfaces";
7
6
  import { IAudience, IDeltaManager, AttachState, ILoaderOptions } from "@fluidframework/container-definitions";
8
7
  import { IDocumentStorageService } from "@fluidframework/driver-definitions";
9
8
  import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EACN,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC1B,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE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B,GACtC,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwCH;;GAEG;AACH,IAAY,SAWX;AAXD,WAAY,SAAS;IACpB;;OAEG;IACH,mDAAS,CAAA;IAET;;;OAGG;IACH,mDAAS,CAAA;AACV,CAAC,EAXW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWpB;AAED,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAChC;;;;;;;;OAQG;IACH,mEAAS,CAAA;AACV,CAAC,EAXW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAWhC;AAED;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,YAAY;IAExB;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;;;OAQG;IACH,eAAe,EAAE,iBAAiB;CAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport {\n\tITelemetryBaseLogger,\n\tIDisposable,\n\tIFluidRouter,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n\tFluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tIAudience,\n\tIDeltaManager,\n\tAttachState,\n\tILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IProvideFluidDataStoreFactory } from \"./dataStoreFactory\";\nimport { IProvideFluidDataStoreRegistry } from \"./dataStoreRegistry\";\nimport { IGarbageCollectionData, IGarbageCollectionDetailsBase } from \"./garbageCollection\";\nimport { IInboundSignalMessage } from \"./protocol\";\nimport {\n\tCreateChildSummarizerNodeParam,\n\tISummarizerNodeWithGC,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n} from \"./summary\";\nimport { IIdCompressor } from \"./id-compressor\";\n\n/**\n * Runtime flush mode handling\n */\nexport enum FlushMode {\n\t/**\n\t * In Immediate flush mode the runtime will immediately send all operations to the driver layer.\n\t */\n\tImmediate,\n\n\t/**\n\t * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single\n\t * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.\n\t */\n\tTurnBased,\n}\n\nexport enum FlushModeExperimental {\n\t/**\n\t * When in Async flush mode, the runtime will accumulate all operations across JS turns and send them as a single\n\t * batch when all micro-tasks are complete.\n\t *\n\t * This feature requires a version of the loader which supports reference sequence numbers. If an older version of\n\t * the loader is used, the runtime will fall back on FlushMode.TurnBased.\n\t *\n\t * @experimental - Not ready for use\n\t */\n\tAsync = 2,\n}\n\n/**\n * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible\n * locally within the container only or visible globally to all clients.\n */\nexport const VisibilityState = {\n\t/**\n\t * Indicates that the object is not visible. This is the state when an object is first created.\n\t */\n\tNotVisible: \"NotVisible\",\n\n\t/**\n\t * Indicates that the object is visible locally within the container. This is the state when an object is attached\n\t * to the container's graph but the container itself isn't globally visible. The object's state goes from not\n\t * visible to locally visible.\n\t */\n\tLocallyVisible: \"LocallyVisible\",\n\n\t/**\n\t * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:\n\t *\n\t * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from\n\t * not visible to globally visible.\n\t *\n\t * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally\n\t * visible.\n\t */\n\tGloballyVisible: \"GloballyVisible\",\n};\nexport type VisibilityState = typeof VisibilityState[keyof typeof VisibilityState];\n\nexport interface IContainerRuntimeBaseEvents extends IEvent {\n\t(event: \"batchBegin\", listener: (op: ISequencedDocumentMessage) => void);\n\t/**\n\t * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. it's type and content\n\t * represent internal container runtime type / content.\n\t */\n\t(event: \"op\", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);\n\t(event: \"batchEnd\", listener: (error: any, op: ISequencedDocumentMessage) => void);\n\t(event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n}\n\n/**\n * Encapsulates the return codes of the aliasing API.\n *\n * 'Success' - the datastore has been successfully aliased. It can now be used.\n * 'Conflict' - there is already a datastore bound to the provided alias. To acquire it's entry point, use\n * the `IContainerRuntime.getAliasedDataStoreEntryPoint` function. The current datastore should be discarded\n * and will be garbage collected. The current datastore cannot be aliased to a different value.\n * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.\n */\nexport type AliasResult = \"Success\" | \"Conflict\" | \"AlreadyAliased\";\n\n/**\n * Exposes some functionality/features of a data store:\n * - Handle to the data store's entryPoint\n * - Fluid router for the data store\n * - Can be assigned an alias\n */\nexport interface IDataStore {\n\t/**\n\t * Attempt to assign an alias to the datastore.\n\t * If the operation succeeds, the datastore can be referenced\n\t * by the supplied alias and will not be garbage collected.\n\t *\n\t * @param alias - Given alias for this datastore.\n\t * @returns A promise with the {@link AliasResult}\n\t */\n\ttrySetAlias(alias: string): Promise<AliasResult>;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting\n\t * with it. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented in a\n\t * particular scenario) fall back to the current approach of requesting the root object through the request pattern.\n\t *\n\t * @remarks The plan is that eventually the data store will stop providing IFluidRouter functionality, this property\n\t * will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access\n\t * the data store's entryPoint.\n\t */\n\treadonly entryPoint?: IFluidHandle<FluidObject>;\n\n\t/**\n\t * IMPORTANT: This overload is provided for back-compat where IDataStore.request(\\{ url: \"/\" \\}) is already implemented and used.\n\t * The functionality it can provide (if the DataStore implementation is built for it) is redundant with @see {@link IDataStore.entryPoint}.\n\t * Once that API is mandatory on IDataStore, this overload will be deprecated.\n\t *\n\t * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.\n\t *\n\t * @param request - Only requesting \\{ url: \"/\" \\} is supported, requesting arbitrary URLs is deprecated.\n\t */\n\trequest(request: { url: \"/\"; headers?: undefined }): Promise<IResponse>;\n\n\t/**\n\t * Issue a request against the DataStore for a resource within it.\n\t * @param request - The request to be issued against the DataStore\n\t *\n\t * @deprecated - Requesting an arbitrary URL with headers will not be supported in a future major release.\n\t * Instead, access the objects within the DataStore using entryPoint, and then navigate from there using\n\t * app-specific logic (e.g. retrieving a handle from a DDS, or the entryPoint object could implement a request paradigm itself)\n\t *\n\t * NOTE: IDataStore.request(\\{url: \"/\"\\}) is not yet deprecated. If and only if the DataStore implementation supports it,\n\t * that overload may be used as a proxy for getting the entryPoint until {@link IDataStore.entryPoint} is mandatory.\n\t *\n\t * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\treadonly IFluidRouter: IFluidRouter;\n}\n\n/**\n * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need\n * TODO: this should be merged into IFluidDataStoreContext\n */\nexport interface IContainerRuntimeBase\n\textends IEventProvider<IContainerRuntimeBaseEvents>,\n\t\tIProvideFluidHandleContext {\n\treadonly logger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\n\t/**\n\t * Invokes the given callback and guarantees that all operations generated within the callback will be ordered\n\t * sequentially. Total size of all messages must be less than maxOpSize.\n\t */\n\torderSequentially(callback: () => void): void;\n\n\t/**\n\t * Executes a request against the container runtime\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Submits a container runtime level signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal.\n\t */\n\tsubmitSignal(type: string, content: any): void;\n\n\t/**\n\t * @deprecated 0.16 Issue #1537, #3631\n\t * @internal\n\t */\n\t_createDataStoreWithProps(\n\t\tpkg: string | string[],\n\t\tprops?: any,\n\t\tid?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves\n\t * as the data store's router. The data store is not bound to a container, and in such state is not persisted to\n\t * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an\n\t * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this\n\t * store being attached to storage.\n\t * @param pkg - Package name of the data store factory\n\t */\n\tcreateDataStore(pkg: string | string[]): Promise<IDataStore>;\n\n\t/**\n\t * Creates detached data store context. Only after context.attachRuntime() is called,\n\t * data store initialization is considered complete.\n\t */\n\tcreateDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tuploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n}\n\n/**\n * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.\n *\n * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,\n * and connection state notifications\n */\nexport interface IFluidDataStoreChannel extends IDisposable {\n\treadonly id: string;\n\n\t/**\n\t * Indicates the attachment state of the channel to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\treadonly visibilityState: VisibilityState;\n\n\t/**\n\t * Runs through the graph and attaches the bound handles. Then binds this runtime to the container.\n\t * @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.\n\t */\n\tattachGraph(): void;\n\n\t/**\n\t * Makes the data store channel visible in the container. Also, runs through its graph and attaches all\n\t * bound handles that represent its dependencies in the container's graph.\n\t */\n\tmakeVisibleAndAttachGraph(): void;\n\n\t/**\n\t * Retrieves the summary used as part of the initial summary message\n\t */\n\tgetAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n\t/**\n\t * Processes the op.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;\n\n\t/**\n\t * Processes the signal.\n\t */\n\tprocessSignal(message: any, local: boolean): void;\n\n\t/**\n\t * Generates a summary for the channel.\n\t * Introduced with summarizerNode - will be required in a future release.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree.\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n\t * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * After GC has run, called to notify this channel of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in this channel.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. It's old ID when in disconnected state and\n\t * it's new client ID when we are connecting or connected.\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\treSubmit(type: string, content: any, localOpMetadata: unknown);\n\n\tapplyStashedOp(content: any): Promise<unknown>;\n\n\t/**\n\t * Revert a local message.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\trollback?(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting\n\t * with the component. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented\n\t * in a particular scenario) fall back to the current approach of requesting the root object through the request\n\t * pattern.\n\t *\n\t * @remarks The plan is that eventually the component will stop providing IFluidRouter functionality, this property\n\t * will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access\n\t * the component's entryPoint.\n\t */\n\treadonly entryPoint?: IFluidHandle<FluidObject>;\n\n\t/**\n\t * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\treadonly IFluidRouter: IFluidRouter;\n}\n\nexport type CreateChildSummarizerNodeFn = (\n\tsummarizeInternal: SummarizeInternalFn,\n\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t/**\n\t * @deprecated - The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n) => ISummarizerNodeWithGC;\n\nexport interface IFluidDataStoreContextEvents extends IEvent {\n\t(event: \"attaching\" | \"attached\", listener: () => void);\n}\n\n/**\n * Represents the context for the data store. It is used by the data store runtime to\n * get information and call functionality to the container.\n */\nexport interface IFluidDataStoreContext\n\textends IEventProvider<IFluidDataStoreContextEvents>,\n\t\tPartial<IProvideFluidDataStoreRegistry>,\n\t\tIProvideFluidHandleContext {\n\treadonly id: string;\n\t/**\n\t * A data store created by a client, is a local data store for that client. Also, when a detached container loads\n\t * from a snapshot, all the data stores are treated as local data stores because at that stage the container\n\t * still doesn't exists in storage and so the data store couldn't have been created by any other client.\n\t * Value of this never changes even after the data store is attached.\n\t * As implementer of data store runtime, you can use this property to check that this data store belongs to this\n\t * client and hence implement any scenario based on that.\n\t */\n\treadonly isLocalDataStore: boolean;\n\t/**\n\t * The package path of the data store as per the package factory.\n\t */\n\treadonly packagePath: readonly string[];\n\treadonly options: ILoaderOptions;\n\treadonly clientId: string | undefined;\n\treadonly connected: boolean;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IDocumentStorageService;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly logger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly idCompressor?: IIdCompressor;\n\t/**\n\t * Indicates the attachment state of the data store to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\treadonly containerRuntime: IContainerRuntimeBase;\n\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\treadonly createProps?: any;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Invokes the given callback and expects that no ops are submitted\n\t * until execution finishes. If an op is submitted, an error will be raised.\n\t *\n\t * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`\n\t *\n\t * @param callback - the callback to be invoked\n\t */\n\tensureNoDataModelChanges<T>(callback: () => T): T;\n\n\t/**\n\t * Submits the message to be sent to other clients.\n\t * @param type - Type of the message.\n\t * @param content - Content of the message.\n\t * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to\n\t * the server. This will be sent back when this message is received back from the server. This is also sent if\n\t * we are asked to resubmit the message.\n\t */\n\tsubmitMessage(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal.\n\t */\n\tsubmitSignal(type: string, content: any): void;\n\n\t/**\n\t * @deprecated To be removed in favor of makeVisible.\n\t * Register the runtime to the container\n\t */\n\tbindToContext(): void;\n\n\t/**\n\t * Called to make the data store locally visible in the container. This happens automatically for root data stores\n\t * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.\n\t */\n\tmakeLocallyVisible(): void;\n\n\t/**\n\t * Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.\n\t * @param address - The address of the channel that is dirty.\n\t */\n\tsetChannelDirty(address: string): void;\n\n\t/**\n\t * Get an absolute url to the container based on the provided relativeUrl.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tgetCreateChildSummarizerNodeFn(\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t * If it is local, it will throw unsupported errors on calls to summarize.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): CreateChildSummarizerNodeFn;\n\n\tuploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;\n\n\t/**\n\t * @deprecated - The functionality to get base GC details has been moved to summarizer node.\n\t *\n\t * Returns the GC details in the initial summary of this data store. This is used to initialize the data store\n\t * and its children with the GC details from the previous summary.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t * @param srcHandle - The handle of the node that added the reference.\n\t * @param outboundHandle - The handle of the outbound node that is referenced.\n\t */\n\taddedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;\n}\n\nexport interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {\n\t/**\n\t * Binds a runtime to the context.\n\t */\n\tattachRuntime(\n\t\tfactory: IProvideFluidDataStoreFactory,\n\t\tdataStoreRuntime: IFluidDataStoreChannel,\n\t): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyCH;;GAEG;AACH,IAAY,SAWX;AAXD,WAAY,SAAS;IACpB;;OAEG;IACH,mDAAS,CAAA;IAET;;;OAGG;IACH,mDAAS,CAAA;AACV,CAAC,EAXW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWpB;AAED,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAChC;;;;;;;;OAQG;IACH,mEAAS,CAAA;AACV,CAAC,EAXW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAWhC;AAED;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,YAAY;IAExB;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;;;OAQG;IACH,eAAe,EAAE,iBAAiB;CAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIEvent,\n\tIEventProvider,\n\tITelemetryBaseLogger,\n\tIDisposable,\n\tIFluidRouter,\n\tIProvideFluidHandleContext,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n\tFluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tIAudience,\n\tIDeltaManager,\n\tAttachState,\n\tILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n\tIClientDetails,\n\tIDocumentMessage,\n\tIQuorumClients,\n\tISequencedDocumentMessage,\n\tISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IProvideFluidDataStoreFactory } from \"./dataStoreFactory\";\nimport { IProvideFluidDataStoreRegistry } from \"./dataStoreRegistry\";\nimport { IGarbageCollectionData, IGarbageCollectionDetailsBase } from \"./garbageCollection\";\nimport { IInboundSignalMessage } from \"./protocol\";\nimport {\n\tCreateChildSummarizerNodeParam,\n\tISummarizerNodeWithGC,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n} from \"./summary\";\nimport { IIdCompressor } from \"./id-compressor\";\n\n/**\n * Runtime flush mode handling\n */\nexport enum FlushMode {\n\t/**\n\t * In Immediate flush mode the runtime will immediately send all operations to the driver layer.\n\t */\n\tImmediate,\n\n\t/**\n\t * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single\n\t * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.\n\t */\n\tTurnBased,\n}\n\nexport enum FlushModeExperimental {\n\t/**\n\t * When in Async flush mode, the runtime will accumulate all operations across JS turns and send them as a single\n\t * batch when all micro-tasks are complete.\n\t *\n\t * This feature requires a version of the loader which supports reference sequence numbers. If an older version of\n\t * the loader is used, the runtime will fall back on FlushMode.TurnBased.\n\t *\n\t * @experimental - Not ready for use\n\t */\n\tAsync = 2,\n}\n\n/**\n * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible\n * locally within the container only or visible globally to all clients.\n */\nexport const VisibilityState = {\n\t/**\n\t * Indicates that the object is not visible. This is the state when an object is first created.\n\t */\n\tNotVisible: \"NotVisible\",\n\n\t/**\n\t * Indicates that the object is visible locally within the container. This is the state when an object is attached\n\t * to the container's graph but the container itself isn't globally visible. The object's state goes from not\n\t * visible to locally visible.\n\t */\n\tLocallyVisible: \"LocallyVisible\",\n\n\t/**\n\t * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:\n\t *\n\t * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from\n\t * not visible to globally visible.\n\t *\n\t * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally\n\t * visible.\n\t */\n\tGloballyVisible: \"GloballyVisible\",\n};\nexport type VisibilityState = typeof VisibilityState[keyof typeof VisibilityState];\n\nexport interface IContainerRuntimeBaseEvents extends IEvent {\n\t(event: \"batchBegin\", listener: (op: ISequencedDocumentMessage) => void);\n\t/**\n\t * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. it's type and content\n\t * represent internal container runtime type / content.\n\t */\n\t(event: \"op\", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);\n\t(event: \"batchEnd\", listener: (error: any, op: ISequencedDocumentMessage) => void);\n\t(event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n}\n\n/**\n * Encapsulates the return codes of the aliasing API.\n *\n * 'Success' - the datastore has been successfully aliased. It can now be used.\n * 'Conflict' - there is already a datastore bound to the provided alias. To acquire it's entry point, use\n * the `IContainerRuntime.getAliasedDataStoreEntryPoint` function. The current datastore should be discarded\n * and will be garbage collected. The current datastore cannot be aliased to a different value.\n * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.\n */\nexport type AliasResult = \"Success\" | \"Conflict\" | \"AlreadyAliased\";\n\n/**\n * Exposes some functionality/features of a data store:\n * - Handle to the data store's entryPoint\n * - Fluid router for the data store\n * - Can be assigned an alias\n */\nexport interface IDataStore {\n\t/**\n\t * Attempt to assign an alias to the datastore.\n\t * If the operation succeeds, the datastore can be referenced\n\t * by the supplied alias and will not be garbage collected.\n\t *\n\t * @param alias - Given alias for this datastore.\n\t * @returns A promise with the {@link AliasResult}\n\t */\n\ttrySetAlias(alias: string): Promise<AliasResult>;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting\n\t * with it. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented in a\n\t * particular scenario) fall back to the current approach of requesting the root object through the request pattern.\n\t *\n\t * @remarks The plan is that eventually the data store will stop providing IFluidRouter functionality, this property\n\t * will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access\n\t * the data store's entryPoint.\n\t */\n\treadonly entryPoint?: IFluidHandle<FluidObject>;\n\n\t/**\n\t * IMPORTANT: This overload is provided for back-compat where IDataStore.request(\\{ url: \"/\" \\}) is already implemented and used.\n\t * The functionality it can provide (if the DataStore implementation is built for it) is redundant with @see {@link IDataStore.entryPoint}.\n\t * Once that API is mandatory on IDataStore, this overload will be deprecated.\n\t *\n\t * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.\n\t *\n\t * @param request - Only requesting \\{ url: \"/\" \\} is supported, requesting arbitrary URLs is deprecated.\n\t */\n\trequest(request: { url: \"/\"; headers?: undefined }): Promise<IResponse>;\n\n\t/**\n\t * Issue a request against the DataStore for a resource within it.\n\t * @param request - The request to be issued against the DataStore\n\t *\n\t * @deprecated - Requesting an arbitrary URL with headers will not be supported in a future major release.\n\t * Instead, access the objects within the DataStore using entryPoint, and then navigate from there using\n\t * app-specific logic (e.g. retrieving a handle from a DDS, or the entryPoint object could implement a request paradigm itself)\n\t *\n\t * NOTE: IDataStore.request(\\{url: \"/\"\\}) is not yet deprecated. If and only if the DataStore implementation supports it,\n\t * that overload may be used as a proxy for getting the entryPoint until {@link IDataStore.entryPoint} is mandatory.\n\t *\n\t * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\treadonly IFluidRouter: IFluidRouter;\n}\n\n/**\n * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need\n * TODO: this should be merged into IFluidDataStoreContext\n */\nexport interface IContainerRuntimeBase\n\textends IEventProvider<IContainerRuntimeBaseEvents>,\n\t\tIProvideFluidHandleContext {\n\treadonly logger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\n\t/**\n\t * Invokes the given callback and guarantees that all operations generated within the callback will be ordered\n\t * sequentially. Total size of all messages must be less than maxOpSize.\n\t */\n\torderSequentially(callback: () => void): void;\n\n\t/**\n\t * Executes a request against the container runtime\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * Submits a container runtime level signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal.\n\t */\n\tsubmitSignal(type: string, content: any): void;\n\n\t/**\n\t * @deprecated 0.16 Issue #1537, #3631\n\t * @internal\n\t */\n\t_createDataStoreWithProps(\n\t\tpkg: string | string[],\n\t\tprops?: any,\n\t\tid?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves\n\t * as the data store's router. The data store is not bound to a container, and in such state is not persisted to\n\t * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an\n\t * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this\n\t * store being attached to storage.\n\t * @param pkg - Package name of the data store factory\n\t */\n\tcreateDataStore(pkg: string | string[]): Promise<IDataStore>;\n\n\t/**\n\t * Creates detached data store context. Only after context.attachRuntime() is called,\n\t * data store initialization is considered complete.\n\t */\n\tcreateDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tuploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n}\n\n/**\n * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.\n *\n * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,\n * and connection state notifications\n */\nexport interface IFluidDataStoreChannel extends IDisposable {\n\treadonly id: string;\n\n\t/**\n\t * Indicates the attachment state of the channel to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\treadonly visibilityState: VisibilityState;\n\n\t/**\n\t * Runs through the graph and attaches the bound handles. Then binds this runtime to the container.\n\t * @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.\n\t */\n\tattachGraph(): void;\n\n\t/**\n\t * Makes the data store channel visible in the container. Also, runs through its graph and attaches all\n\t * bound handles that represent its dependencies in the container's graph.\n\t */\n\tmakeVisibleAndAttachGraph(): void;\n\n\t/**\n\t * Retrieves the summary used as part of the initial summary message\n\t */\n\tgetAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n\t/**\n\t * Processes the op.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;\n\n\t/**\n\t * Processes the signal.\n\t */\n\tprocessSignal(message: any, local: boolean): void;\n\n\t/**\n\t * Generates a summary for the channel.\n\t * Introduced with summarizerNode - will be required in a future release.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree.\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n\t * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * After GC has run, called to notify this channel of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in this channel.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. It's old ID when in disconnected state and\n\t * it's new client ID when we are connecting or connected.\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\treSubmit(type: string, content: any, localOpMetadata: unknown);\n\n\tapplyStashedOp(content: any): Promise<unknown>;\n\n\t/**\n\t * Revert a local message.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\trollback?(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting\n\t * with the component. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented\n\t * in a particular scenario) fall back to the current approach of requesting the root object through the request\n\t * pattern.\n\t *\n\t * @remarks The plan is that eventually the component will stop providing IFluidRouter functionality, this property\n\t * will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access\n\t * the component's entryPoint.\n\t */\n\treadonly entryPoint?: IFluidHandle<FluidObject>;\n\n\t/**\n\t * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\trequest(request: IRequest): Promise<IResponse>;\n\n\t/**\n\t * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\treadonly IFluidRouter: IFluidRouter;\n}\n\nexport type CreateChildSummarizerNodeFn = (\n\tsummarizeInternal: SummarizeInternalFn,\n\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t/**\n\t * @deprecated - The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n) => ISummarizerNodeWithGC;\n\nexport interface IFluidDataStoreContextEvents extends IEvent {\n\t(event: \"attaching\" | \"attached\", listener: () => void);\n}\n\n/**\n * Represents the context for the data store. It is used by the data store runtime to\n * get information and call functionality to the container.\n */\nexport interface IFluidDataStoreContext\n\textends IEventProvider<IFluidDataStoreContextEvents>,\n\t\tPartial<IProvideFluidDataStoreRegistry>,\n\t\tIProvideFluidHandleContext {\n\treadonly id: string;\n\t/**\n\t * A data store created by a client, is a local data store for that client. Also, when a detached container loads\n\t * from a snapshot, all the data stores are treated as local data stores because at that stage the container\n\t * still doesn't exists in storage and so the data store couldn't have been created by any other client.\n\t * Value of this never changes even after the data store is attached.\n\t * As implementer of data store runtime, you can use this property to check that this data store belongs to this\n\t * client and hence implement any scenario based on that.\n\t */\n\treadonly isLocalDataStore: boolean;\n\t/**\n\t * The package path of the data store as per the package factory.\n\t */\n\treadonly packagePath: readonly string[];\n\treadonly options: ILoaderOptions;\n\treadonly clientId: string | undefined;\n\treadonly connected: boolean;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IDocumentStorageService;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly logger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly idCompressor?: IIdCompressor;\n\t/**\n\t * Indicates the attachment state of the data store to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\treadonly containerRuntime: IContainerRuntimeBase;\n\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\treadonly createProps?: any;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Invokes the given callback and expects that no ops are submitted\n\t * until execution finishes. If an op is submitted, an error will be raised.\n\t *\n\t * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`\n\t *\n\t * @param callback - the callback to be invoked\n\t */\n\tensureNoDataModelChanges<T>(callback: () => T): T;\n\n\t/**\n\t * Submits the message to be sent to other clients.\n\t * @param type - Type of the message.\n\t * @param content - Content of the message.\n\t * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to\n\t * the server. This will be sent back when this message is received back from the server. This is also sent if\n\t * we are asked to resubmit the message.\n\t */\n\tsubmitMessage(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal.\n\t */\n\tsubmitSignal(type: string, content: any): void;\n\n\t/**\n\t * @deprecated To be removed in favor of makeVisible.\n\t * Register the runtime to the container\n\t */\n\tbindToContext(): void;\n\n\t/**\n\t * Called to make the data store locally visible in the container. This happens automatically for root data stores\n\t * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.\n\t */\n\tmakeLocallyVisible(): void;\n\n\t/**\n\t * Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.\n\t * @param address - The address of the channel that is dirty.\n\t */\n\tsetChannelDirty(address: string): void;\n\n\t/**\n\t * Get an absolute url to the container based on the provided relativeUrl.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tgetCreateChildSummarizerNodeFn(\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t * If it is local, it will throw unsupported errors on calls to summarize.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): CreateChildSummarizerNodeFn;\n\n\tuploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;\n\n\t/**\n\t * @deprecated - The functionality to get base GC details has been moved to summarizer node.\n\t *\n\t * Returns the GC details in the initial summary of this data store. This is used to initialize the data store\n\t * and its children with the GC details from the previous summary.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t * @param srcHandle - The handle of the node that added the reference.\n\t * @param outboundHandle - The handle of the outbound node that is referenced.\n\t */\n\taddedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;\n}\n\nexport interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {\n\t/**\n\t * Binds a runtime to the context.\n\t */\n\tattachRuntime(\n\t\tfactory: IProvideFluidDataStoreFactory,\n\t\tdataStoreRuntime: IFluidDataStoreChannel,\n\t): Promise<void>;\n}\n"]}
@@ -2,22 +2,21 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { SessionSpaceCompressedId, OpSpaceCompressedId, SessionId, FinalCompressedId, StableId } from "./identifiers";
5
+ import { SessionSpaceCompressedId, OpSpaceCompressedId, SessionId, StableId } from "./identifiers";
6
6
  import { IdCreationRange, SerializedIdCompressorWithNoSession, SerializedIdCompressorWithOngoingSession } from "./persisted-types";
7
7
  export interface IIdCompressorCore {
8
- clusterCapacity: number;
8
+ /**
9
+ * Returns a range of IDs created by this session in a format for sending to the server for finalizing.
10
+ * The range will include all IDs generated via calls to `generateCompressedId` since the last time this method was called.
11
+ * @returns the range of IDs, which may be empty. This range must be sent to the server for ordering before
12
+ * it is finalized. Ranges must be sent to the server in the order that they are taken via calls to this method.
13
+ */
14
+ takeNextCreationRange(): IdCreationRange;
9
15
  /**
10
16
  * Finalizes the supplied range of IDs (which may be from either a remote or local session).
11
17
  * @param range - the range of session-local IDs to finalize.
12
18
  */
13
19
  finalizeCreationRange(range: IdCreationRange): void;
14
- /**
15
- * Returns a range of local IDs created by this session in a format for sending to the server for finalizing.
16
- * The range will include all local IDs generated via calls to `generateCompressedId` since the last time this method was called.
17
- * @returns the range of session-local IDs, which may be empty. This range must be sent to the server for ordering before
18
- * it is finalized. Ranges must be sent to the server in the order that they are taken via calls to this method.
19
- */
20
- takeNextCreationRange(): IdCreationRange;
21
20
  /**
22
21
  * Returns a persistable form of the current state of this `IdCompressor` which can be rehydrated via `IdCompressor.deserialize()`.
23
22
  * This includes finalized state as well as un-finalized state and is therefore suitable for use in offline scenarios.
@@ -41,38 +40,35 @@ export interface IIdCompressorCore {
41
40
  *
42
41
  * For each stable ID created, two numeric IDs are provided by the compressor:
43
42
  *
44
- * 1. A local ID, which is stable for the lifetime of the session (which could be longer than that of the compressor object, as it may
45
- * be serialized for offline usage). Available as soon as the stable ID is allocated. Local IDs are session-unique and are thus only
46
- * publicly usable by the compressor that created the stable ID.
43
+ * 1. A session-local ID, which is stable for the lifetime of the session (which could be longer than that of the compressor object, as it may
44
+ * be serialized for offline usage). Available as soon as the stable ID is allocated. These IDs are session-unique and are thus only
45
+ * safely usable within the scope of the compressor that created it.
47
46
  *
48
47
  * 2. A final ID, which is stable across serialization and deserialization of an IdCompressor. Available as soon as the range containing
49
- * the corresponding local ID is totally ordered (via consensus) with respect to other sessions' allocations.
48
+ * the corresponding session-local ID is totally ordered (via consensus) with respect to other sessions' allocations.
50
49
  * Final IDs are known to and publicly usable by any compressor that has received them.
51
50
  *
52
51
  * Compressors will allocate UUIDs in non-random ways to reduce entropy allowing for optimized storage of the data needed
53
52
  * to map the UUIDs to the numbers.
54
53
  *
55
- * A client may optionally supply an "override" for any generated ID, associating an arbitrary string with the local/final ID rather than
56
- * the UUID that would otherwise be created.
57
- *
58
54
  * The following invariants are upheld by IdCompressor:
59
55
  *
60
- * 1. Local IDs will always decompress to the same UUIDs (or override string) for the lifetime of the session.
56
+ * 1. Session-local IDs will always decompress to the same UUIDs for the lifetime of the session.
61
57
  *
62
- * 2. Final IDs will always decompress to the same UUIDs (or override string).
58
+ * 2. Final IDs will always decompress to the same UUIDs.
63
59
  *
64
- * 3. After a server-processed range of local IDs (from any session) is received by a compressor, any of those local IDs may be
65
- * translated by the compressor into the corresponding final ID. For any given local ID, this translation will always yield the
60
+ * 3. After a server-processed range of session-local IDs (from any session) is received by a compressor, any of those session-local IDs may be
61
+ * translated by the compressor into the corresponding final ID. For any given session-local ID, this translation will always yield the
66
62
  * same final ID.
67
63
  *
68
- * 4. A UUID (or override string) will always compress into the same session-space ID for the lifetime of the session.
64
+ * 4. A UUID will always compress into the same session-local ID for the lifetime of the session.
69
65
  *
70
- * Local IDs are sent across the wire in efficiently-represented ranges. These ranges are created by querying the compressor, and *must*
66
+ * Session-local IDs are sent across the wire in efficiently-represented ranges. These ranges are created by querying the compressor, and *must*
71
67
  * be ordered (i.e. sent to the server) in the order they are created in order to preserve the above invariants.
72
68
  *
73
69
  * Session-local IDs can be used immediately after creation, but will eventually (after being sequenced) have a corresponding final ID. This
74
- * could make reasoning about equality of those two forms (the local and final) difficult. For example, if a cache is keyed off of a
75
- * local ID but is later queried using the final ID (which is semantically equal, as it decompresses to the same UUID/string) it will
70
+ * could make reasoning about equality of those two forms difficult. For example, if a cache is keyed off of a
71
+ * session-local ID but is later queried using the final ID (which is semantically equal, as it decompresses to the same UUID/string) it will
76
72
  * produce a cache miss. In order to make using collections of both remotely created and locally created IDs easy, regardless of whether the
77
73
  * session-local IDs have been finalized, the compressor defines two "spaces" of IDs:
78
74
  *
@@ -85,7 +81,7 @@ export interface IIdCompressorCore {
85
81
  * 2. Op space: in this space, all IDs are normalized to their "most final form". This means that all IDs except session-local IDs that
86
82
  * have not yet been finalized will be in final ID form. This space is useful for serialization in ops (e.g. references), as other clients
87
83
  * that receive them need not do any work to normalize them to *their* session-space in the common case. Note that IDs in op space may move
88
- * out of Op space over time, namely, when a local ID in this space becomes finalized, and thereafter has a "more final form".
84
+ * out of Op space over time, namely, when a session-local ID in this space becomes finalized, and thereafter has a "more final form".
89
85
  * Consequentially, it may be useful to restrict parameters of a persisted type to this space (to optimize perf), but it is potentially
90
86
  * incorrect to use this type for a runtime variable. This is an asymmetry that does not affect session space, as local IDs are always as
91
87
  * "local as possible".
@@ -99,11 +95,9 @@ export interface IIdCompressor {
99
95
  /**
100
96
  * Generates a new compressed ID or returns an existing one.
101
97
  * This should ONLY be called to generate IDs for local operations.
102
- * @param override - Specifies a specific string to be associated with the returned compressed ID.
103
- * Performance note: assigning override strings incurs a performance overhead.
104
- * @returns an existing ID if one already exists for `override`, and a new local ID otherwise. The returned ID is in session space.
98
+ * @returns A new local ID in session space.
105
99
  */
106
- generateCompressedId(override?: string): SessionSpaceCompressedId;
100
+ generateCompressedId(): SessionSpaceCompressedId;
107
101
  /**
108
102
  * Normalizes a session space ID into op space.
109
103
  * @param id - the local ID to normalize.
@@ -121,34 +115,22 @@ export interface IIdCompressor {
121
115
  */
122
116
  normalizeToSessionSpace(id: OpSpaceCompressedId, originSessionId: SessionId): SessionSpaceCompressedId;
123
117
  /**
124
- * Normalizes a final ID into session space.
125
- * @param id - the final ID to normalize.
126
- * @returns the session-space ID corresponding to `id`.
127
- */
128
- normalizeToSessionSpace(id: FinalCompressedId): SessionSpaceCompressedId;
129
- /**
130
- * Decompresses a previously compressed ID into a UUID or override string.
131
- * @param id - the compressed ID to be decompressed.
132
- * @returns the UUID or override string associated with the compressed ID. Fails if the ID was not generated by this compressor.
133
- */
134
- decompress(id: SessionSpaceCompressedId | FinalCompressedId): StableId | string;
135
- /**
136
- * Attempts to decompress a previously compressed ID into a UUID or override string.
118
+ * Decompresses a previously compressed ID into a UUID.
137
119
  * @param id - the compressed ID to be decompressed.
138
- * @returns the UUID or override string associated with the compressed ID, or undefined if the ID was not generated by this compressor.
120
+ * @returns the UUID associated with the compressed ID. Fails if the ID was not generated by this compressor.
139
121
  */
140
- tryDecompress(id: SessionSpaceCompressedId | FinalCompressedId): StableId | string | undefined;
122
+ decompress(id: SessionSpaceCompressedId): StableId;
141
123
  /**
142
- * Recompresses a decompressed ID, which could be a UUID or an override string.
143
- * @param uncompressed - the UUID or override string to recompress.
124
+ * Recompresses a UUID.
125
+ * @param uncompressed - the UUID to recompress.
144
126
  * @returns the `CompressedId` associated with `uncompressed`. Fails if it has not been previously compressed by this compressor.
145
127
  */
146
- recompress(uncompressed: string): SessionSpaceCompressedId;
128
+ recompress(uncompressed: StableId): SessionSpaceCompressedId;
147
129
  /**
148
- * Attempts to recompresses a decompressed ID, which could be a UUID or an override string.
149
- * @param uncompressed - the UUID or override string to recompress,
130
+ * Attempts to recompresses a UUID.
131
+ * @param uncompressed - the UUID to recompress,
150
132
  * @returns the `CompressedId` associated with `uncompressed` or undefined if it has not been previously compressed by this compressor.
151
133
  */
152
- tryRecompress(uncompressed: string): SessionSpaceCompressedId | undefined;
134
+ tryRecompress(uncompressed: StableId): SessionSpaceCompressedId | undefined;
153
135
  }
154
136
  //# sourceMappingURL=idCompressor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"idCompressor.d.ts","sourceRoot":"","sources":["../../src/id-compressor/idCompressor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,wBAAwB,EACxB,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,eAAe,EACf,mCAAmC,EACnC,wCAAwC,EACxC,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,iBAAiB;IACjC,eAAe,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAEpD;;;;;OAKG;IACH,qBAAqB,IAAI,eAAe,CAAC;IAEzC;;;OAGG;IACH,SAAS,CAAC,WAAW,EAAE,IAAI,GAAG,wCAAw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BAAiB;IACjC;;;;;OAKG;IACH,qBAAqB,IAAI,eAAe,CAAC;IAEzC;;;OAGG;IACH,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAEpD;;;OAGG;IACH,SAAS,CAAC,WAAW,EAAE,IAAI,GAAG,wCAAwC,CAAC;IAEvE;;;OAGG;IACH,SAAS,CAAC,WAAW,EAAE,KAAK,GAAG,mCAAmC,CAAC;CACnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,MAAM,WAAW,aAAa;IAC7B,cAAc,EAAE,SAAS,CAAC;IAE1B;;;;OAIG;IACH,oBAAoB,IAAI,wBAAwB,CAAC;IACjD;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,EAAE,wBAAwB,GAAG,mBAAmB,CAAC;IACtE;;;;;;;;OAQG;IACH,uBAAuB,CACtB,EAAE,EAAE,mBAAmB,EACvB,eAAe,EAAE,SAAS,GACxB,wBAAwB,CAAC;IAE5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,wBAAwB,GAAG,QAAQ,CAAC;IAEnD;;;;OAIG;IACH,UAAU,CAAC,YAAY,EAAE,QAAQ,GAAG,wBAAwB,CAAC;IAE7D;;;;OAIG;IACH,aAAa,CAAC,YAAY,EAAE,QAAQ,GAAG,wBAAwB,GAAG,SAAS,CAAC;CAC5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"idCompressor.js","sourceRoot":"","sources":["../../src/id-compressor/idCompressor.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 {\n\tSessionSpaceCompressedId,\n\tOpSpaceCompressedId,\n\tSessionId,\n\tFinalCompressedId,\n\tStableId,\n} from \"./identifiers\";\nimport {\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n\tSerializedIdCompressorWithOngoingSession,\n} from \"./persisted-types\";\n\nexport interface IIdCompressorCore {\n\tclusterCapacity: number;\n\n\t/**\n\t * Finalizes the supplied range of IDs (which may be from either a remote or local session).\n\t * @param range - the range of session-local IDs to finalize.\n\t */\n\tfinalizeCreationRange(range: IdCreationRange): void;\n\n\t/**\n\t * Returns a range of local IDs created by this session in a format for sending to the server for finalizing.\n\t * The range will include all local IDs generated via calls to `generateCompressedId` since the last time this method was called.\n\t * @returns the range of session-local IDs, which may be empty. This range must be sent to the server for ordering before\n\t * it is finalized. Ranges must be sent to the server in the order that they are taken via calls to this method.\n\t */\n\ttakeNextCreationRange(): IdCreationRange;\n\n\t/**\n\t * Returns a persistable form of the current state of this `IdCompressor` which can be rehydrated via `IdCompressor.deserialize()`.\n\t * This includes finalized state as well as un-finalized state and is therefore suitable for use in offline scenarios.\n\t */\n\tserialize(withSession: true): SerializedIdCompressorWithOngoingSession;\n\n\t/**\n\t * Returns a persistable form of the current state of this `IdCompressor` which can be rehydrated via `IdCompressor.deserialize()`.\n\t * This only includes finalized state and is therefore suitable for use in summaries.\n\t */\n\tserialize(withSession: false): SerializedIdCompressorWithNoSession;\n}\n\n/**\n * A distributed UUID generator and compressor.\n *\n * Generates arbitrary non-colliding v4 UUIDs, called stable IDs, for multiple \"sessions\" (which can be distributed across the network),\n * providing each session with the ability to map these UUIDs to `numbers`.\n *\n * A session is a unique identifier that denotes a single compressor. New IDs are created through a single compressor API\n * which should then sent in ranges to the server for total ordering (and are subsequently relayed to other clients). When a new ID is\n * created it is said to be created by the compressor's \"local\" session.\n *\n * For each stable ID created, two numeric IDs are provided by the compressor:\n *\n * 1. A local ID, which is stable for the lifetime of the session (which could be longer than that of the compressor object, as it may\n * be serialized for offline usage). Available as soon as the stable ID is allocated. Local IDs are session-unique and are thus only\n * publicly usable by the compressor that created the stable ID.\n *\n * 2. A final ID, which is stable across serialization and deserialization of an IdCompressor. Available as soon as the range containing\n * the corresponding local ID is totally ordered (via consensus) with respect to other sessions' allocations.\n * Final IDs are known to and publicly usable by any compressor that has received them.\n *\n * Compressors will allocate UUIDs in non-random ways to reduce entropy allowing for optimized storage of the data needed\n * to map the UUIDs to the numbers.\n *\n * A client may optionally supply an \"override\" for any generated ID, associating an arbitrary string with the local/final ID rather than\n * the UUID that would otherwise be created.\n *\n * The following invariants are upheld by IdCompressor:\n *\n * 1. Local IDs will always decompress to the same UUIDs (or override string) for the lifetime of the session.\n *\n * 2. Final IDs will always decompress to the same UUIDs (or override string).\n *\n * 3. After a server-processed range of local IDs (from any session) is received by a compressor, any of those local IDs may be\n * translated by the compressor into the corresponding final ID. For any given local ID, this translation will always yield the\n * same final ID.\n *\n * 4. A UUID (or override string) will always compress into the same session-space ID for the lifetime of the session.\n *\n * Local IDs are sent across the wire in efficiently-represented ranges. These ranges are created by querying the compressor, and *must*\n * be ordered (i.e. sent to the server) in the order they are created in order to preserve the above invariants.\n *\n * Session-local IDs can be used immediately after creation, but will eventually (after being sequenced) have a corresponding final ID. This\n * could make reasoning about equality of those two forms (the local and final) difficult. For example, if a cache is keyed off of a\n * local ID but is later queried using the final ID (which is semantically equal, as it decompresses to the same UUID/string) it will\n * produce a cache miss. In order to make using collections of both remotely created and locally created IDs easy, regardless of whether the\n * session-local IDs have been finalized, the compressor defines two \"spaces\" of IDs:\n *\n * 1. Session space: in this space, all IDs are normalized to their \"most local form\". This means that all IDs created by the local session\n * will be in local form, regardless of if they have been finalized. Remotely created IDs, which could only have been received after\n * finalizing and will never have a local form for the compressor, will of course be final IDs. This space should be used with consumer APIs\n * and data structures, as the lifetime of the IDs is guaranteed to be the same as the compressor object. Care must be taken to not use\n * these IDs across compressor objects, as the local IDs are specific to the compressor that created them.\n *\n * 2. Op space: in this space, all IDs are normalized to their \"most final form\". This means that all IDs except session-local IDs that\n * have not yet been finalized will be in final ID form. This space is useful for serialization in ops (e.g. references), as other clients\n * that receive them need not do any work to normalize them to *their* session-space in the common case. Note that IDs in op space may move\n * out of Op space over time, namely, when a local ID in this space becomes finalized, and thereafter has a \"more final form\".\n * Consequentially, it may be useful to restrict parameters of a persisted type to this space (to optimize perf), but it is potentially\n * incorrect to use this type for a runtime variable. This is an asymmetry that does not affect session space, as local IDs are always as\n * \"local as possible\".\n *\n * These two spaces naturally define a rule: consumers of compressed IDs should use session-space IDs, but serialized forms such as ops\n * should use op-space IDs.\n *\n */\nexport interface IIdCompressor {\n\tlocalSessionId: SessionId;\n\n\t/**\n\t * Generates a new compressed ID or returns an existing one.\n\t * This should ONLY be called to generate IDs for local operations.\n\t * @param override - Specifies a specific string to be associated with the returned compressed ID.\n\t * Performance note: assigning override strings incurs a performance overhead.\n\t * @returns an existing ID if one already exists for `override`, and a new local ID otherwise. The returned ID is in session space.\n\t */\n\tgenerateCompressedId(override?: string): SessionSpaceCompressedId;\n\t/**\n\t * Normalizes a session space ID into op space.\n\t * @param id - the local ID to normalize.\n\t * @returns the ID in op space.\n\t */\n\tnormalizeToOpSpace(id: SessionSpaceCompressedId): OpSpaceCompressedId;\n\t/**\n\t * Normalizes an ID into session space.\n\t * @param id - the ID to normalize. If it is a local ID, it is assumed to have been created by the session corresponding\n\t * to `sessionId`.\n\t * @param originSessionId - the session from which `id` originated\n\t * @returns the session-space ID corresponding to `id`, which might not have been a final ID if the client that created it had not yet\n\t * finalized it. This can occur when a client references an ID during the window of time in which it is waiting to receive the ordered\n\t * range that contained it from the server.\n\t */\n\tnormalizeToSessionSpace(\n\t\tid: OpSpaceCompressedId,\n\t\toriginSessionId: SessionId,\n\t): SessionSpaceCompressedId;\n\n\t/**\n\t * Normalizes a final ID into session space.\n\t * @param id - the final ID to normalize.\n\t * @returns the session-space ID corresponding to `id`.\n\t */\n\tnormalizeToSessionSpace(id: FinalCompressedId): SessionSpaceCompressedId;\n\n\t/**\n\t * Decompresses a previously compressed ID into a UUID or override string.\n\t * @param id - the compressed ID to be decompressed.\n\t * @returns the UUID or override string associated with the compressed ID. Fails if the ID was not generated by this compressor.\n\t */\n\tdecompress(id: SessionSpaceCompressedId | FinalCompressedId): StableId | string;\n\n\t/**\n\t * Attempts to decompress a previously compressed ID into a UUID or override string.\n\t * @param id - the compressed ID to be decompressed.\n\t * @returns the UUID or override string associated with the compressed ID, or undefined if the ID was not generated by this compressor.\n\t */\n\ttryDecompress(id: SessionSpaceCompressedId | FinalCompressedId): StableId | string | undefined;\n\n\t/**\n\t * Recompresses a decompressed ID, which could be a UUID or an override string.\n\t * @param uncompressed - the UUID or override string to recompress.\n\t * @returns the `CompressedId` associated with `uncompressed`. Fails if it has not been previously compressed by this compressor.\n\t */\n\trecompress(uncompressed: string): SessionSpaceCompressedId;\n\n\t/**\n\t * Attempts to recompresses a decompressed ID, which could be a UUID or an override string.\n\t * @param uncompressed - the UUID or override string to recompress,\n\t * @returns the `CompressedId` associated with `uncompressed` or undefined if it has not been previously compressed by this compressor.\n\t */\n\ttryRecompress(uncompressed: string): SessionSpaceCompressedId | undefined;\n}\n"]}
1
+ {"version":3,"file":"idCompressor.js","sourceRoot":"","sources":["../../src/id-compressor/idCompressor.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 { SessionSpaceCompressedId, OpSpaceCompressedId, SessionId, StableId } from \"./identifiers\";\nimport {\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n\tSerializedIdCompressorWithOngoingSession,\n} from \"./persisted-types\";\n\nexport interface IIdCompressorCore {\n\t/**\n\t * Returns a range of IDs created by this session in a format for sending to the server for finalizing.\n\t * The range will include all IDs generated via calls to `generateCompressedId` since the last time this method was called.\n\t * @returns the range of IDs, which may be empty. This range must be sent to the server for ordering before\n\t * it is finalized. Ranges must be sent to the server in the order that they are taken via calls to this method.\n\t */\n\ttakeNextCreationRange(): IdCreationRange;\n\n\t/**\n\t * Finalizes the supplied range of IDs (which may be from either a remote or local session).\n\t * @param range - the range of session-local IDs to finalize.\n\t */\n\tfinalizeCreationRange(range: IdCreationRange): void;\n\n\t/**\n\t * Returns a persistable form of the current state of this `IdCompressor` which can be rehydrated via `IdCompressor.deserialize()`.\n\t * This includes finalized state as well as un-finalized state and is therefore suitable for use in offline scenarios.\n\t */\n\tserialize(withSession: true): SerializedIdCompressorWithOngoingSession;\n\n\t/**\n\t * Returns a persistable form of the current state of this `IdCompressor` which can be rehydrated via `IdCompressor.deserialize()`.\n\t * This only includes finalized state and is therefore suitable for use in summaries.\n\t */\n\tserialize(withSession: false): SerializedIdCompressorWithNoSession;\n}\n\n/**\n * A distributed UUID generator and compressor.\n *\n * Generates arbitrary non-colliding v4 UUIDs, called stable IDs, for multiple \"sessions\" (which can be distributed across the network),\n * providing each session with the ability to map these UUIDs to `numbers`.\n *\n * A session is a unique identifier that denotes a single compressor. New IDs are created through a single compressor API\n * which should then sent in ranges to the server for total ordering (and are subsequently relayed to other clients). When a new ID is\n * created it is said to be created by the compressor's \"local\" session.\n *\n * For each stable ID created, two numeric IDs are provided by the compressor:\n *\n * 1. A session-local ID, which is stable for the lifetime of the session (which could be longer than that of the compressor object, as it may\n * be serialized for offline usage). Available as soon as the stable ID is allocated. These IDs are session-unique and are thus only\n * safely usable within the scope of the compressor that created it.\n *\n * 2. A final ID, which is stable across serialization and deserialization of an IdCompressor. Available as soon as the range containing\n * the corresponding session-local ID is totally ordered (via consensus) with respect to other sessions' allocations.\n * Final IDs are known to and publicly usable by any compressor that has received them.\n *\n * Compressors will allocate UUIDs in non-random ways to reduce entropy allowing for optimized storage of the data needed\n * to map the UUIDs to the numbers.\n *\n * The following invariants are upheld by IdCompressor:\n *\n * 1. Session-local IDs will always decompress to the same UUIDs for the lifetime of the session.\n *\n * 2. Final IDs will always decompress to the same UUIDs.\n *\n * 3. After a server-processed range of session-local IDs (from any session) is received by a compressor, any of those session-local IDs may be\n * translated by the compressor into the corresponding final ID. For any given session-local ID, this translation will always yield the\n * same final ID.\n *\n * 4. A UUID will always compress into the same session-local ID for the lifetime of the session.\n *\n * Session-local IDs are sent across the wire in efficiently-represented ranges. These ranges are created by querying the compressor, and *must*\n * be ordered (i.e. sent to the server) in the order they are created in order to preserve the above invariants.\n *\n * Session-local IDs can be used immediately after creation, but will eventually (after being sequenced) have a corresponding final ID. This\n * could make reasoning about equality of those two forms difficult. For example, if a cache is keyed off of a\n * session-local ID but is later queried using the final ID (which is semantically equal, as it decompresses to the same UUID/string) it will\n * produce a cache miss. In order to make using collections of both remotely created and locally created IDs easy, regardless of whether the\n * session-local IDs have been finalized, the compressor defines two \"spaces\" of IDs:\n *\n * 1. Session space: in this space, all IDs are normalized to their \"most local form\". This means that all IDs created by the local session\n * will be in local form, regardless of if they have been finalized. Remotely created IDs, which could only have been received after\n * finalizing and will never have a local form for the compressor, will of course be final IDs. This space should be used with consumer APIs\n * and data structures, as the lifetime of the IDs is guaranteed to be the same as the compressor object. Care must be taken to not use\n * these IDs across compressor objects, as the local IDs are specific to the compressor that created them.\n *\n * 2. Op space: in this space, all IDs are normalized to their \"most final form\". This means that all IDs except session-local IDs that\n * have not yet been finalized will be in final ID form. This space is useful for serialization in ops (e.g. references), as other clients\n * that receive them need not do any work to normalize them to *their* session-space in the common case. Note that IDs in op space may move\n * out of Op space over time, namely, when a session-local ID in this space becomes finalized, and thereafter has a \"more final form\".\n * Consequentially, it may be useful to restrict parameters of a persisted type to this space (to optimize perf), but it is potentially\n * incorrect to use this type for a runtime variable. This is an asymmetry that does not affect session space, as local IDs are always as\n * \"local as possible\".\n *\n * These two spaces naturally define a rule: consumers of compressed IDs should use session-space IDs, but serialized forms such as ops\n * should use op-space IDs.\n *\n */\nexport interface IIdCompressor {\n\tlocalSessionId: SessionId;\n\n\t/**\n\t * Generates a new compressed ID or returns an existing one.\n\t * This should ONLY be called to generate IDs for local operations.\n\t * @returns A new local ID in session space.\n\t */\n\tgenerateCompressedId(): SessionSpaceCompressedId;\n\t/**\n\t * Normalizes a session space ID into op space.\n\t * @param id - the local ID to normalize.\n\t * @returns the ID in op space.\n\t */\n\tnormalizeToOpSpace(id: SessionSpaceCompressedId): OpSpaceCompressedId;\n\t/**\n\t * Normalizes an ID into session space.\n\t * @param id - the ID to normalize. If it is a local ID, it is assumed to have been created by the session corresponding\n\t * to `sessionId`.\n\t * @param originSessionId - the session from which `id` originated\n\t * @returns the session-space ID corresponding to `id`, which might not have been a final ID if the client that created it had not yet\n\t * finalized it. This can occur when a client references an ID during the window of time in which it is waiting to receive the ordered\n\t * range that contained it from the server.\n\t */\n\tnormalizeToSessionSpace(\n\t\tid: OpSpaceCompressedId,\n\t\toriginSessionId: SessionId,\n\t): SessionSpaceCompressedId;\n\n\t/**\n\t * Decompresses a previously compressed ID into a UUID.\n\t * @param id - the compressed ID to be decompressed.\n\t * @returns the UUID associated with the compressed ID. Fails if the ID was not generated by this compressor.\n\t */\n\tdecompress(id: SessionSpaceCompressedId): StableId;\n\n\t/**\n\t * Recompresses a UUID.\n\t * @param uncompressed - the UUID to recompress.\n\t * @returns the `CompressedId` associated with `uncompressed`. Fails if it has not been previously compressed by this compressor.\n\t */\n\trecompress(uncompressed: StableId): SessionSpaceCompressedId;\n\n\t/**\n\t * Attempts to recompresses a UUID.\n\t * @param uncompressed - the UUID to recompress,\n\t * @returns the `CompressedId` associated with `uncompressed` or undefined if it has not been previously compressed by this compressor.\n\t */\n\ttryRecompress(uncompressed: StableId): SessionSpaceCompressedId | undefined;\n}\n"]}
@@ -2,70 +2,29 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- /**
6
- * An identifier (UUID) that has been shortened by a distributed compression algorithm.
7
- * @alpha
8
- */
9
- export declare type CompressedId = FinalCompressedId | LocalCompressedId;
10
- /**
11
- * A brand for identity types that are unique within a particular session (SharedTree instance).
12
- */
13
- export interface SessionUnique {
14
- readonly SessionUnique: "cea55054-6b82-4cbf-ad19-1fa645ea3b3e";
15
- }
16
5
  /**
17
6
  * A compressed ID that has been normalized into "session space" (see `IdCompressor` for more).
18
- * Consumer-facing APIs and data structures should use session-space IDs as their lifetime and equality is stable and tied to the
19
- * compressor that produced them.
20
- * @alpha
7
+ * Consumer-facing APIs and data structures should use session-space IDs as their lifetime and equality is stable and tied to
8
+ * the scope of the session (i.e. compressor) that produced them.
21
9
  */
22
- export declare type SessionSpaceCompressedId = CompressedId & SessionUnique;
23
- /**
24
- * A compressed ID that has been normalized into "op space" (see `IdCompressor` for more).
25
- * Serialized/persisted structures (e.g. ops) should use op-space IDs as a performance optimization, as they require no normalizing when
26
- * received by a remote client due to the fact that op space for a given compressor is session space for all other compressors.
27
- */
28
- export declare type OpSpaceCompressedId = CompressedId & {
29
- readonly OpNormalized: "9209432d-a959-4df7-b2ad-767ead4dbcae";
10
+ export declare type SessionSpaceCompressedId = number & {
11
+ readonly SessionUnique: "cea55054-6b82-4cbf-ad19-1fa645ea3b3e";
30
12
  };
31
13
  /**
32
- * A compressed ID that is local to a document. Stable across all revisions of a document starting from the one in which it was created.
33
- * It should not be persisted outside of the history as it can only be decompressed in the context of the originating document.
34
- * If external persistence is needed (e.g. by a client), a StableId should be used instead.
35
- * @alpha
14
+ * A compressed ID that has been normalized into "op space".
15
+ * Serialized/persisted structures (e.g. ops) should use op-space IDs as a performance optimization, as they require less normalizing when
16
+ * received by a remote client due to the fact that op space for a given compressor is session space for all other compressors.
36
17
  */
37
- export declare type FinalCompressedId = number & {
38
- readonly FinalCompressedId: "5d83d1e2-98b7-4e4e-a889-54c855cfa73d";
18
+ export declare type OpSpaceCompressedId = number & {
39
19
  readonly OpNormalized: "9209432d-a959-4df7-b2ad-767ead4dbcae";
40
20
  };
41
21
  /**
42
- * A compressed ID that is local to a session (can only be decompressed when paired with a SessionId).
43
- * It should not be persisted outside of the history as it can only be decompressed in the context of the originating session.
44
- * If external persistence is needed (e.g. by a client), a StableId should be used instead.
45
- * @alpha
46
- */
47
- export declare type LocalCompressedId = number & {
48
- readonly LocalCompressedId: "6fccb42f-e2a4-4243-bd29-f13d12b9c6d1";
49
- } & SessionUnique;
50
- export interface NodeIdBrand {
51
- readonly NodeId: "e53e7d6b-c8b9-431a-8805-4843fc639342";
52
- }
53
- /**
54
- * Type-safe identifiers for specific use cases.
55
- */
56
- /**
22
+ * A version 4, variant 1 uuid (https://datatracker.ietf.org/doc/html/rfc4122).
57
23
  * A 128-bit Universally Unique IDentifier. Represented here
58
24
  * with a string of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,
59
25
  * where x is a lowercase hex digit.
60
- * @public
61
- */
62
- export declare type UuidString = string & {
63
- readonly UuidString: "9d40d0ae-90d9-44b1-9482-9f55d59d5465";
64
- };
65
- /**
66
- * A version 4, variant 2 uuid (https://datatracker.ietf.org/doc/html/rfc4122).
67
26
  */
68
- export declare type StableId = UuidString & {
27
+ export declare type StableId = string & {
69
28
  readonly StableId: "53172b0d-a3d5-41ea-bd75-b43839c97f5a";
70
29
  };
71
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../../src/id-compressor/identifiers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,oBAAY,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,aAAa,EAAE,sCAAsC,CAAC;CAC/D;AAED;;;;;GAKG;AACH,oBAAY,wBAAwB,GAAG,YAAY,GAAG,aAAa,CAAC;AAEpE;;;;GAIG;AACH,oBAAY,mBAAmB,GAAG,YAAY,GAAG;IAChD,QAAQ,CAAC,YAAY,EAAE,sCAAsC,CAAC;CAC9D,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,iBAAiB,GAAG,MAAM,GAAG;IACxC,QAAQ,CAAC,iBAAiB,EAAE,sCAAsC,CAAC;IAGnE,QAAQ,CAAC,YAAY,EAAE,sCAAsC,CAAC;CAC9D,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,iBAAiB,GAAG,MAAM,GAAG;IACxC,QAAQ,CAAC,iBAAiB,EAAE,sCAAsC,CAAC;CACnE,GAAG,aAAa,CAAC;AAElB,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,MAAM,EAAE,sCAAsC,CAAC;CACxD;AAED;;GAEG;AAEH;;;;;GAKG;AACH,oBAAY,UAAU,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,sCAAsC,CAAA;CAAE,CAAC;AAElG;;GAEG;AACH,oBAAY,QAAQ,GAAG,UAAU,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,sCAAsC,CAAA;CAAE,CAAC;AAElG;;GAEG;AACH,oBAAY,SAAS,GAAG,QAAQ,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,sCAAsC,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../../src/id-compressor/identifiers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,oBAAY,wBAAwB,GAAG,MAAM,GAAG;IAC/C,QAAQ,CAAC,aAAa,EAAE,sCAAsC,CAAC;CAC/D,CAAC;AAEF;;;;GAIG;AACH,oBAAY,mBAAmB,GAAG,MAAM,GAAG;IAC1C,QAAQ,CAAC,YAAY,EAAE,sCAAsC,CAAC;CAC9D,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,sCAAsC,CAAA;CAAE,CAAC;AAE9F;;GAEG;AACH,oBAAY,SAAS,GAAG,QAAQ,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,sCAAsC,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"identifiers.js","sourceRoot":"","sources":["../../src/id-compressor/identifiers.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * An identifier (UUID) that has been shortened by a distributed compression algorithm.\n * @alpha\n */\nexport type CompressedId = FinalCompressedId | LocalCompressedId;\n\n/**\n * A brand for identity types that are unique within a particular session (SharedTree instance).\n */\nexport interface SessionUnique {\n\treadonly SessionUnique: \"cea55054-6b82-4cbf-ad19-1fa645ea3b3e\";\n}\n\n/**\n * A compressed ID that has been normalized into \"session space\" (see `IdCompressor` for more).\n * Consumer-facing APIs and data structures should use session-space IDs as their lifetime and equality is stable and tied to the\n * compressor that produced them.\n * @alpha\n */\nexport type SessionSpaceCompressedId = CompressedId & SessionUnique;\n\n/**\n * A compressed ID that has been normalized into \"op space\" (see `IdCompressor` for more).\n * Serialized/persisted structures (e.g. ops) should use op-space IDs as a performance optimization, as they require no normalizing when\n * received by a remote client due to the fact that op space for a given compressor is session space for all other compressors.\n */\nexport type OpSpaceCompressedId = CompressedId & {\n\treadonly OpNormalized: \"9209432d-a959-4df7-b2ad-767ead4dbcae\";\n};\n\n/**\n * A compressed ID that is local to a document. Stable across all revisions of a document starting from the one in which it was created.\n * It should not be persisted outside of the history as it can only be decompressed in the context of the originating document.\n * If external persistence is needed (e.g. by a client), a StableId should be used instead.\n * @alpha\n */\nexport type FinalCompressedId = number & {\n\treadonly FinalCompressedId: \"5d83d1e2-98b7-4e4e-a889-54c855cfa73d\";\n\n\t// Same brand as OpNormalizedCompressedId, as final IDs are always finally normalized\n\treadonly OpNormalized: \"9209432d-a959-4df7-b2ad-767ead4dbcae\";\n};\n\n/**\n * A compressed ID that is local to a session (can only be decompressed when paired with a SessionId).\n * It should not be persisted outside of the history as it can only be decompressed in the context of the originating session.\n * If external persistence is needed (e.g. by a client), a StableId should be used instead.\n * @alpha\n */\nexport type LocalCompressedId = number & {\n\treadonly LocalCompressedId: \"6fccb42f-e2a4-4243-bd29-f13d12b9c6d1\";\n} & SessionUnique; // Same brand as CompressedId, as local IDs are always locally normalized\n\nexport interface NodeIdBrand {\n\treadonly NodeId: \"e53e7d6b-c8b9-431a-8805-4843fc639342\";\n}\n\n/**\n * Type-safe identifiers for specific use cases.\n */\n\n/**\n * A 128-bit Universally Unique IDentifier. Represented here\n * with a string of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,\n * where x is a lowercase hex digit.\n * @public\n */\nexport type UuidString = string & { readonly UuidString: \"9d40d0ae-90d9-44b1-9482-9f55d59d5465\" };\n\n/**\n * A version 4, variant 2 uuid (https://datatracker.ietf.org/doc/html/rfc4122).\n */\nexport type StableId = UuidString & { readonly StableId: \"53172b0d-a3d5-41ea-bd75-b43839c97f5a\" };\n\n/**\n * A StableId which is suitable for use as a session identifier\n */\nexport type SessionId = StableId & { readonly SessionId: \"4498f850-e14e-4be9-8db0-89ec00997e58\" };\n"]}
1
+ {"version":3,"file":"identifiers.js","sourceRoot":"","sources":["../../src/id-compressor/identifiers.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A compressed ID that has been normalized into \"session space\" (see `IdCompressor` for more).\n * Consumer-facing APIs and data structures should use session-space IDs as their lifetime and equality is stable and tied to\n * the scope of the session (i.e. compressor) that produced them.\n */\nexport type SessionSpaceCompressedId = number & {\n\treadonly SessionUnique: \"cea55054-6b82-4cbf-ad19-1fa645ea3b3e\";\n};\n\n/**\n * A compressed ID that has been normalized into \"op space\".\n * Serialized/persisted structures (e.g. ops) should use op-space IDs as a performance optimization, as they require less normalizing when\n * received by a remote client due to the fact that op space for a given compressor is session space for all other compressors.\n */\nexport type OpSpaceCompressedId = number & {\n\treadonly OpNormalized: \"9209432d-a959-4df7-b2ad-767ead4dbcae\";\n};\n\n/**\n * A version 4, variant 1 uuid (https://datatracker.ietf.org/doc/html/rfc4122).\n * A 128-bit Universally Unique IDentifier. Represented here\n * with a string of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,\n * where x is a lowercase hex digit.\n */\nexport type StableId = string & { readonly StableId: \"53172b0d-a3d5-41ea-bd75-b43839c97f5a\" };\n\n/**\n * A StableId which is suitable for use as a session identifier\n */\nexport type SessionId = StableId & { readonly SessionId: \"4498f850-e14e-4be9-8db0-89ec00997e58\" };\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { IdCreationRange, SerializedCluster, SerializedClusterOverrides, SerializedIdCompressor, SerializedIdCompressorWithNoSession, SerializedIdCompressorWithOngoingSession, SerializedLocalOverrides, SerializedLocalState, SerializedSessionData, SerializedSessionIdNormalizer, UnackedLocalId, VersionedSerializedIdCompressor, IdCreationRangeWithStashedState, } from "./persisted-types";
5
+ export { IdCreationRange, SerializedIdCompressor, SerializedIdCompressorWithNoSession, SerializedIdCompressorWithOngoingSession, IdCreationRangeWithStashedState, initialClusterCapacity, } from "./persisted-types";
6
6
  export { IIdCompressorCore, IIdCompressor } from "./idCompressor";
7
- export { SessionSpaceCompressedId, OpSpaceCompressedId, SessionId, FinalCompressedId, StableId, UuidString, CompressedId, SessionUnique, LocalCompressedId, } from "./identifiers";
7
+ export { SessionSpaceCompressedId, OpSpaceCompressedId, SessionId, StableId } from "./identifiers";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/id-compressor/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,mCAAmC,EACnC,wCAAwC,EACxC,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,cAAc,EACd,+BAA+B,EAC/B,+BAA+B,GAC/B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EACN,wBAAwB,EACxB,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,GACjB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/id-compressor/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,mCAAmC,EACnC,wCAAwC,EACxC,+BAA+B,EAC/B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
@@ -4,4 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.initialClusterCapacity = void 0;
8
+ var persisted_types_1 = require("./persisted-types");
9
+ Object.defineProperty(exports, "initialClusterCapacity", { enumerable: true, get: function () { return persisted_types_1.initialClusterCapacity; } });
7
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/id-compressor/index.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIdCreationRange,\n\tSerializedCluster,\n\tSerializedClusterOverrides,\n\tSerializedIdCompressor,\n\tSerializedIdCompressorWithNoSession,\n\tSerializedIdCompressorWithOngoingSession,\n\tSerializedLocalOverrides,\n\tSerializedLocalState,\n\tSerializedSessionData,\n\tSerializedSessionIdNormalizer,\n\tUnackedLocalId,\n\tVersionedSerializedIdCompressor,\n\tIdCreationRangeWithStashedState,\n} from \"./persisted-types\";\n\nexport { IIdCompressorCore, IIdCompressor } from \"./idCompressor\";\n\nexport {\n\tSessionSpaceCompressedId,\n\tOpSpaceCompressedId,\n\tSessionId,\n\tFinalCompressedId,\n\tStableId,\n\tUuidString,\n\tCompressedId,\n\tSessionUnique,\n\tLocalCompressedId,\n} from \"./identifiers\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/id-compressor/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qDAO2B;AAD1B,yHAAA,sBAAsB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIdCreationRange,\n\tSerializedIdCompressor,\n\tSerializedIdCompressorWithNoSession,\n\tSerializedIdCompressorWithOngoingSession,\n\tIdCreationRangeWithStashedState,\n\tinitialClusterCapacity,\n} from \"./persisted-types\";\n\nexport { IIdCompressorCore, IIdCompressor } from \"./idCompressor\";\n\nexport { SessionSpaceCompressedId, OpSpaceCompressedId, SessionId, StableId } from \"./identifiers\";\n"]}