@fluidframework/datastore 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/api-report/datastore.api.md +7 -5
- package/dist/channelContext.d.ts +5 -4
- package/dist/channelContext.d.ts.map +1 -1
- package/dist/channelContext.js +10 -10
- package/dist/channelContext.js.map +1 -1
- package/dist/channelDeltaConnection.d.ts +2 -2
- package/dist/channelDeltaConnection.d.ts.map +1 -1
- package/dist/channelDeltaConnection.js +5 -5
- package/dist/channelDeltaConnection.js.map +1 -1
- package/dist/channelStorageService.d.ts +2 -2
- package/dist/channelStorageService.d.ts.map +1 -1
- package/dist/channelStorageService.js +2 -2
- package/dist/channelStorageService.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts +10 -8
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +114 -97
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/fluidHandle.d.ts +1 -1
- package/dist/fluidHandle.d.ts.map +1 -1
- package/dist/fluidHandle.js +2 -2
- package/dist/fluidHandle.js.map +1 -1
- package/dist/legacy.d.ts +19 -0
- package/dist/localChannelContext.d.ts +7 -6
- package/dist/localChannelContext.d.ts.map +1 -1
- package/dist/localChannelContext.js +16 -16
- package/dist/localChannelContext.js.map +1 -1
- package/dist/localChannelStorageService.d.ts.map +1 -1
- package/dist/localChannelStorageService.js +2 -2
- package/dist/localChannelStorageService.js.map +1 -1
- package/dist/packageVersion.d.ts +9 -0
- package/dist/packageVersion.d.ts.map +1 -0
- package/dist/packageVersion.js +12 -0
- package/dist/packageVersion.js.map +1 -0
- package/dist/public.d.ts +12 -0
- package/dist/remoteChannelContext.d.ts +3 -2
- package/dist/remoteChannelContext.d.ts.map +1 -1
- package/dist/remoteChannelContext.js +12 -12
- package/dist/remoteChannelContext.js.map +1 -1
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/channelContext.d.ts +5 -4
- package/lib/channelContext.d.ts.map +1 -1
- package/lib/channelContext.js +4 -4
- package/lib/channelContext.js.map +1 -1
- package/lib/channelDeltaConnection.d.ts +2 -2
- package/lib/channelDeltaConnection.d.ts.map +1 -1
- package/lib/channelDeltaConnection.js +2 -2
- package/lib/channelDeltaConnection.js.map +1 -1
- package/lib/channelStorageService.d.ts +2 -2
- package/lib/channelStorageService.d.ts.map +1 -1
- package/lib/channelStorageService.js +1 -1
- package/lib/channelStorageService.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +10 -8
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +52 -35
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/fluidHandle.d.ts +1 -1
- package/lib/fluidHandle.d.ts.map +1 -1
- package/lib/fluidHandle.js +1 -1
- package/lib/fluidHandle.js.map +1 -1
- package/lib/legacy.d.ts +19 -0
- package/lib/localChannelContext.d.ts +7 -6
- package/lib/localChannelContext.d.ts.map +1 -1
- package/lib/localChannelContext.js +2 -2
- package/lib/localChannelContext.js.map +1 -1
- package/lib/localChannelStorageService.d.ts.map +1 -1
- package/lib/localChannelStorageService.js +1 -1
- package/lib/localChannelStorageService.js.map +1 -1
- package/lib/packageVersion.d.ts +9 -0
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/packageVersion.js +9 -0
- package/lib/packageVersion.js.map +1 -0
- package/lib/public.d.ts +12 -0
- package/lib/remoteChannelContext.d.ts +3 -2
- package/lib/remoteChannelContext.d.ts.map +1 -1
- package/lib/remoteChannelContext.js +2 -2
- package/lib/remoteChannelContext.js.map +1 -1
- package/package.json +38 -57
- package/src/channelContext.ts +12 -12
- package/src/channelDeltaConnection.ts +4 -4
- package/src/channelStorageService.ts +3 -3
- package/src/dataStoreRuntime.ts +104 -76
- package/src/fluidHandle.ts +2 -2
- package/src/localChannelContext.ts +11 -10
- package/src/localChannelStorageService.ts +2 -2
- package/src/packageVersion.ts +9 -0
- package/src/remoteChannelContext.ts +13 -13
- package/api-extractor-cjs.json +0 -8
- package/dist/datastore-alpha.d.ts +0 -334
- package/dist/datastore-beta.d.ts +0 -46
- package/dist/datastore-public.d.ts +0 -46
- package/dist/datastore-untrimmed.d.ts +0 -341
- package/lib/datastore-alpha.d.ts +0 -334
- package/lib/datastore-beta.d.ts +0 -46
- package/lib/datastore-public.d.ts +0 -46
- package/lib/datastore-untrimmed.d.ts +0 -341
- package/lib/test/channelStorageService.spec.js +0 -70
- package/lib/test/channelStorageService.spec.js.map +0 -1
- package/lib/test/dataStoreRuntime.spec.js +0 -121
- package/lib/test/dataStoreRuntime.spec.js.map +0 -1
- package/lib/test/localChannelContext.spec.js +0 -41
- package/lib/test/localChannelContext.spec.js.map +0 -1
- package/lib/test/localChannelStorageService.spec.js +0 -72
- package/lib/test/localChannelStorageService.spec.js.map +0 -1
- package/lib/test/remoteChannelContext.spec.js +0 -33
- package/lib/test/remoteChannelContext.spec.js.map +0 -1
- package/lib/test/types/validateDatastorePrevious.generated.js +0 -16
- package/lib/test/types/validateDatastorePrevious.generated.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localChannelStorageService.d.ts","sourceRoot":"","sources":["../src/localChannelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"localChannelStorageService.d.ts","sourceRoot":"","sources":["../src/localChannelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAS,KAAK,EAAa,MAAM,sCAAsC,CAAC;AAG/E,qBAAa,0BAA2B,YAAW,sBAAsB;IAC5D,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,KAAK;IAE3B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAQhD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIlD,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,oBAAoB;CAwB5B"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { stringToBuffer } from "@fluid-internal/client-utils";
|
|
6
6
|
import { TreeEntry } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import { listBlobsAtTreePath } from "@fluidframework/runtime-utils";
|
|
7
|
+
import { listBlobsAtTreePath } from "@fluidframework/runtime-utils/internal";
|
|
8
8
|
export class LocalChannelStorageService {
|
|
9
9
|
constructor(tree) {
|
|
10
10
|
this.tree = tree;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localChannelStorageService.js","sourceRoot":"","sources":["../src/localChannelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"localChannelStorageService.js","sourceRoot":"","sources":["../src/localChannelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAgB,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,MAAM,OAAO,0BAA0B;IACtC,YAA6B,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;IAAG,CAAC;IAErC,KAAK,CAAC,QAAQ,CAAC,IAAY;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,IAAI,KAAK,SAAS,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;SAClC;QACD,OAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,IAAY;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,IAAY;QAC7B,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAEO,YAAY,CAAC,IAAY;QAChC,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAEO,oBAAoB,CAAC,IAAY,EAAE,IAAW;QACrD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;YACjC,QAAQ,KAAK,CAAC,IAAI,EAAE;gBACnB,KAAK,SAAS,CAAC,IAAI;oBAClB,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE;wBACxB,OAAO,KAAK,CAAC,KAAK,CAAC;qBACnB;oBACD,MAAM;gBAEP,KAAK,SAAS,CAAC,IAAI;oBAClB,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;wBAChC,OAAO,IAAI,CAAC,oBAAoB,CAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAClC,KAAK,CAAC,KAAK,CACX,CAAC;qBACF;oBACD,MAAM;gBAEP,QAAQ;aACR;SACD;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\nimport { IBlob, ITree, TreeEntry } from \"@fluidframework/protocol-definitions\";\nimport { listBlobsAtTreePath } from \"@fluidframework/runtime-utils/internal\";\n\nexport class LocalChannelStorageService implements IChannelStorageService {\n\tconstructor(private readonly tree: ITree) {}\n\n\tpublic async readBlob(path: string): Promise<ArrayBufferLike> {\n\t\tconst blob = this.readBlobSync(path);\n\t\tif (blob === undefined) {\n\t\t\tthrow new Error(\"Blob Not Found\");\n\t\t}\n\t\treturn stringToBuffer(blob.contents, blob.encoding);\n\t}\n\n\tpublic async contains(path: string): Promise<boolean> {\n\t\tconst blob = this.readBlobSync(path);\n\t\treturn blob !== undefined ? blob.contents !== undefined : false;\n\t}\n\n\tpublic async list(path: string): Promise<string[]> {\n\t\treturn listBlobsAtTreePath(this.tree, path);\n\t}\n\n\tprivate readBlobSync(path: string): IBlob | undefined {\n\t\treturn this.readBlobSyncInternal(path, this.tree);\n\t}\n\n\tprivate readBlobSyncInternal(path: string, tree: ITree): IBlob | undefined {\n\t\tfor (const entry of tree.entries) {\n\t\t\tswitch (entry.type) {\n\t\t\t\tcase TreeEntry.Blob:\n\t\t\t\t\tif (path === entry.path) {\n\t\t\t\t\t\treturn entry.value;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TreeEntry.Tree:\n\t\t\t\t\tif (path.startsWith(entry.path)) {\n\t\t\t\t\t\treturn this.readBlobSyncInternal(\n\t\t\t\t\t\t\tpath.substr(entry.path.length + 1),\n\t\t\t\t\t\t\tentry.value,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
|
+
*/
|
|
7
|
+
export declare const pkgName = "@fluidframework/datastore";
|
|
8
|
+
export declare const pkgVersion = "2.0.0-rc.3.0.0";
|
|
9
|
+
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,8BAA8B,CAAC;AACnD,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
|
+
*/
|
|
7
|
+
export const pkgName = "@fluidframework/datastore";
|
|
8
|
+
export const pkgVersion = "2.0.0-rc.3.0.0";
|
|
9
|
+
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,2BAA2B,CAAC;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/datastore\";\nexport const pkgVersion = \"2.0.0-rc.3.0.0\";\n"]}
|
package/lib/public.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {}
|
|
12
|
+
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
6
|
import { IChannel, IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
7
|
-
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
7
|
+
import { IDocumentStorageService } from "@fluidframework/driver-definitions/internal";
|
|
8
8
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
9
|
-
import {
|
|
9
|
+
import { IGarbageCollectionData, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
10
|
+
import { CreateChildSummarizerNodeFn, IFluidDataStoreContext, ISummarizeResult } from "@fluidframework/runtime-definitions/internal";
|
|
10
11
|
import { IChannelContext } from "./channelContext.js";
|
|
11
12
|
import { ISharedObjectRegistry } from "./dataStoreRuntime.js";
|
|
12
13
|
export declare class RemoteChannelContext implements IChannelContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteChannelContext.d.ts","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"remoteChannelContext.d.ts","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE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AqB,EAC/B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,EACpD,oBAAoB,EAAE,2BAA2B,EACjD,iBAAiB,CAAC,EAAE,MAAM;IAsFpB,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC;IAI/B,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM;IASxD,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAKrC,SAAS,CACf,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAE,OAAO,EACd,eAAe,EAAE,OAAO,GACtB,IAAI;IAaA,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAM/C,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAMtD;;;;;OAKG;IACU,SAAS,CACrB,QAAQ,GAAE,OAAe,EACzB,UAAU,GAAE,OAAc,EAC1B,gBAAgB,CAAC,EAAE,iBAAiB,GAClC,OAAO,CAAC,gBAAgB,CAAC;YAId,iBAAiB;IAiB/B;;;;;;OAMG;IACU,SAAS,CAAC,MAAM,GAAE,OAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIhF;;;;OAIG;YACW,iBAAiB;IAKxB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE;CAS5C"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert, LazyPromise } from "@fluidframework/core-utils";
|
|
6
|
-
import { createChildLogger, ThresholdCounter, } from "@fluidframework/telemetry-utils";
|
|
7
5
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
6
|
+
import { assert, LazyPromise } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import { ThresholdCounter, createChildLogger } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
import { createChannelServiceEndpoints, loadChannel, loadChannelFactoryAndAttributes, summarizeChannelAsync, } from "./channelContext.js";
|
|
9
9
|
export class RemoteChannelContext {
|
|
10
10
|
constructor(runtime, dataStoreContext, storageService, submitFn, dirtyFn, addedGCOutboundReferenceFn, id, baseSnapshot, registry, extraBlobs, createSummarizerNode, attachMessageType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteChannelContext.js","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAejE,OAAO,EACN,iBAAiB,EAEjB,gBAAgB,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAEN,6BAA6B,EAE7B,WAAW,EACX,+BAA+B,EAC/B,qBAAqB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,OAAO,oBAAoB;IAWhC,YACC,OAA+B,EAC/B,gBAAwC,EACxC,cAAuC,EACvC,QAA0D,EAC1D,OAAkC,EAClC,0BAA2F,EAC1E,EAAU,EAC3B,YAA2B,EAC3B,QAA+B,EAC/B,UAAoD,EACpD,oBAAiD,EACjD,iBAA0B;QALT,OAAE,GAAF,EAAE,CAAQ;QAjBpB,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAA4C,EAAE,CAAC;QAuB7D,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAEtF,IAAI,CAAC,SAAS,GAAG,iBAAiB,CAAC;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE,sBAAsB;SACjC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,6BAA6B,CAC5C,gBAAgB,CAAC,SAAS,EAC1B,QAAQ,E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B,CAAC;QACF,OAAO,EAAE,GAAG,eAAe,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,SAAS,CAAC,SAAkB,KAAK;QAC7C,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,iBAAiB,CAAC,SAAkB,KAAK;QACtD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAEM,gBAAgB,CAAC,UAAoB;QAC3C;;;;;WAKG;QACH,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;;AA/MuB,6CAAwB,GAAG,IAAI,AAAP,CAAQ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, LazyPromise } from \"@fluidframework/core-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { IChannel, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tCreateChildSummarizerNodeFn,\n\tIFluidDataStoreContext,\n\tIGarbageCollectionData,\n\tIExperimentalIncrementalSummaryContext,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeWithGC,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tcreateChildLogger,\n\tITelemetryLoggerExt,\n\tThresholdCounter,\n} from \"@fluidframework/telemetry-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport {\n\tChannelServiceEndpoints,\n\tcreateChannelServiceEndpoints,\n\tIChannelContext,\n\tloadChannel,\n\tloadChannelFactoryAndAttributes,\n\tsummarizeChannelAsync,\n} from \"./channelContext.js\";\nimport { ISharedObjectRegistry } from \"./dataStoreRuntime.js\";\n\nexport class RemoteChannelContext implements IChannelContext {\n\tprivate isLoaded = false;\n\tprivate pending: ISequencedDocumentMessage[] | undefined = [];\n\tprivate readonly channelP: Promise<IChannel>;\n\tprivate channel: IChannel | undefined;\n\tprivate readonly services: ChannelServiceEndpoints;\n\tprivate readonly summarizerNode: ISummarizerNodeWithGC;\n\tprivate readonly subLogger: ITelemetryLoggerExt;\n\tprivate readonly thresholdOpsCounter: ThresholdCounter;\n\tprivate static readonly pendingOpsCountThreshold = 1000;\n\n\tconstructor(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tdataStoreContext: IFluidDataStoreContext,\n\t\tstorageService: IDocumentStorageService,\n\t\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\t\tdirtyFn: (address: string) => void,\n\t\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\t\tprivate readonly id: string,\n\t\tbaseSnapshot: ISnapshotTree,\n\t\tregistry: ISharedObjectRegistry,\n\t\textraBlobs: Map<string, ArrayBufferLike> | undefined,\n\t\tcreateSummarizerNode: CreateChildSummarizerNodeFn,\n\t\tattachMessageType?: string,\n\t) {\n\t\tassert(!this.id.includes(\"/\"), 0x310 /* Channel context ID cannot contain slashes */);\n\n\t\tthis.subLogger = createChildLogger({\n\t\t\tlogger: runtime.logger,\n\t\t\tnamespace: \"RemoteChannelContext\",\n\t\t});\n\n\t\tthis.services = createChannelServiceEndpoints(\n\t\t\tdataStoreContext.connected,\n\t\t\tsubmitFn,\n\t\t\t() => dirtyFn(this.id),\n\t\t\taddedGCOutboundReferenceFn,\n\t\t\t() => runtime.attachState !== AttachState.Detached,\n\t\t\tstorageService,\n\t\t\tthis.subLogger,\n\t\t\tbaseSnapshot,\n\t\t\textraBlobs,\n\t\t);\n\n\t\tthis.channelP = new LazyPromise<IChannel>(async () => {\n\t\t\tconst { attributes, factory } = await loadChannelFactoryAndAttributes(\n\t\t\t\tdataStoreContext,\n\t\t\t\tthis.services,\n\t\t\t\tthis.id,\n\t\t\t\tregistry,\n\t\t\t\tattachMessageType,\n\t\t\t);\n\n\t\t\tconst channel = await loadChannel(\n\t\t\t\truntime,\n\t\t\t\tattributes,\n\t\t\t\tfactory,\n\t\t\t\tthis.services,\n\t\t\t\tthis.subLogger,\n\t\t\t\tthis.id,\n\t\t\t);\n\n\t\t\t// Send all pending messages to the channel\n\t\t\tassert(this.pending !== undefined, 0x23f /* \"pending undefined\" */);\n\t\t\tfor (const message of this.pending) {\n\t\t\t\tthis.services.deltaConnection.process(\n\t\t\t\t\tmessage,\n\t\t\t\t\tfalse,\n\t\t\t\t\tundefined /* localOpMetadata */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.thresholdOpsCounter.send(\"ProcessPendingOps\", this.pending.length);\n\n\t\t\t// Commit changes.\n\t\t\tthis.channel = channel;\n\t\t\tthis.pending = undefined;\n\t\t\tthis.isLoaded = true;\n\n\t\t\t// Because have some await between we created the service and here, the connection state might have changed\n\t\t\t// and we don't propagate the connection state when we are not loaded. So we have to set it again here.\n\t\t\tthis.services.deltaConnection.setConnectionState(dataStoreContext.connected);\n\t\t\treturn this.channel;\n\t\t});\n\n\t\tconst thisSummarizeInternal = async (\n\t\t\tfullTree: boolean,\n\t\t\ttrackState: boolean,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t) =>\n\t\t\tthis.summarizeInternal(\n\t\t\t\tfullTree,\n\t\t\t\ttrackState,\n\t\t\t\ttelemetryContext,\n\t\t\t\tincrementalSummaryContext,\n\t\t\t);\n\n\t\tthis.summarizerNode = createSummarizerNode(\n\t\t\tthisSummarizeInternal,\n\t\t\tasync (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n\t\t);\n\n\t\tthis.thresholdOpsCounter = new ThresholdCounter(\n\t\t\tRemoteChannelContext.pendingOpsCountThreshold,\n\t\t\tthis.subLogger,\n\t\t);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/promise-function-async\n\tpublic getChannel(): Promise<IChannel> {\n\t\treturn this.channelP;\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\t// Connection events are ignored if the data store is not yet loaded\n\t\tif (!this.isLoaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.services.deltaConnection.setConnectionState(connected);\n\t}\n\n\tpublic applyStashedOp(content: any): unknown {\n\t\tassert(this.isLoaded, 0x194 /* \"Remote channel must be loaded when rebasing op\" */);\n\t\treturn this.services.deltaConnection.applyStashedOp(content);\n\t}\n\n\tpublic processOp(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tthis.summarizerNode.invalidate(message.sequenceNumber);\n\n\t\tif (this.isLoaded) {\n\t\t\tthis.services.deltaConnection.process(message, local, localOpMetadata);\n\t\t} else {\n\t\t\tassert(!local, 0x195 /* \"Remote channel must not be local when processing op\" */);\n\t\t\tassert(this.pending !== undefined, 0x23e /* \"pending is undefined\" */);\n\t\t\tthis.pending.push(message);\n\t\t\tthis.thresholdOpsCounter.sendIfMultiple(\"StorePendingOps\", this.pending.length);\n\t\t}\n\t}\n\n\tpublic reSubmit(content: any, localOpMetadata: unknown) {\n\t\tassert(this.isLoaded, 0x196 /* \"Remote channel must be loaded when resubmitting op\" */);\n\n\t\tthis.services.deltaConnection.reSubmit(content, localOpMetadata);\n\t}\n\n\tpublic rollback(content: any, localOpMetadata: unknown) {\n\t\tassert(this.isLoaded, 0x2f0 /* \"Remote channel must be loaded when rolling back op\" */);\n\n\t\tthis.services.deltaConnection.rollback(content, localOpMetadata);\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\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\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\treturn this.summarizerNode.summarize(fullTree, trackState, telemetryContext);\n\t}\n\n\tprivate async summarizeInternal(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): Promise<ISummarizeInternalResult> {\n\t\tconst channel = await this.getChannel();\n\t\tconst summarizeResult = await summarizeChannelAsync(\n\t\t\tchannel,\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t\tincrementalSummaryContext,\n\t\t);\n\t\treturn { ...summarizeResult, id: this.id };\n\t}\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 * Each node has a set of outbound routes to other GC nodes in the document.\n\t * If there is no new data in this context since the last summary, previous GC data is used.\n\t * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\treturn this.summarizerNode.getGCData(fullGC);\n\t}\n\n\t/**\n\t * Generates the data used for garbage collection. This is called when there is new data since last summary. It\n\t * loads the context and calls into the channel to get its GC data.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tprivate async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst channel = await this.getChannel();\n\t\treturn channel.getGCData(fullGC);\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t/**\n\t\t * Currently, DDSes are always considered referenced and are not garbage collected. Update the summarizer node's\n\t\t * used routes to contain a route to this channel context.\n\t\t * Once we have GC at DDS level, this will be updated to use the passed usedRoutes. See -\n\t\t * https://github.com/microsoft/FluidFramework/issues/4611\n\t\t */\n\t\tthis.summarizerNode.updateUsedRoutes([\"\"]);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"remoteChannelContext.js","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAiB1E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE/F,OAAO,EAGN,6BAA6B,EAC7B,WAAW,EACX,+BAA+B,EAC/B,qBAAqB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,OAAO,oBAAoB;IAWhC,YACC,OAA+B,EAC/B,gBAAwC,EACxC,cAAuC,EACvC,QAA0D,EAC1D,OAAkC,EAClC,0BAA2F,EAC1E,EAAU,EAC3B,YAA2B,EAC3B,QAA+B,EAC/B,UAAoD,EACpD,oBAAiD,EACjD,iBAA0B;QALT,OAAE,GAAF,EAAE,CAAQ;QAjBpB,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAA4C,EAAE,CAAC;QAuB7D,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAEtF,IAAI,CAAC,SAAS,GAAG,iBAAiB,CAAC;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE,sBAAsB;SACjC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,6BAA6B,CAC5C,gBAAgB,CAAC,SAAS,EAC1B,QAAQ,EACR,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EACtB,0BAA0B,EAC1B,GAAG,EAAE,CAAC,OAAO,CAAC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;OAMG;IACI,KAAK,CAAC,SAAS,CAAC,SAAkB,KAAK;QAC7C,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,iBAAiB,CAAC,SAAkB,KAAK;QACtD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAEM,gBAAgB,CAAC,UAAoB;QAC3C;;;;;WAKG;QACH,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;;AA/MuB,6CAAwB,GAAG,IAAI,AAAP,CAAQ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert, LazyPromise } from \"@fluidframework/core-utils/internal\";\nimport { IChannel, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions/internal\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tIGarbageCollectionData,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tCreateChildSummarizerNodeFn,\n\tIFluidDataStoreContext,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeWithGC,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { ThresholdCounter, createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tChannelServiceEndpoints,\n\tIChannelContext,\n\tcreateChannelServiceEndpoints,\n\tloadChannel,\n\tloadChannelFactoryAndAttributes,\n\tsummarizeChannelAsync,\n} from \"./channelContext.js\";\nimport { ISharedObjectRegistry } from \"./dataStoreRuntime.js\";\n\nexport class RemoteChannelContext implements IChannelContext {\n\tprivate isLoaded = false;\n\tprivate pending: ISequencedDocumentMessage[] | undefined = [];\n\tprivate readonly channelP: Promise<IChannel>;\n\tprivate channel: IChannel | undefined;\n\tprivate readonly services: ChannelServiceEndpoints;\n\tprivate readonly summarizerNode: ISummarizerNodeWithGC;\n\tprivate readonly subLogger: ITelemetryLoggerExt;\n\tprivate readonly thresholdOpsCounter: ThresholdCounter;\n\tprivate static readonly pendingOpsCountThreshold = 1000;\n\n\tconstructor(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tdataStoreContext: IFluidDataStoreContext,\n\t\tstorageService: IDocumentStorageService,\n\t\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\t\tdirtyFn: (address: string) => void,\n\t\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\t\tprivate readonly id: string,\n\t\tbaseSnapshot: ISnapshotTree,\n\t\tregistry: ISharedObjectRegistry,\n\t\textraBlobs: Map<string, ArrayBufferLike> | undefined,\n\t\tcreateSummarizerNode: CreateChildSummarizerNodeFn,\n\t\tattachMessageType?: string,\n\t) {\n\t\tassert(!this.id.includes(\"/\"), 0x310 /* Channel context ID cannot contain slashes */);\n\n\t\tthis.subLogger = createChildLogger({\n\t\t\tlogger: runtime.logger,\n\t\t\tnamespace: \"RemoteChannelContext\",\n\t\t});\n\n\t\tthis.services = createChannelServiceEndpoints(\n\t\t\tdataStoreContext.connected,\n\t\t\tsubmitFn,\n\t\t\t() => dirtyFn(this.id),\n\t\t\taddedGCOutboundReferenceFn,\n\t\t\t() => runtime.attachState !== AttachState.Detached,\n\t\t\tstorageService,\n\t\t\tthis.subLogger,\n\t\t\tbaseSnapshot,\n\t\t\textraBlobs,\n\t\t);\n\n\t\tthis.channelP = new LazyPromise<IChannel>(async () => {\n\t\t\tconst { attributes, factory } = await loadChannelFactoryAndAttributes(\n\t\t\t\tdataStoreContext,\n\t\t\t\tthis.services,\n\t\t\t\tthis.id,\n\t\t\t\tregistry,\n\t\t\t\tattachMessageType,\n\t\t\t);\n\n\t\t\tconst channel = await loadChannel(\n\t\t\t\truntime,\n\t\t\t\tattributes,\n\t\t\t\tfactory,\n\t\t\t\tthis.services,\n\t\t\t\tthis.subLogger,\n\t\t\t\tthis.id,\n\t\t\t);\n\n\t\t\t// Send all pending messages to the channel\n\t\t\tassert(this.pending !== undefined, 0x23f /* \"pending undefined\" */);\n\t\t\tfor (const message of this.pending) {\n\t\t\t\tthis.services.deltaConnection.process(\n\t\t\t\t\tmessage,\n\t\t\t\t\tfalse,\n\t\t\t\t\tundefined /* localOpMetadata */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.thresholdOpsCounter.send(\"ProcessPendingOps\", this.pending.length);\n\n\t\t\t// Commit changes.\n\t\t\tthis.channel = channel;\n\t\t\tthis.pending = undefined;\n\t\t\tthis.isLoaded = true;\n\n\t\t\t// Because have some await between we created the service and here, the connection state might have changed\n\t\t\t// and we don't propagate the connection state when we are not loaded. So we have to set it again here.\n\t\t\tthis.services.deltaConnection.setConnectionState(dataStoreContext.connected);\n\t\t\treturn this.channel;\n\t\t});\n\n\t\tconst thisSummarizeInternal = async (\n\t\t\tfullTree: boolean,\n\t\t\ttrackState: boolean,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t) =>\n\t\t\tthis.summarizeInternal(\n\t\t\t\tfullTree,\n\t\t\t\ttrackState,\n\t\t\t\ttelemetryContext,\n\t\t\t\tincrementalSummaryContext,\n\t\t\t);\n\n\t\tthis.summarizerNode = createSummarizerNode(\n\t\t\tthisSummarizeInternal,\n\t\t\tasync (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n\t\t);\n\n\t\tthis.thresholdOpsCounter = new ThresholdCounter(\n\t\t\tRemoteChannelContext.pendingOpsCountThreshold,\n\t\t\tthis.subLogger,\n\t\t);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/promise-function-async\n\tpublic getChannel(): Promise<IChannel> {\n\t\treturn this.channelP;\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\t// Connection events are ignored if the data store is not yet loaded\n\t\tif (!this.isLoaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.services.deltaConnection.setConnectionState(connected);\n\t}\n\n\tpublic applyStashedOp(content: any): unknown {\n\t\tassert(this.isLoaded, 0x194 /* \"Remote channel must be loaded when rebasing op\" */);\n\t\treturn this.services.deltaConnection.applyStashedOp(content);\n\t}\n\n\tpublic processOp(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tthis.summarizerNode.invalidate(message.sequenceNumber);\n\n\t\tif (this.isLoaded) {\n\t\t\tthis.services.deltaConnection.process(message, local, localOpMetadata);\n\t\t} else {\n\t\t\tassert(!local, 0x195 /* \"Remote channel must not be local when processing op\" */);\n\t\t\tassert(this.pending !== undefined, 0x23e /* \"pending is undefined\" */);\n\t\t\tthis.pending.push(message);\n\t\t\tthis.thresholdOpsCounter.sendIfMultiple(\"StorePendingOps\", this.pending.length);\n\t\t}\n\t}\n\n\tpublic reSubmit(content: any, localOpMetadata: unknown) {\n\t\tassert(this.isLoaded, 0x196 /* \"Remote channel must be loaded when resubmitting op\" */);\n\n\t\tthis.services.deltaConnection.reSubmit(content, localOpMetadata);\n\t}\n\n\tpublic rollback(content: any, localOpMetadata: unknown) {\n\t\tassert(this.isLoaded, 0x2f0 /* \"Remote channel must be loaded when rolling back op\" */);\n\n\t\tthis.services.deltaConnection.rollback(content, localOpMetadata);\n\t}\n\n\t/**\n\t * Returns a summary at the current sequence number.\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\tpublic async summarize(\n\t\tfullTree: boolean = false,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\treturn this.summarizerNode.summarize(fullTree, trackState, telemetryContext);\n\t}\n\n\tprivate async summarizeInternal(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): Promise<ISummarizeInternalResult> {\n\t\tconst channel = await this.getChannel();\n\t\tconst summarizeResult = await summarizeChannelAsync(\n\t\t\tchannel,\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t\tincrementalSummaryContext,\n\t\t);\n\t\treturn { ...summarizeResult, id: this.id };\n\t}\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 * Each node has a set of outbound routes to other GC nodes in the document.\n\t * If there is no new data in this context since the last summary, previous GC data is used.\n\t * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\treturn this.summarizerNode.getGCData(fullGC);\n\t}\n\n\t/**\n\t * Generates the data used for garbage collection. This is called when there is new data since last summary. It\n\t * loads the context and calls into the channel to get its GC data.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tprivate async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst channel = await this.getChannel();\n\t\treturn channel.getGCData(fullGC);\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t/**\n\t\t * Currently, DDSes are always considered referenced and are not garbage collected. Update the summarizer node's\n\t\t * used routes to contain a route to this channel context.\n\t\t * Once we have GC at DDS level, this will be updated to use the passed usedRoutes. See -\n\t\t * https://github.com/microsoft/FluidFramework/issues/4611\n\t\t */\n\t\tthis.summarizerNode.updateUsedRoutes([\"\"]);\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/datastore",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.3.0.0",
|
|
4
4
|
"description": "Fluid data store implementation",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,31 +15,21 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"import": {
|
|
18
|
-
"types": "./lib/
|
|
19
|
-
"default": "./lib/index.js"
|
|
20
|
-
},
|
|
21
|
-
"require": {
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
23
|
-
"default": "./dist/index.js"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"./public": {
|
|
27
|
-
"import": {
|
|
28
|
-
"types": "./lib/datastore-public.d.ts",
|
|
18
|
+
"types": "./lib/public.d.ts",
|
|
29
19
|
"default": "./lib/index.js"
|
|
30
20
|
},
|
|
31
21
|
"require": {
|
|
32
|
-
"types": "./dist/
|
|
22
|
+
"types": "./dist/public.d.ts",
|
|
33
23
|
"default": "./dist/index.js"
|
|
34
24
|
}
|
|
35
25
|
},
|
|
36
|
-
"./
|
|
26
|
+
"./legacy": {
|
|
37
27
|
"import": {
|
|
38
|
-
"types": "./lib/
|
|
28
|
+
"types": "./lib/legacy.d.ts",
|
|
39
29
|
"default": "./lib/index.js"
|
|
40
30
|
},
|
|
41
31
|
"require": {
|
|
42
|
-
"types": "./dist/
|
|
32
|
+
"types": "./dist/legacy.d.ts",
|
|
43
33
|
"default": "./dist/index.js"
|
|
44
34
|
}
|
|
45
35
|
},
|
|
@@ -54,8 +44,8 @@
|
|
|
54
44
|
}
|
|
55
45
|
}
|
|
56
46
|
},
|
|
57
|
-
"main": "
|
|
58
|
-
"types": "
|
|
47
|
+
"main": "lib/index.js",
|
|
48
|
+
"types": "lib/public.d.ts",
|
|
59
49
|
"c8": {
|
|
60
50
|
"all": true,
|
|
61
51
|
"cache-dir": "nyc/.cache",
|
|
@@ -77,30 +67,32 @@
|
|
|
77
67
|
"temp-directory": "nyc/.nyc_output"
|
|
78
68
|
},
|
|
79
69
|
"dependencies": {
|
|
80
|
-
"@fluid-internal/client-utils": ">=2.0.0-rc.
|
|
81
|
-
"@fluidframework/container-definitions": ">=2.0.0-rc.
|
|
82
|
-
"@fluidframework/core-interfaces": ">=2.0.0-rc.
|
|
83
|
-
"@fluidframework/core-utils": ">=2.0.0-rc.
|
|
84
|
-
"@fluidframework/datastore-definitions": ">=2.0.0-rc.
|
|
85
|
-
"@fluidframework/driver-definitions": ">=2.0.0-rc.
|
|
86
|
-
"@fluidframework/driver-utils": ">=2.0.0-rc.
|
|
87
|
-
"@fluidframework/id-compressor": ">=2.0.0-rc.
|
|
70
|
+
"@fluid-internal/client-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
71
|
+
"@fluidframework/container-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
72
|
+
"@fluidframework/core-interfaces": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
73
|
+
"@fluidframework/core-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
74
|
+
"@fluidframework/datastore-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
75
|
+
"@fluidframework/driver-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
76
|
+
"@fluidframework/driver-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
77
|
+
"@fluidframework/id-compressor": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
88
78
|
"@fluidframework/protocol-definitions": "^3.2.0",
|
|
89
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-rc.
|
|
90
|
-
"@fluidframework/runtime-utils": ">=2.0.0-rc.
|
|
91
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-rc.
|
|
79
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
80
|
+
"@fluidframework/runtime-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
81
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
92
82
|
"uuid": "^9.0.0"
|
|
93
83
|
},
|
|
94
84
|
"devDependencies": {
|
|
95
|
-
"@arethetypeswrong/cli": "^0.
|
|
96
|
-
"@
|
|
97
|
-
"@fluid-
|
|
85
|
+
"@arethetypeswrong/cli": "^0.15.2",
|
|
86
|
+
"@biomejs/biome": "^1.6.2",
|
|
87
|
+
"@fluid-internal/mocha-test-setup": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
88
|
+
"@fluid-tools/build-cli": "^0.37.0",
|
|
98
89
|
"@fluidframework/build-common": "^2.0.3",
|
|
99
|
-
"@fluidframework/build-tools": "^0.
|
|
90
|
+
"@fluidframework/build-tools": "^0.37.0",
|
|
100
91
|
"@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0-internal.8.0.0",
|
|
101
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
102
|
-
"@fluidframework/test-runtime-utils": ">=2.0.0-rc.
|
|
92
|
+
"@fluidframework/eslint-config-fluid": "^5.1.0",
|
|
93
|
+
"@fluidframework/test-runtime-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
103
94
|
"@microsoft/api-extractor": "^7.42.3",
|
|
95
|
+
"@types/lodash": "^4.14.118",
|
|
104
96
|
"@types/mocha": "^9.1.1",
|
|
105
97
|
"@types/node": "^18.19.0",
|
|
106
98
|
"@types/uuid": "^9.0.2",
|
|
@@ -116,18 +108,6 @@
|
|
|
116
108
|
"rimraf": "^4.4.0",
|
|
117
109
|
"typescript": "~5.1.6"
|
|
118
110
|
},
|
|
119
|
-
"fluidBuild": {
|
|
120
|
-
"tasks": {
|
|
121
|
-
"build:docs": {
|
|
122
|
-
"dependsOn": [
|
|
123
|
-
"...",
|
|
124
|
-
"api-extractor:commonjs",
|
|
125
|
-
"api-extractor:esnext"
|
|
126
|
-
],
|
|
127
|
-
"script": false
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
111
|
"typeValidation": {
|
|
132
112
|
"broken": {
|
|
133
113
|
"ClassDeclaration_FluidDataStoreRuntime": {
|
|
@@ -137,27 +117,28 @@
|
|
|
137
117
|
},
|
|
138
118
|
"scripts": {
|
|
139
119
|
"api": "fluid-build . --task api",
|
|
140
|
-
"api-extractor:commonjs": "
|
|
141
|
-
"api-extractor:esnext": "
|
|
120
|
+
"api-extractor:commonjs": "flub generate entrypoints --outFileAlpha legacy --outDir ./dist",
|
|
121
|
+
"api-extractor:esnext": "flub generate entrypoints --outFileAlpha legacy --outDir ./lib --node10TypeCompat",
|
|
142
122
|
"build": "fluid-build . --task build",
|
|
143
123
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
144
124
|
"build:compile": "fluid-build . --task compile",
|
|
145
|
-
"build:docs": "
|
|
125
|
+
"build:docs": "api-extractor run --local",
|
|
146
126
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
127
|
+
"build:genver": "gen-version",
|
|
147
128
|
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
148
129
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
149
130
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
150
|
-
"check:are-the-types-wrong": "attw --pack .
|
|
131
|
+
"check:are-the-types-wrong": "attw --pack .",
|
|
132
|
+
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
151
133
|
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
152
134
|
"ci:build:docs": "api-extractor run",
|
|
153
|
-
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
135
|
+
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
154
136
|
"eslint": "eslint --format stylish src",
|
|
155
137
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
156
|
-
"format": "
|
|
157
|
-
"
|
|
158
|
-
"lint
|
|
159
|
-
"
|
|
160
|
-
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
138
|
+
"format": "fluid-build --task format .",
|
|
139
|
+
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
140
|
+
"lint": "fluid-build . --task lint",
|
|
141
|
+
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
161
142
|
"test": "npm run test:mocha",
|
|
162
143
|
"test:coverage": "c8 npm test",
|
|
163
144
|
"test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
|
package/src/channelContext.ts
CHANGED
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
DataCorruptionError,
|
|
8
|
-
ITelemetryLoggerExt,
|
|
9
|
-
tagCodeArtifacts,
|
|
10
|
-
} from "@fluidframework/telemetry-utils";
|
|
11
6
|
import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
12
7
|
import {
|
|
13
8
|
IChannel,
|
|
@@ -15,20 +10,25 @@ import {
|
|
|
15
10
|
IChannelFactory,
|
|
16
11
|
IFluidDataStoreRuntime,
|
|
17
12
|
} from "@fluidframework/datastore-definitions";
|
|
18
|
-
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
13
|
+
import { IDocumentStorageService } from "@fluidframework/driver-definitions/internal";
|
|
14
|
+
import { readAndParse } from "@fluidframework/driver-utils/internal";
|
|
19
15
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
20
16
|
import {
|
|
21
|
-
IGarbageCollectionData,
|
|
22
17
|
IExperimentalIncrementalSummaryContext,
|
|
23
|
-
|
|
18
|
+
IGarbageCollectionData,
|
|
24
19
|
ISummaryTreeWithStats,
|
|
25
20
|
ITelemetryContext,
|
|
26
|
-
IFluidDataStoreContext,
|
|
27
21
|
} from "@fluidframework/runtime-definitions";
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
import {
|
|
23
|
+
IFluidDataStoreContext,
|
|
24
|
+
ISummarizeResult,
|
|
25
|
+
} from "@fluidframework/runtime-definitions/internal";
|
|
26
|
+
import { addBlobToSummary } from "@fluidframework/runtime-utils/internal";
|
|
27
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
28
|
+
import { DataCorruptionError, tagCodeArtifacts } from "@fluidframework/telemetry-utils/internal";
|
|
29
|
+
|
|
31
30
|
import { ChannelDeltaConnection } from "./channelDeltaConnection.js";
|
|
31
|
+
import { ChannelStorageService } from "./channelStorageService.js";
|
|
32
32
|
import { ISharedObjectRegistry } from "./dataStoreRuntime.js";
|
|
33
33
|
|
|
34
34
|
export const attributesBlobKey = ".attributes";
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/core-utils";
|
|
7
|
-
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { IDeltaConnection, IDeltaHandler } from "@fluidframework/datastore-definitions";
|
|
9
|
-
import { DataProcessingError } from "@fluidframework/telemetry-utils";
|
|
10
6
|
import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { assert } from "@fluidframework/core-utils/internal";
|
|
8
|
+
import { IDeltaConnection, IDeltaHandler } from "@fluidframework/datastore-definitions";
|
|
9
|
+
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
10
|
+
import { DataProcessingError } from "@fluidframework/telemetry-utils/internal";
|
|
11
11
|
|
|
12
12
|
const stashedOpMetadataMark = Symbol();
|
|
13
13
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
7
|
-
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
8
6
|
import { IChannelStorageService } from "@fluidframework/datastore-definitions";
|
|
9
|
-
import {
|
|
7
|
+
import { IDocumentStorageService } from "@fluidframework/driver-definitions/internal";
|
|
8
|
+
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
9
|
+
import { getNormalizedObjectStoragePathParts } from "@fluidframework/runtime-utils/internal";
|
|
10
10
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
11
11
|
|
|
12
12
|
export class ChannelStorageService implements IChannelStorageService {
|