@fluidframework/shared-object-base 2.0.0-rc.1.0.3 → 2.0.0-rc.2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +4 -1
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +10 -0
  4. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  5. package/api-extractor-lint.json +1 -1
  6. package/api-extractor.json +1 -1
  7. package/api-report/shared-object-base.api.md +7 -9
  8. package/dist/handle.d.ts +1 -1
  9. package/dist/handle.d.ts.map +1 -1
  10. package/dist/handle.js.map +1 -1
  11. package/dist/index.d.ts +6 -6
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +16 -15
  14. package/dist/index.js.map +1 -1
  15. package/dist/package.json +3 -0
  16. package/dist/packageVersion.d.ts +1 -1
  17. package/dist/packageVersion.js +1 -1
  18. package/dist/packageVersion.js.map +1 -1
  19. package/dist/serializer.js +2 -2
  20. package/dist/serializer.js.map +1 -1
  21. package/dist/shared-object-base-alpha.d.ts +26 -10
  22. package/dist/shared-object-base-beta.d.ts +6 -277
  23. package/dist/shared-object-base-public.d.ts +6 -277
  24. package/dist/shared-object-base-untrimmed.d.ts +31 -10
  25. package/dist/sharedObject.d.ts +26 -12
  26. package/dist/sharedObject.d.ts.map +1 -1
  27. package/dist/sharedObject.js +56 -41
  28. package/dist/sharedObject.js.map +1 -1
  29. package/dist/summarySerializer.d.ts +1 -1
  30. package/dist/summarySerializer.d.ts.map +1 -1
  31. package/dist/summarySerializer.js +2 -2
  32. package/dist/summarySerializer.js.map +1 -1
  33. package/dist/tsdoc-metadata.json +1 -1
  34. package/dist/utils.d.ts +7 -1
  35. package/dist/utils.d.ts.map +1 -1
  36. package/dist/utils.js +14 -1
  37. package/dist/utils.js.map +1 -1
  38. package/lib/{handle.d.mts → handle.d.ts} +2 -2
  39. package/lib/handle.d.ts.map +1 -0
  40. package/lib/{handle.mjs → handle.js} +1 -1
  41. package/lib/handle.js.map +1 -0
  42. package/lib/index.d.ts +11 -0
  43. package/lib/index.d.ts.map +1 -0
  44. package/lib/index.js +10 -0
  45. package/lib/index.js.map +1 -0
  46. package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
  47. package/lib/packageVersion.d.ts.map +1 -0
  48. package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
  49. package/lib/packageVersion.js.map +1 -0
  50. package/lib/{remoteObjectHandle.d.mts → remoteObjectHandle.d.ts} +1 -1
  51. package/lib/remoteObjectHandle.d.ts.map +1 -0
  52. package/lib/{remoteObjectHandle.mjs → remoteObjectHandle.js} +1 -1
  53. package/lib/remoteObjectHandle.js.map +1 -0
  54. package/lib/{serializer.d.mts → serializer.d.ts} +1 -1
  55. package/lib/serializer.d.ts.map +1 -0
  56. package/lib/{serializer.mjs → serializer.js} +4 -2
  57. package/lib/serializer.js.map +1 -0
  58. package/lib/{shared-object-base-alpha.d.mts → shared-object-base-alpha.d.ts} +26 -10
  59. package/lib/shared-object-base-beta.d.ts +118 -0
  60. package/lib/shared-object-base-public.d.ts +118 -0
  61. package/lib/{shared-object-base-untrimmed.d.mts → shared-object-base-untrimmed.d.ts} +31 -10
  62. package/lib/{sharedObject.d.mts → sharedObject.d.ts} +27 -13
  63. package/lib/sharedObject.d.ts.map +1 -0
  64. package/lib/{sharedObject.mjs → sharedObject.js} +54 -39
  65. package/lib/sharedObject.js.map +1 -0
  66. package/lib/{summarySerializer.d.mts → summarySerializer.d.ts} +2 -2
  67. package/lib/summarySerializer.d.ts.map +1 -0
  68. package/lib/{summarySerializer.mjs → summarySerializer.js} +2 -2
  69. package/lib/summarySerializer.js.map +1 -0
  70. package/lib/test/attachingBindingAndConnecting.spec.js +334 -0
  71. package/lib/test/attachingBindingAndConnecting.spec.js.map +1 -0
  72. package/lib/test/serializer.spec.js +166 -0
  73. package/lib/test/serializer.spec.js.map +1 -0
  74. package/lib/test/sharedObject.spec.js +72 -0
  75. package/lib/test/sharedObject.spec.js.map +1 -0
  76. package/lib/test/types/validateSharedObjectBasePrevious.generated.js +26 -0
  77. package/lib/test/types/validateSharedObjectBasePrevious.generated.js.map +1 -0
  78. package/lib/test/utils.js +37 -0
  79. package/lib/test/utils.js.map +1 -0
  80. package/lib/{types.d.mts → types.d.ts} +1 -1
  81. package/lib/types.d.ts.map +1 -0
  82. package/lib/{types.mjs → types.js} +1 -1
  83. package/lib/types.js.map +1 -0
  84. package/lib/{utils.d.mts → utils.d.ts} +8 -2
  85. package/lib/utils.d.ts.map +1 -0
  86. package/lib/{utils.mjs → utils.js} +13 -1
  87. package/lib/utils.js.map +1 -0
  88. package/lib/{valueType.d.mts → valueType.d.ts} +1 -1
  89. package/lib/valueType.d.ts.map +1 -0
  90. package/lib/{valueType.mjs → valueType.js} +1 -1
  91. package/lib/valueType.js.map +1 -0
  92. package/package.json +44 -49
  93. package/src/handle.ts +1 -1
  94. package/src/index.ts +7 -6
  95. package/src/packageVersion.ts +1 -1
  96. package/src/serializer.ts +1 -1
  97. package/src/sharedObject.ts +84 -53
  98. package/src/summarySerializer.ts +1 -1
  99. package/src/utils.ts +14 -1
  100. package/tsconfig.cjs.json +7 -0
  101. package/tsconfig.json +2 -5
  102. package/lib/handle.d.mts.map +0 -1
  103. package/lib/handle.mjs.map +0 -1
  104. package/lib/index.d.mts +0 -11
  105. package/lib/index.d.mts.map +0 -1
  106. package/lib/index.mjs +0 -10
  107. package/lib/index.mjs.map +0 -1
  108. package/lib/packageVersion.d.mts.map +0 -1
  109. package/lib/packageVersion.mjs.map +0 -1
  110. package/lib/remoteObjectHandle.d.mts.map +0 -1
  111. package/lib/remoteObjectHandle.mjs.map +0 -1
  112. package/lib/serializer.d.mts.map +0 -1
  113. package/lib/serializer.mjs.map +0 -1
  114. package/lib/shared-object-base-beta.d.mts +0 -389
  115. package/lib/shared-object-base-public.d.mts +0 -389
  116. package/lib/sharedObject.d.mts.map +0 -1
  117. package/lib/sharedObject.mjs.map +0 -1
  118. package/lib/summarySerializer.d.mts.map +0 -1
  119. package/lib/summarySerializer.mjs.map +0 -1
  120. package/lib/types.d.mts.map +0 -1
  121. package/lib/types.mjs.map +0 -1
  122. package/lib/utils.d.mts.map +0 -1
  123. package/lib/utils.mjs.map +0 -1
  124. package/lib/valueType.d.mts.map +0 -1
  125. package/lib/valueType.mjs.map +0 -1
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.38.3"
8
+ "packageVersion": "7.42.3"
9
9
  }
10
10
  ]
11
11
  }
package/dist/utils.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { IFluidHandle } from "@fluidframework/core-interfaces";
6
6
  import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
7
- import { IFluidSerializer } from "./serializer";
7
+ import { IFluidSerializer } from "./serializer.js";
8
8
  /**
9
9
  * Given a mostly-plain object that may have handle objects embedded within, return a string representation of an object
10
10
  * where the handle objects have been replaced with a serializable form.
@@ -48,4 +48,10 @@ export declare function parseHandles(value: any, serializer: IFluidSerializer):
48
48
  * @internal
49
49
  */
50
50
  export declare function createSingleBlobSummary(key: string, content: string | Uint8Array): ISummaryTreeWithStats;
51
+ /**
52
+ * Binds all handles found in `value` to `bind`. Does not modify original input.
53
+ *
54
+ * @internal
55
+ */
56
+ export declare function bindHandles(value: any, serializer: IFluidSerializer, bind: IFluidHandle): void;
51
57
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,YAAY,GAChB,MAAM,GAAG,SAAS,CAGpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,YAAY,OAIlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,gBAAgB,OAGpE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GAAG,UAAU,GAC1B,qBAAqB,CAIvB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,YAAY,GAChB,MAAM,GAAG,SAAS,CAGpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,YAAY,OAIlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,gBAAgB,OAGpE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GAAG,UAAU,GAC1B,qBAAqB,CAIvB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAM9F"}
package/dist/utils.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.createSingleBlobSummary = exports.parseHandles = exports.makeHandlesSerializable = exports.serializeHandles = void 0;
7
+ exports.bindHandles = exports.createSingleBlobSummary = exports.parseHandles = exports.makeHandlesSerializable = exports.serializeHandles = void 0;
8
8
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
9
9
  /**
10
10
  * Given a mostly-plain object that may have handle objects embedded within, return a string representation of an object
@@ -66,4 +66,17 @@ function createSingleBlobSummary(key, content) {
66
66
  return builder.getSummaryTree();
67
67
  }
68
68
  exports.createSingleBlobSummary = createSingleBlobSummary;
69
+ /**
70
+ * Binds all handles found in `value` to `bind`. Does not modify original input.
71
+ *
72
+ * @internal
73
+ */
74
+ function bindHandles(value, serializer, bind) {
75
+ // N.B. AB#7316 this could be made more efficient by writing an ad hoc
76
+ // implementation that doesn't clone at all. Today the distinction between
77
+ // this function and `encode` is purely semantic -- encoding both serializes
78
+ // handles and binds them, but sometimes we only wish to do the latter
79
+ serializer.encode(value, bind);
80
+ }
81
+ exports.bindHandles = bindHandles;
69
82
  //# sourceMappingURL=utils.js.map
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iEAAmE;AAGnE;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAC/B,KAAU,EACV,UAA4B,EAC5B,IAAkB;IAElB,+DAA+D;IAC/D,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACxE,CAAC;AAPD,4CAOC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,uBAAuB,CACtC,KAAU,EACV,UAA4B,EAC5B,IAAkB;IAElB,+DAA+D;IAC/D,OAAO,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC;AAPD,0DAOC;AAED;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAAC,KAAU,EAAE,UAA4B;IACpE,+DAA+D;IAC/D,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9E,CAAC;AAHD,oCAGC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACtC,GAAW,EACX,OAA4B;IAE5B,MAAM,OAAO,GAAG,IAAI,kCAAkB,EAAE,CAAC;IACzC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,cAAc,EAAE,CAAC;AACjC,CAAC;AAPD,0DAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport { IFluidSerializer } from \"./serializer\";\n\n/**\n * Given a mostly-plain object that may have handle objects embedded within, return a string representation of an object\n * where the handle objects have been replaced with a serializable form.\n * @param value - The mostly-plain object\n * @param serializer - The serializer that knows how to convert handles into serializable format\n * @param context - The handle context for the container\n * @param bind - Bind any other handles we find in the object against this given handle.\n * @returns Result of strigifying an object\n * @internal\n */\nexport function serializeHandles(\n\tvalue: any,\n\tserializer: IFluidSerializer,\n\tbind: IFluidHandle,\n): string | undefined {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn value !== undefined ? serializer.stringify(value, bind) : value;\n}\n\n/**\n * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n * where any embedded IFluidHandles have been replaced with a serializable form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n *\n * @param input - The mostly-plain object\n * @param context - The handle context for the container\n * @param bind - Bind any other handles we find in the object against this given handle.\n * @returns The fully-plain object\n * @alpha\n */\nexport function makeHandlesSerializable(\n\tvalue: any,\n\tserializer: IFluidSerializer,\n\tbind: IFluidHandle,\n) {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn serializer.encode(value, bind);\n}\n\n/**\n * Given a fully-plain object that may have serializable-form handles within, will return the mostly-plain object\n * with handle objects created instead.\n * @param value - The fully-plain object\n * @param serializer - The serializer that knows how to convert serializable-form handles into handle objects\n * @param context - The handle context for the container\n * @returns The mostly-plain object with handle objects within\n * @alpha\n */\nexport function parseHandles(value: any, serializer: IFluidSerializer) {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn value !== undefined ? serializer.parse(JSON.stringify(value)) : value;\n}\n\n/**\n * Create a new summary containing one blob\n * @param key - the key for the blob in the summary\n * @param content - blob content\n * @returns The summary containing the blob\n * @internal\n */\nexport function createSingleBlobSummary(\n\tkey: string,\n\tcontent: string | Uint8Array,\n): ISummaryTreeWithStats {\n\tconst builder = new SummaryTreeBuilder();\n\tbuilder.addBlob(key, content);\n\treturn builder.getSummaryTree();\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iEAAmE;AAGnE;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAC/B,KAAU,EACV,UAA4B,EAC5B,IAAkB;IAElB,+DAA+D;IAC/D,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACxE,CAAC;AAPD,4CAOC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,uBAAuB,CACtC,KAAU,EACV,UAA4B,EAC5B,IAAkB;IAElB,+DAA+D;IAC/D,OAAO,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC;AAPD,0DAOC;AAED;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAAC,KAAU,EAAE,UAA4B;IACpE,+DAA+D;IAC/D,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9E,CAAC;AAHD,oCAGC;AAED;;;;;;GAMG;AACH,SAAgB,uBAAuB,CACtC,GAAW,EACX,OAA4B;IAE5B,MAAM,OAAO,GAAG,IAAI,kCAAkB,EAAE,CAAC;IACzC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,cAAc,EAAE,CAAC;AACjC,CAAC;AAPD,0DAOC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,KAAU,EAAE,UAA4B,EAAE,IAAkB;IACvF,sEAAsE;IACtE,0EAA0E;IAC1E,4EAA4E;IAC5E,sEAAsE;IACtE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC;AAND,kCAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport { IFluidSerializer } from \"./serializer.js\";\n\n/**\n * Given a mostly-plain object that may have handle objects embedded within, return a string representation of an object\n * where the handle objects have been replaced with a serializable form.\n * @param value - The mostly-plain object\n * @param serializer - The serializer that knows how to convert handles into serializable format\n * @param context - The handle context for the container\n * @param bind - Bind any other handles we find in the object against this given handle.\n * @returns Result of strigifying an object\n * @internal\n */\nexport function serializeHandles(\n\tvalue: any,\n\tserializer: IFluidSerializer,\n\tbind: IFluidHandle,\n): string | undefined {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn value !== undefined ? serializer.stringify(value, bind) : value;\n}\n\n/**\n * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n * where any embedded IFluidHandles have been replaced with a serializable form.\n *\n * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n * the root to any replaced handles. (If no handles are found, returns the original object.)\n *\n * @param input - The mostly-plain object\n * @param context - The handle context for the container\n * @param bind - Bind any other handles we find in the object against this given handle.\n * @returns The fully-plain object\n * @alpha\n */\nexport function makeHandlesSerializable(\n\tvalue: any,\n\tserializer: IFluidSerializer,\n\tbind: IFluidHandle,\n) {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn serializer.encode(value, bind);\n}\n\n/**\n * Given a fully-plain object that may have serializable-form handles within, will return the mostly-plain object\n * with handle objects created instead.\n * @param value - The fully-plain object\n * @param serializer - The serializer that knows how to convert serializable-form handles into handle objects\n * @param context - The handle context for the container\n * @returns The mostly-plain object with handle objects within\n * @alpha\n */\nexport function parseHandles(value: any, serializer: IFluidSerializer) {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn value !== undefined ? serializer.parse(JSON.stringify(value)) : value;\n}\n\n/**\n * Create a new summary containing one blob\n * @param key - the key for the blob in the summary\n * @param content - blob content\n * @returns The summary containing the blob\n * @internal\n */\nexport function createSingleBlobSummary(\n\tkey: string,\n\tcontent: string | Uint8Array,\n): ISummaryTreeWithStats {\n\tconst builder = new SummaryTreeBuilder();\n\tbuilder.addBlob(key, content);\n\treturn builder.getSummaryTree();\n}\n\n/**\n * Binds all handles found in `value` to `bind`. Does not modify original input.\n *\n * @internal\n */\nexport function bindHandles(value: any, serializer: IFluidSerializer, bind: IFluidHandle): void {\n\t// N.B. AB#7316 this could be made more efficient by writing an ad hoc\n\t// implementation that doesn't clone at all. Today the distinction between\n\t// this function and `encode` is purely semantic -- encoding both serializes\n\t// handles and binds them, but sometimes we only wish to do the latter\n\tserializer.encode(value, bind);\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { IFluidHandleContext } from "@fluidframework/core-interfaces";
6
6
  import { FluidObjectHandle } from "@fluidframework/datastore";
7
- import { ISharedObject } from "./types.mjs";
7
+ import { ISharedObject } from "./types.js";
8
8
  /**
9
9
  * Handle for a shared object.
10
10
  *
@@ -36,4 +36,4 @@ export declare class SharedObjectHandle extends FluidObjectHandle<ISharedObject>
36
36
  */
37
37
  attachGraph(): void;
38
38
  }
39
- //# sourceMappingURL=handle.d.mts.map
39
+ //# sourceMappingURL=handle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;GAUG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB,CAAC,aAAa,CAAC;IAgBtE,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa;IAfxC;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;;;;;OAMG;gBAEiB,KAAK,EAAE,aAAa,EACvC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB;IAKlC;;;OAGG;IACI,WAAW,IAAI,IAAI;CAI1B"}
@@ -41,4 +41,4 @@ export class SharedObjectHandle extends FluidObjectHandle {
41
41
  super.attachGraph();
42
42
  }
43
43
  }
44
- //# sourceMappingURL=handle.mjs.map
44
+ //# sourceMappingURL=handle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D;;;;;;;;;;GAUG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAgC;IACvE;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,YACoB,KAAoB,EACvC,IAAY,EACZ,YAAiC;QAEjC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAJd,UAAK,GAAL,KAAK,CAAe;IAKxC,CAAC;IAED;;;OAGG;IACI,WAAW;QACjB,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { ISharedObject } from \"./types.js\";\n\n/**\n * Handle for a shared object.\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects and is used only for serialization purposes.\n *\n * De-serialization process goes through {@link @fluidframework/datastore#FluidObjectHandle}, and request flow:\n * {@link @fluidframework/datastore#FluidDataStoreRuntime.request} recognizes requests in the form of\n * '/\\<shared object id\\>' and loads shared object.\n */\nexport class SharedObjectHandle extends FluidObjectHandle<ISharedObject> {\n\t/**\n\t * Whether services have been attached for the associated shared object.\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.value.isAttached();\n\t}\n\n\t/**\n\t * Creates a new SharedObjectHandle.\n\t * @param value - The shared object this handle is for.\n\t * @param path - The id of the shared object. It is also the path to this object relative to the routeContext.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: ISharedObject,\n\t\tpath: string,\n\t\trouteContext: IFluidHandleContext,\n\t) {\n\t\tsuper(value, path, routeContext);\n\t}\n\n\t/**\n\t * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.\n\t * When attaching the handle, it registers the associated shared object.\n\t */\n\tpublic attachGraph(): void {\n\t\tthis.value.bindToContext();\n\t\tsuper.attachGraph();\n\t}\n}\n"]}
package/lib/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { FluidSerializer, IFluidSerializer } from "./serializer.js";
6
+ export { SharedObject, SharedObjectCore } from "./sharedObject.js";
7
+ export { SummarySerializer } from "./summarySerializer.js";
8
+ export { ISharedObject, ISharedObjectEvents } from "./types.js";
9
+ export { createSingleBlobSummary, makeHandlesSerializable, parseHandles, serializeHandles, bindHandles, } from "./utils.js";
10
+ export { ValueType } from "./valueType.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { FluidSerializer } from "./serializer.js";
6
+ export { SharedObject, SharedObjectCore } from "./sharedObject.js";
7
+ export { SummarySerializer } from "./summarySerializer.js";
8
+ export { createSingleBlobSummary, makeHandlesSerializable, parseHandles, serializeHandles, bindHandles, } from "./utils.js";
9
+ export { ValueType } from "./valueType.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAoB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { FluidSerializer, IFluidSerializer } from \"./serializer.js\";\nexport { SharedObject, SharedObjectCore } from \"./sharedObject.js\";\nexport { SummarySerializer } from \"./summarySerializer.js\";\nexport { ISharedObject, ISharedObjectEvents } from \"./types.js\";\nexport {\n\tcreateSingleBlobSummary,\n\tmakeHandlesSerializable,\n\tparseHandles,\n\tserializeHandles,\n\tbindHandles,\n} from \"./utils.js\";\nexport { ValueType } from \"./valueType.js\";\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/shared-object-base";
8
- export declare const pkgVersion = "2.0.0-rc.1.0.3";
9
- //# sourceMappingURL=packageVersion.d.mts.map
8
+ export declare const pkgVersion = "2.0.0-rc.2.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,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/shared-object-base";
8
- export const pkgVersion = "2.0.0-rc.1.0.3";
9
- //# sourceMappingURL=packageVersion.mjs.map
8
+ export const pkgVersion = "2.0.0-rc.2.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,oCAAoC,CAAC;AAC5D,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/shared-object-base\";\nexport const pkgVersion = \"2.0.0-rc.2.0.0\";\n"]}
@@ -27,4 +27,4 @@ export declare class RemoteFluidObjectHandle implements IFluidHandle {
27
27
  attachGraph(): void;
28
28
  bind(handle: IFluidHandle): void;
29
29
  }
30
- //# sourceMappingURL=remoteObjectHandle.d.mts.map
30
+ //# sourceMappingURL=remoteObjectHandle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,YAAY,EACZ,mBAAmB,EAGnB,MAAM,iCAAiC,CAAC;AAGzC;;;;;;GAMG;AACH,qBAAa,uBAAwB,YAAW,YAAY;aAiB1C,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;IAjBlD,IAAW,mBAAmB,SAE7B;IACD,IAAW,YAAY,SAEtB;IAED,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;OAIG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB;IAQrC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAoBzB,WAAW,IAAI,IAAI;IAInB,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;CAGvC"}
@@ -56,4 +56,4 @@ export class RemoteFluidObjectHandle {
56
56
  handle.attachGraph();
57
57
  }
58
58
  }
59
- //# sourceMappingURL=remoteObjectHandle.mjs.map
59
+ //# sourceMappingURL=remoteObjectHandle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteObjectHandle.js","sourceRoot":"","sources":["../src/remoteObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAOnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,OAAO,uBAAuB;IACnC,IAAW,mBAAmB;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAKD;;;;OAIG;IACH,YACiB,YAAoB,EACpB,YAAiC;QADjC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QAVlC,eAAU,GAAG,IAAI,CAAC;QAYjC,MAAM,CACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YAC/B,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE;aAC7C,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY;iBAC9B,aAAa,CAAC,OAAO,CAAC;iBACtB,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBAC/B,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;oBACzC,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAK,CAAC;oBAChD,OAAO,WAAW,CAAC;iBACnB;gBACD,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;SACJ;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC/B,MAAM,CAAC,WAAW,EAAE,CAAC;IACtB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport { RuntimeHeaders } from \"@fluidframework/container-runtime\";\nimport {\n\tIFluidHandle,\n\tIFluidHandleContext,\n\tIRequest,\n\tFluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { responseToException } from \"@fluidframework/runtime-utils\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n */\nexport class RemoteFluidObjectHandle implements IFluidHandle {\n\tpublic get IFluidHandleContext() {\n\t\treturn this;\n\t}\n\tpublic get IFluidHandle() {\n\t\treturn this;\n\t}\n\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t) {\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<any> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: { [RuntimeHeaders.viaHandle]: true },\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext\n\t\t\t\t.resolveHandle(request)\n\t\t\t\t.then<FluidObject>((response) => {\n\t\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\t\tconst fluidObject: FluidObject = response.value;\n\t\t\t\t\t\treturn fluidObject;\n\t\t\t\t\t}\n\t\t\t\t\tthrow responseToException(response, request);\n\t\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n\n\tpublic bind(handle: IFluidHandle): void {\n\t\thandle.attachGraph();\n\t}\n}\n"]}
@@ -75,4 +75,4 @@ export declare class FluidSerializer implements IFluidSerializer {
75
75
  url: string;
76
76
  };
77
77
  }
78
- //# sourceMappingURL=serializer.d.mts.map
78
+ //# sourceMappingURL=serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAGpF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,GAAG,CAAC;IAE5C;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAElD;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CAC1B;AAED;;;GAGG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IAItD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAExB,OAAO,CAAC,QAAQ,CAAC,cAAc;IALhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;gBAGzB,OAAO,EAAE,mBAAmB,EAE5B,cAAc,GAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAe;IAQ3E,IAAW,gBAAgB,SAE1B;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY;IAS5C;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,EAAE,GAAG;IASjB,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY;IAKxC,KAAK,CAAC,KAAK,EAAE,MAAM;IAM1B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAM1B;IAIF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAe1B;IAKF,OAAO,CAAC,kBAAkB;IA6C1B,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY;;;;CAOlE"}
@@ -2,8 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ // RATIONALE: Many methods consume and return 'any' by necessity.
6
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
5
7
  import { generateHandleContextPath, isSerializedHandle } from "@fluidframework/runtime-utils";
6
- import { RemoteFluidObjectHandle } from "./remoteObjectHandle.mjs";
8
+ import { RemoteFluidObjectHandle } from "./remoteObjectHandle.js";
7
9
  /**
8
10
  * Data Store serializer implementation
9
11
  * @internal
@@ -135,4 +137,4 @@ export class FluidSerializer {
135
137
  };
136
138
  }
137
139
  }
138
- //# sourceMappingURL=serializer.mjs.map
140
+ //# sourceMappingURL=serializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// RATIONALE: Many methods consume and return 'any' by necessity.\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n\nimport { generateHandleContextPath, isSerializedHandle } from \"@fluidframework/runtime-utils\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { RemoteFluidObjectHandle } from \"./remoteObjectHandle.js\";\n\n/**\n * @public\n */\nexport interface IFluidSerializer {\n\t/**\n\t * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n\t * where any embedded IFluidHandles have been replaced with a serializable form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t */\n\tencode(value: any, bind: IFluidHandle): any;\n\n\t/**\n\t * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n\t * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * The decoded handles are implicitly bound to the handle context of this serializer.\n\t */\n\tdecode(input: any): any;\n\n\t/**\n\t * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.\n\t */\n\tstringify(value: any, bind: IFluidHandle): string;\n\n\t/**\n\t * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid\n\t * handles will be realized as part of the parse\n\t */\n\tparse(value: string): any;\n}\n\n/**\n * Data Store serializer implementation\n * @internal\n */\nexport class FluidSerializer implements IFluidSerializer {\n\tprivate readonly root: IFluidHandleContext;\n\n\tpublic constructor(\n\t\tprivate readonly context: IFluidHandleContext,\n\t\t// To be called whenever a handle is parsed by this serializer.\n\t\tprivate readonly handleParsedCb: (handle: IFluidHandle) => void = () => {},\n\t) {\n\t\tthis.root = this.context;\n\t\twhile (this.root.routeContext !== undefined) {\n\t\t\tthis.root = this.root.routeContext;\n\t\t}\n\t}\n\n\tpublic get IFluidSerializer() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Given a mostly-jsonable object tree that may have handle objects embedded within, will return a\n\t * fully-jsonable object tree where any embedded IFluidHandles have been replaced with a serializable form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * Any unbound handles encountered are bound to the provided IFluidHandle.\n\t */\n\tpublic encode(input: any, bind: IFluidHandle) {\n\t\t// If the given 'input' cannot contain handles, return it immediately. Otherwise,\n\t\t// return the result of 'recursivelyReplace()'.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\treturn !!input && typeof input === \"object\"\n\t\t\t? this.recursivelyReplace(input, this.encodeValue, bind)\n\t\t\t: input;\n\t}\n\n\t/**\n\t * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n\t * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * The decoded handles are implicitly bound to the handle context of this serializer.\n\t */\n\tpublic decode(input: any) {\n\t\t// If the given 'input' cannot contain handles, return it immediately. Otherwise,\n\t\t// return the result of 'recursivelyReplace()'.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\treturn !!input && typeof input === \"object\"\n\t\t\t? this.recursivelyReplace(input, this.decodeValue)\n\t\t\t: input;\n\t}\n\n\tpublic stringify(input: any, bind: IFluidHandle) {\n\t\treturn JSON.stringify(input, (key, value) => this.encodeValue(value, bind));\n\t}\n\n\t// Parses the serialized data - context must match the context with which the JSON was stringified\n\tpublic parse(input: string) {\n\t\treturn JSON.parse(input, (key, value) => this.decodeValue(value));\n\t}\n\n\t// If the given 'value' is an IFluidHandle, returns the encoded IFluidHandle.\n\t// Otherwise returns the original 'value'. Used by 'encode()' and 'stringify()'.\n\tprivate readonly encodeValue = (value: any, bind: IFluidHandle) => {\n\t\t// Detect if 'value' is an IFluidHandle.\n\t\tconst handle = value?.IFluidHandle;\n\n\t\t// If 'value' is an IFluidHandle return its encoded form.\n\t\treturn handle !== undefined ? this.serializeHandle(handle, bind) : value;\n\t};\n\n\t// If the given 'value' is an encoded IFluidHandle, returns the decoded IFluidHandle.\n\t// Otherwise returns the original 'value'. Used by 'decode()' and 'parse()'.\n\tprivate readonly decodeValue = (value: any) => {\n\t\t// If 'value' is a serialized IFluidHandle return the deserialized result.\n\t\tif (isSerializedHandle(value)) {\n\t\t\t// Old documents may have handles with relative path in their summaries. Convert these to absolute\n\t\t\t// paths. This will ensure that future summaries will have absolute paths for these handles.\n\t\t\tconst absolutePath = value.url.startsWith(\"/\")\n\t\t\t\t? value.url\n\t\t\t\t: generateHandleContextPath(value.url, this.context);\n\n\t\t\tconst parsedHandle = new RemoteFluidObjectHandle(absolutePath, this.root);\n\t\t\tthis.handleParsedCb(parsedHandle);\n\t\t\treturn parsedHandle;\n\t\t} else {\n\t\t\treturn value;\n\t\t}\n\t};\n\n\t// Invoked for non-null objects to recursively replace references to IFluidHandles.\n\t// Clones as-needed to avoid mutating the `input` object. If no IFluidHandes are present,\n\t// returns the original `input`.\n\tprivate recursivelyReplace(\n\t\tinput: any,\n\t\treplacer: (input: any, context: any) => any,\n\t\tcontext?: any,\n\t) {\n\t\t// Note: Caller is responsible for ensuring that `input` is defined / non-null.\n\t\t// (Required for Object.keys() below.)\n\n\t\t// Execute the `replace` on the current input. Note that Caller is responsible for ensuring that `input`\n\t\t// is a non-null object.\n\t\tconst maybeReplaced = replacer(input, context);\n\n\t\t// If the replacer made a substitution there is no need to decscend further. IFluidHandles are always\n\t\t// leaves in the object graph.\n\t\tif (maybeReplaced !== input) {\n\t\t\treturn maybeReplaced;\n\t\t}\n\n\t\t// Otherwise descend into the object graph looking for IFluidHandle instances.\n\t\tlet clone: object | undefined;\n\t\tfor (const key of Object.keys(input)) {\n\t\t\tconst value = input[key];\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\tif (!!value && typeof value === \"object\") {\n\t\t\t\t// Note: Except for IFluidHandle, `input` must not contain circular references (as object must\n\t\t\t\t// be JSON serializable.) Therefore, guarding against infinite recursion here would only\n\t\t\t\t// lead to a later error when attempting to stringify().\n\t\t\t\tconst replaced = this.recursivelyReplace(value, replacer, context);\n\n\t\t\t\t// If the `replaced` object is different than the original `value` then the subgraph contained one\n\t\t\t\t// or more handles. If this happens, we need to return a clone of the `input` object where the\n\t\t\t\t// current property is replaced by the `replaced` value.\n\t\t\t\tif (replaced !== value) {\n\t\t\t\t\t// Lazily create a shallow clone of the `input` object if we haven't done so already.\n\t\t\t\t\tclone = clone ?? (Array.isArray(input) ? [...input] : { ...input });\n\n\t\t\t\t\t// Overwrite the current property `key` in the clone with the `replaced` value.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tclone![key] = replaced;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clone ?? input;\n\t}\n\n\tprotected serializeHandle(handle: IFluidHandle, bind: IFluidHandle) {\n\t\tbind.bind(handle);\n\t\treturn {\n\t\t\ttype: \"__fluid_handle__\",\n\t\t\turl: handle.absolutePath,\n\t\t};\n\t}\n}\n"]}
@@ -17,6 +17,8 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
17
17
  import { ITelemetryContext } from '@fluidframework/runtime-definitions';
18
18
  import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
19
19
 
20
+ /* Excluded from this release type: bindHandles */
21
+
20
22
  /* Excluded from this release type: createSingleBlobSummary */
21
23
 
22
24
  /* Excluded from this release type: FluidSerializer */
@@ -128,7 +130,7 @@ export declare function parseHandles(value: any, serializer: IFluidSerializer):
128
130
  /**
129
131
  * SharedObject with simplified, synchronous summarization and GC.
130
132
  * DDS implementations with async and incremental summarization should extend SharedObjectCore directly instead.
131
- * @public
133
+ * @alpha
132
134
  */
133
135
  export declare abstract class SharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends SharedObjectCore<TEvent> {
134
136
  private readonly telemetryContextPrefix;
@@ -174,7 +176,7 @@ export declare abstract class SharedObject<TEvent extends ISharedObjectEvents =
174
176
 
175
177
  /**
176
178
  * Base class from which all shared objects derive.
177
- * @public
179
+ * @alpha
178
180
  */
179
181
  export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends EventEmitterWithErrorHandling<TEvent> implements ISharedObject<TEvent> {
180
182
  id: string;
@@ -247,7 +249,7 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
247
249
  * allow processing of ops or local changes, which very quickly results in container closure.
248
250
  */
249
251
  private eventListenerErrorHandler;
250
- private attachListeners;
252
+ private setBoundAndHandleAttach;
251
253
  /**
252
254
  * A shared object, after construction, can either be loaded in the case that it is already part of
253
255
  * a shared document. Or later attached if it is being newly added.
@@ -315,9 +317,14 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
315
317
  * Called when the object has disconnected from the delta stream.
316
318
  */
317
319
  protected abstract onDisconnect(): any;
320
+ /**
321
+ * The serializer to serialize / parse handles.
322
+ */
323
+ protected abstract get serializer(): IFluidSerializer;
318
324
  /**
319
325
  * Submits a message by the local client to the runtime.
320
- * @param content - Content of the message
326
+ * @param content - Content of the message. Note: handles contained in the
327
+ * message object should not be encoded in any way
321
328
  * @param localOpMetadata - The local metadata associated with the message. This is kept locally by the runtime
322
329
  * and not sent to the server. This will be sent back when this message is received back from the server. This is
323
330
  * also sent if we are asked to resubmit the message.
@@ -375,14 +382,23 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
375
382
  */
376
383
  protected rollback(content: any, localOpMetadata: unknown): void;
377
384
  /**
378
- * Apply changes from an op. Used when rehydrating an attached container
379
- * with pending changes. This prepares the SharedObject for seeing an ACK
380
- * for the op or resubmitting the op upon reconnection.
385
+ * Apply changes from the provided op content just as if a local client has made the change,
386
+ * including submitting the op. Used when rehydrating an attached container
387
+ * with pending changes. The rehydration process replays all remote ops
388
+ * and applies stashed ops after the remote op with a sequence number
389
+ * that matches that of the stashed op is applied. This ensures
390
+ * stashed ops are applied at the same state they were originally created.
391
+ *
392
+ * It is possible that stashed ops have been sent in the past, and will be found when
393
+ * the shared object catches up with remotes ops.
394
+ * So this prepares the SharedObject for seeing potentially seeing the ACK.
395
+ * If no matching remote op is found, all the applied stashed ops will go
396
+ * through the normal resubmit flow upon reconnection, which allows the dds
397
+ * to rebase them to the latest state, and then resubmit them.
398
+ *
381
399
  * @param content - Contents of a stashed op.
382
- * @returns localMetadata of the op, to be passed to process() or resubmit()
383
- * when the op is ACKed or resubmitted, respectively
384
400
  */
385
- protected abstract applyStashedOp(content: any): unknown;
401
+ protected abstract applyStashedOp(content: any): void;
386
402
  /**
387
403
  * Emit an event. This function is only intended for use by DDS classes that extend SharedObject/SharedObjectCore,
388
404
  * specifically to emit events that are part of the public interface of the DDS (i.e. those that can have listeners
@@ -0,0 +1,118 @@
1
+ import { EventEmitterEventType } from '@fluid-internal/client-utils';
2
+ import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
3
+ import { IChannel } from '@fluidframework/datastore-definitions';
4
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
5
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
6
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
7
+ import { IErrorEvent } from '@fluidframework/core-interfaces';
8
+ import { IEventProvider } from '@fluidframework/core-interfaces';
9
+ import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
10
+ import { IExperimentalIncrementalSummaryContext } from '@fluidframework/runtime-definitions';
11
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
12
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
13
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
14
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
15
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
16
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
17
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
18
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
19
+
20
+ /* Excluded from this release type: bindHandles */
21
+
22
+ /* Excluded from this release type: createSingleBlobSummary */
23
+
24
+ /* Excluded from this release type: EventEmitterWithErrorHandling */
25
+
26
+ /* Excluded from this release type: FluidSerializer */
27
+
28
+ /**
29
+ * @public
30
+ */
31
+ export declare interface IFluidSerializer {
32
+ /**
33
+ * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object
34
+ * where any embedded IFluidHandles have been replaced with a serializable form.
35
+ *
36
+ * The original `input` object is not mutated. This method will shallowly clones all objects in the path from
37
+ * the root to any replaced handles. (If no handles are found, returns the original object.)
38
+ */
39
+ encode(value: any, bind: IFluidHandle): any;
40
+ /**
41
+ * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an
42
+ * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.
43
+ *
44
+ * The original `input` object is not mutated. This method will shallowly clone all objects in the path from
45
+ * the root to any replaced handles. (If no handles are found, returns the original object.)
46
+ *
47
+ * The decoded handles are implicitly bound to the handle context of this serializer.
48
+ */
49
+ decode(input: any): any;
50
+ /**
51
+ * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.
52
+ */
53
+ stringify(value: any, bind: IFluidHandle): string;
54
+ /**
55
+ * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid
56
+ * handles will be realized as part of the parse
57
+ */
58
+ parse(value: string): any;
59
+ }
60
+
61
+ /**
62
+ * Base interface for shared objects from which other interfaces derive. Implemented by SharedObject
63
+ * @public
64
+ */
65
+ export declare interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends IChannel, IEventProvider<TEvent> {
66
+ /**
67
+ * Binds the given shared object to its containing data store runtime, causing it to attach once
68
+ * the runtime attaches.
69
+ */
70
+ bindToContext(): void;
71
+ /**
72
+ * Returns the GC data for this shared object. It contains a list of GC nodes that contains references to
73
+ * other GC nodes.
74
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
75
+ */
76
+ getGCData(fullGC?: boolean): IGarbageCollectionData;
77
+ }
78
+
79
+ /**
80
+ * Events emitted by {@link ISharedObject}.
81
+ * @public
82
+ */
83
+ export declare interface ISharedObjectEvents extends IErrorEvent {
84
+ /**
85
+ * Fires before an incoming operation (op) is applied to the shared object.
86
+ *
87
+ * @remarks Note: this should be considered an internal implementation detail. It is not recommended for external
88
+ * use.
89
+ *
90
+ * @eventProperty
91
+ */
92
+ (event: "pre-op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
93
+ /**
94
+ * Fires after an incoming op is applied to the shared object.
95
+ *
96
+ * @remarks Note: this should be considered an internal implementation detail. It is not recommended for external
97
+ * use.
98
+ *
99
+ * @eventProperty
100
+ */
101
+ (event: "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
102
+ }
103
+
104
+ /* Excluded from this release type: makeHandlesSerializable */
105
+
106
+ /* Excluded from this release type: parseHandles */
107
+
108
+ /* Excluded from this release type: serializeHandles */
109
+
110
+ /* Excluded from this release type: SharedObject */
111
+
112
+ /* Excluded from this release type: SharedObjectCore */
113
+
114
+ /* Excluded from this release type: SummarySerializer */
115
+
116
+ /* Excluded from this release type: ValueType */
117
+
118
+ export { }
@@ -0,0 +1,118 @@
1
+ import { EventEmitterEventType } from '@fluid-internal/client-utils';
2
+ import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
3
+ import { IChannel } from '@fluidframework/datastore-definitions';
4
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
5
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
6
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
7
+ import { IErrorEvent } from '@fluidframework/core-interfaces';
8
+ import { IEventProvider } from '@fluidframework/core-interfaces';
9
+ import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
10
+ import { IExperimentalIncrementalSummaryContext } from '@fluidframework/runtime-definitions';
11
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
12
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
13
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
14
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
15
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
16
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
17
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
18
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
19
+
20
+ /* Excluded from this release type: bindHandles */
21
+
22
+ /* Excluded from this release type: createSingleBlobSummary */
23
+
24
+ /* Excluded from this release type: EventEmitterWithErrorHandling */
25
+
26
+ /* Excluded from this release type: FluidSerializer */
27
+
28
+ /**
29
+ * @public
30
+ */
31
+ export declare interface IFluidSerializer {
32
+ /**
33
+ * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object
34
+ * where any embedded IFluidHandles have been replaced with a serializable form.
35
+ *
36
+ * The original `input` object is not mutated. This method will shallowly clones all objects in the path from
37
+ * the root to any replaced handles. (If no handles are found, returns the original object.)
38
+ */
39
+ encode(value: any, bind: IFluidHandle): any;
40
+ /**
41
+ * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an
42
+ * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.
43
+ *
44
+ * The original `input` object is not mutated. This method will shallowly clone all objects in the path from
45
+ * the root to any replaced handles. (If no handles are found, returns the original object.)
46
+ *
47
+ * The decoded handles are implicitly bound to the handle context of this serializer.
48
+ */
49
+ decode(input: any): any;
50
+ /**
51
+ * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.
52
+ */
53
+ stringify(value: any, bind: IFluidHandle): string;
54
+ /**
55
+ * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid
56
+ * handles will be realized as part of the parse
57
+ */
58
+ parse(value: string): any;
59
+ }
60
+
61
+ /**
62
+ * Base interface for shared objects from which other interfaces derive. Implemented by SharedObject
63
+ * @public
64
+ */
65
+ export declare interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends IChannel, IEventProvider<TEvent> {
66
+ /**
67
+ * Binds the given shared object to its containing data store runtime, causing it to attach once
68
+ * the runtime attaches.
69
+ */
70
+ bindToContext(): void;
71
+ /**
72
+ * Returns the GC data for this shared object. It contains a list of GC nodes that contains references to
73
+ * other GC nodes.
74
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
75
+ */
76
+ getGCData(fullGC?: boolean): IGarbageCollectionData;
77
+ }
78
+
79
+ /**
80
+ * Events emitted by {@link ISharedObject}.
81
+ * @public
82
+ */
83
+ export declare interface ISharedObjectEvents extends IErrorEvent {
84
+ /**
85
+ * Fires before an incoming operation (op) is applied to the shared object.
86
+ *
87
+ * @remarks Note: this should be considered an internal implementation detail. It is not recommended for external
88
+ * use.
89
+ *
90
+ * @eventProperty
91
+ */
92
+ (event: "pre-op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
93
+ /**
94
+ * Fires after an incoming op is applied to the shared object.
95
+ *
96
+ * @remarks Note: this should be considered an internal implementation detail. It is not recommended for external
97
+ * use.
98
+ *
99
+ * @eventProperty
100
+ */
101
+ (event: "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
102
+ }
103
+
104
+ /* Excluded from this release type: makeHandlesSerializable */
105
+
106
+ /* Excluded from this release type: parseHandles */
107
+
108
+ /* Excluded from this release type: serializeHandles */
109
+
110
+ /* Excluded from this release type: SharedObject */
111
+
112
+ /* Excluded from this release type: SharedObjectCore */
113
+
114
+ /* Excluded from this release type: SummarySerializer */
115
+
116
+ /* Excluded from this release type: ValueType */
117
+
118
+ export { }