@fluidframework/shared-summary-block 2.0.0-internal.7.2.2 → 2.0.0-internal.7.4.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 (65) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +9 -1
  4. package/api-report/shared-summary-block.api.md +3 -3
  5. package/dist/{index.js → index.cjs} +3 -3
  6. package/dist/index.cjs.map +1 -0
  7. package/dist/{interfaces.js → interfaces.cjs} +1 -1
  8. package/dist/interfaces.cjs.map +1 -0
  9. package/dist/interfaces.d.ts +1 -2
  10. package/dist/interfaces.d.ts.map +1 -1
  11. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  12. package/dist/packageVersion.cjs.map +1 -0
  13. package/dist/packageVersion.d.ts +1 -1
  14. package/dist/shared-summary-block-alpha.d.ts +19 -0
  15. package/dist/shared-summary-block-beta.d.ts +39 -0
  16. package/dist/shared-summary-block-public.d.ts +39 -0
  17. package/dist/shared-summary-block-untrimmed.d.ts +128 -0
  18. package/dist/{sharedSummaryBlock.js → sharedSummaryBlock.cjs} +3 -4
  19. package/dist/sharedSummaryBlock.cjs.map +1 -0
  20. package/dist/sharedSummaryBlock.d.ts +1 -2
  21. package/dist/sharedSummaryBlock.d.ts.map +1 -1
  22. package/dist/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.cjs} +4 -4
  23. package/dist/sharedSummaryBlockFactory.cjs.map +1 -0
  24. package/dist/sharedSummaryBlockFactory.d.ts +1 -1
  25. package/dist/tsdoc-metadata.json +1 -1
  26. package/lib/index.d.ts +3 -3
  27. package/lib/index.d.ts.map +1 -1
  28. package/lib/{index.js → index.mjs} +3 -3
  29. package/lib/index.mjs.map +1 -0
  30. package/lib/interfaces.d.ts +1 -2
  31. package/lib/interfaces.d.ts.map +1 -1
  32. package/lib/{interfaces.js → interfaces.mjs} +1 -1
  33. package/{dist/interfaces.js.map → lib/interfaces.mjs.map} +1 -1
  34. package/lib/packageVersion.d.ts +1 -1
  35. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  36. package/lib/packageVersion.mjs.map +1 -0
  37. package/lib/shared-summary-block-alpha.d.ts +19 -0
  38. package/lib/shared-summary-block-beta.d.ts +39 -0
  39. package/lib/shared-summary-block-public.d.ts +39 -0
  40. package/lib/shared-summary-block-untrimmed.d.ts +128 -0
  41. package/lib/sharedSummaryBlock.d.ts +2 -3
  42. package/lib/sharedSummaryBlock.d.ts.map +1 -1
  43. package/lib/{sharedSummaryBlock.js → sharedSummaryBlock.mjs} +3 -4
  44. package/lib/sharedSummaryBlock.mjs.map +1 -0
  45. package/lib/sharedSummaryBlockFactory.d.ts +1 -1
  46. package/lib/sharedSummaryBlockFactory.d.ts.map +1 -1
  47. package/lib/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.mjs} +4 -4
  48. package/lib/sharedSummaryBlockFactory.mjs.map +1 -0
  49. package/package.json +45 -25
  50. package/src/interfaces.ts +1 -2
  51. package/src/packageVersion.ts +1 -1
  52. package/src/sharedSummaryBlock.ts +1 -2
  53. package/src/sharedSummaryBlockFactory.ts +1 -1
  54. package/tsc-multi.test.json +4 -0
  55. package/tsconfig.json +5 -3
  56. package/dist/index.js.map +0 -1
  57. package/dist/packageVersion.js.map +0 -1
  58. package/dist/sharedSummaryBlock.js.map +0 -1
  59. package/dist/sharedSummaryBlockFactory.js.map +0 -1
  60. package/lib/index.js.map +0 -1
  61. package/lib/interfaces.js.map +0 -1
  62. package/lib/packageVersion.js.map +0 -1
  63. package/lib/sharedSummaryBlock.js.map +0 -1
  64. package/lib/sharedSummaryBlockFactory.js.map +0 -1
  65. package/tsconfig.esnext.json +0 -7
@@ -0,0 +1,39 @@
1
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
4
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { ISharedObject } from '@fluidframework/shared-object-base';
9
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
+ import { Jsonable } from '@fluidframework/datastore-definitions';
11
+ import { SharedObject } from '@fluidframework/shared-object-base';
12
+
13
+ /* Excluded from this release type: IChannelAttributes */
14
+
15
+ /* Excluded from this release type: IChannelFactory */
16
+
17
+ /* Excluded from this release type: IChannelServices */
18
+
19
+ /* Excluded from this release type: IChannelStorageService */
20
+
21
+ /* Excluded from this release type: IFluidDataStoreRuntime */
22
+
23
+ /* Excluded from this release type: IFluidSerializer */
24
+
25
+ /* Excluded from this release type: ISharedObject */
26
+
27
+ /* Excluded from this release type: ISharedSummaryBlock */
28
+
29
+ /* Excluded from this release type: ISummaryTreeWithStats */
30
+
31
+ /* Excluded from this release type: Jsonable */
32
+
33
+ /* Excluded from this release type: SharedObject */
34
+
35
+ /* Excluded from this release type: SharedSummaryBlock */
36
+
37
+ /* Excluded from this release type: SharedSummaryBlockFactory */
38
+
39
+ export { }
@@ -0,0 +1,39 @@
1
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
4
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { ISharedObject } from '@fluidframework/shared-object-base';
9
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
+ import { Jsonable } from '@fluidframework/datastore-definitions';
11
+ import { SharedObject } from '@fluidframework/shared-object-base';
12
+
13
+ /* Excluded from this release type: IChannelAttributes */
14
+
15
+ /* Excluded from this release type: IChannelFactory */
16
+
17
+ /* Excluded from this release type: IChannelServices */
18
+
19
+ /* Excluded from this release type: IChannelStorageService */
20
+
21
+ /* Excluded from this release type: IFluidDataStoreRuntime */
22
+
23
+ /* Excluded from this release type: IFluidSerializer */
24
+
25
+ /* Excluded from this release type: ISharedObject */
26
+
27
+ /* Excluded from this release type: ISharedSummaryBlock */
28
+
29
+ /* Excluded from this release type: ISummaryTreeWithStats */
30
+
31
+ /* Excluded from this release type: Jsonable */
32
+
33
+ /* Excluded from this release type: SharedObject */
34
+
35
+ /* Excluded from this release type: SharedSummaryBlock */
36
+
37
+ /* Excluded from this release type: SharedSummaryBlockFactory */
38
+
39
+ export { }
@@ -0,0 +1,128 @@
1
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
4
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { ISharedObject } from '@fluidframework/shared-object-base';
9
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
+ import { Jsonable } from '@fluidframework/datastore-definitions';
11
+ import { SharedObject } from '@fluidframework/shared-object-base';
12
+
13
+ /**
14
+ * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.
15
+ * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
16
+ * the set of calls on this interface to set data should be the same. This is critical because the object does not
17
+ * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
18
+ * @internal
19
+ */
20
+ export declare interface ISharedSummaryBlock extends ISharedObject {
21
+ /**
22
+ * Retrieves the given key from the map.
23
+ * @param key - Key to retrieve from.
24
+ * @returns The stored value, or undefined if the key is not set.
25
+ */
26
+ get<T>(key: string): Jsonable<T>;
27
+ /**
28
+ * Sets the value stored at key to the provided value.
29
+ * @param key - Key to set at.
30
+ * @param value - Jsonable type value to set.
31
+ */
32
+ set<T>(key: string, value: Jsonable<T>): void;
33
+ }
34
+
35
+ /**
36
+ * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
37
+ * Data should be set in this object in response to a remote op.
38
+ * @internal
39
+ */
40
+ export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
41
+ /**
42
+ * Create a new shared summary block
43
+ *
44
+ * @param runtime - data store runtime the new shared summary block belongs to.
45
+ * @param id - optional name of the shared summary block.
46
+ * @returns newly created shared summary block (but not attached yet).
47
+ */
48
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedSummaryBlock;
49
+ /**
50
+ * Get a factory for SharedSummaryBlock to register with the data store.
51
+ *
52
+ * @returns a factory that creates and loads SharedSummaryBlock.
53
+ */
54
+ static getFactory(): IChannelFactory;
55
+ /**
56
+ * The data held by this object.
57
+ */
58
+ private readonly data;
59
+ /**
60
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
61
+ * be provided.
62
+ *
63
+ * @param id - optional name of the shared summary block.
64
+ * @param runtime - data store runtime thee object belongs to.
65
+ * @param attributes - The attributes for the object.
66
+ */
67
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
68
+ /**
69
+ * {@inheritDoc ISharedSummaryBlock.get}
70
+ */
71
+ get<T>(key: string): Jsonable<T>;
72
+ /**
73
+ * {@inheritDoc ISharedSummaryBlock.set}
74
+ */
75
+ set<T>(key: string, value: Jsonable<T>): void;
76
+ /**
77
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
78
+ */
79
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
80
+ /**
81
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
82
+ */
83
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
84
+ /**
85
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
86
+ */
87
+ protected onDisconnect(): void;
88
+ /**
89
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
90
+ */
91
+ protected processCore(message: ISequencedDocumentMessage, local: boolean): void;
92
+ protected applyStashedOp(): void;
93
+ }
94
+
95
+ /**
96
+ * The factory that defines the shared summary block.
97
+ *
98
+ * @sealed
99
+ * @internal
100
+ */
101
+ export declare class SharedSummaryBlockFactory implements IChannelFactory {
102
+ /**
103
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
104
+ */
105
+ static readonly Type = "https://graph.microsoft.com/types/shared-summary-block";
106
+ /**
107
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
108
+ */
109
+ static readonly Attributes: IChannelAttributes;
110
+ /**
111
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
112
+ */
113
+ get type(): string;
114
+ /**
115
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
116
+ */
117
+ get attributes(): IChannelAttributes;
118
+ /**
119
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
120
+ */
121
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedObject>;
122
+ /**
123
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
124
+ */
125
+ create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject;
126
+ }
127
+
128
+ export { }
@@ -6,12 +6,11 @@ import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"
6
6
  import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, Jsonable, IChannelFactory } from "@fluidframework/datastore-definitions";
7
7
  import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
8
8
  import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
9
- import { ISharedSummaryBlock } from "./interfaces";
9
+ import { ISharedSummaryBlock } from "./interfaces.mjs";
10
10
  /**
11
11
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
12
12
  * Data should be set in this object in response to a remote op.
13
- *
14
- * @public
13
+ * @internal
15
14
  */
16
15
  export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
17
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAEN,gBAAgB,EAChB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYnD;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,mBAAmB;IAClF;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIjE;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAI3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+B;IAEpD;;;;;;;OAOG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAIvF;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IAIvC;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAMpD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;IAQ5E;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUxE;;OAEG;IACH,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO;IAIxE,SAAS,CAAC,cAAc;CAGxB"}
1
+ {"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,yBAAyB,EAAE,MAAM,sCAAsC;OACzE,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,qBAAqB,EAAE,MAAM,qCAAqC;OAEpE,EAEN,gBAAgB,EAChB,YAAY,EACZ,MAAM,oCAAoC;OAEpC,EAAE,mBAAmB,EAAE;AAY9B;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,mBAAmB;IAClF;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIjE;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAI3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+B;IAEpD;;;;;;;OAOG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAIvF;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IAIvC;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAMpD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;IAQ5E;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUxE;;OAEG;IACH,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO;IAIxE,SAAS,CAAC,cAAc;CAGxB"}
@@ -4,13 +4,12 @@
4
4
  */
5
5
  import { readAndParse } from "@fluidframework/driver-utils";
6
6
  import { createSingleBlobSummary, SharedObject, } from "@fluidframework/shared-object-base";
7
- import { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory";
7
+ import { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory.mjs";
8
8
  const snapshotFileName = "header";
9
9
  /**
10
10
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
11
11
  * Data should be set in this object in response to a remote op.
12
- *
13
- * @public
12
+ * @internal
14
13
  */
15
14
  export class SharedSummaryBlock extends SharedObject {
16
15
  /**
@@ -93,4 +92,4 @@ export class SharedSummaryBlock extends SharedObject {
93
92
  throw new Error("not implemented");
94
93
  }
95
94
  }
96
- //# sourceMappingURL=sharedSummaryBlock.js.map
95
+ //# sourceMappingURL=sharedSummaryBlock.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlock.mjs","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAWI,EAAE,YAAY,EAAE,MAAM,8BAA8B;OACpD,EACN,uBAAuB,EAEvB,YAAY,GACZ,MAAM,oCAAoC;OACpC,EAAE,yBAAyB,EAAE;AAGpC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,yBAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,yBAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAAoB,CAAC;IAYpD,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QACnD,MAAM,YAAY,GAAwC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACvD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAClC,OAAO,EACP,gBAAgB,CAChB,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC1B;IACF,CAAC;IAED;;OAEG;IACO,YAAY,KAAI,CAAC;IAE3B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACvE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @internal\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -8,7 +8,7 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
8
8
  * The factory that defines the shared summary block.
9
9
  *
10
10
  * @sealed
11
- * @public
11
+ * @internal
12
12
  */
13
13
  export declare class SharedSummaryBlockFactory implements IChannelFactory {
14
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAOzB;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAUzE"}
1
+ {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAIlE;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAOzB;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAUzE"}
@@ -2,13 +2,13 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { pkgVersion } from "./packageVersion";
6
- import { SharedSummaryBlock } from "./sharedSummaryBlock";
5
+ import { pkgVersion } from "./packageVersion.mjs";
6
+ import { SharedSummaryBlock } from "./sharedSummaryBlock.mjs";
7
7
  /**
8
8
  * The factory that defines the shared summary block.
9
9
  *
10
10
  * @sealed
11
- * @public
11
+ * @internal
12
12
  */
13
13
  export class SharedSummaryBlockFactory {
14
14
  /**
@@ -52,4 +52,4 @@ SharedSummaryBlockFactory.Attributes = {
52
52
  snapshotFormatVersion: "0.1",
53
53
  packageVersion: pkgVersion,
54
54
  };
55
- //# sourceMappingURL=sharedSummaryBlockFactory.js.map
55
+ //# sourceMappingURL=sharedSummaryBlockFactory.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlockFactory.mjs","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OASI,EAAE,UAAU,EAAE;OACd,EAAE,kBAAkB,EAAE;AAE7B;;;;;GAKG;AACH,MAAM,OAAO,yBAAyB;IAerC;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,yBAAyB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,yBAAyB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAChD,EAAE,EACF,OAAO,EACP,yBAAyB,CAAC,UAAU,CACpC,CAAC;QACF,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAvDD;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACvD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\n\n/**\n * The factory that defines the shared summary block.\n *\n * @sealed\n * @internal\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedSummaryBlockFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type() {\n\t\treturn SharedSummaryBlockFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes() {\n\t\treturn SharedSummaryBlockFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedObject> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n\t\tawait sharedSummaryBlock.load(services);\n\n\t\treturn sharedSummaryBlock;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tSharedSummaryBlockFactory.Attributes,\n\t\t);\n\t\tsharedSummaryBlock.initializeLocal();\n\n\t\treturn sharedSummaryBlock;\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/shared-summary-block",
3
- "version": "2.0.0-internal.7.2.2",
3
+ "version": "2.0.0-internal.7.4.0",
4
4
  "description": "A DDS that does not generate ops but is part of summary",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,8 +11,8 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
- "main": "dist/index.js",
15
- "module": "lib/index.js",
14
+ "main": "dist/index.cjs",
15
+ "module": "lib/index.mjs",
16
16
  "types": "dist/index.d.ts",
17
17
  "c8": {
18
18
  "all": true,
@@ -35,27 +35,29 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluidframework/core-interfaces": ">=2.0.0-internal.7.2.2 <2.0.0-internal.7.3.0",
39
- "@fluidframework/datastore-definitions": ">=2.0.0-internal.7.2.2 <2.0.0-internal.7.3.0",
40
- "@fluidframework/driver-utils": ">=2.0.0-internal.7.2.2 <2.0.0-internal.7.3.0",
38
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
39
+ "@fluidframework/datastore-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
40
+ "@fluidframework/driver-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
41
41
  "@fluidframework/protocol-definitions": "^3.0.0",
42
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.2.2 <2.0.0-internal.7.3.0",
43
- "@fluidframework/shared-object-base": ">=2.0.0-internal.7.2.2 <2.0.0-internal.7.3.0"
42
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
43
+ "@fluidframework/shared-object-base": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@fluid-tools/build-cli": "^0.26.1",
46
+ "@arethetypeswrong/cli": "^0.13.3",
47
+ "@fluid-tools/build-cli": "^0.28.0",
47
48
  "@fluidframework/build-common": "^2.0.3",
48
- "@fluidframework/build-tools": "^0.26.1",
49
- "@fluidframework/eslint-config-fluid": "^3.0.0",
50
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.2.2 <2.0.0-internal.7.3.0",
51
- "@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-internal.7.2.1",
52
- "@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.2.2 <2.0.0-internal.7.3.0",
53
- "@microsoft/api-extractor": "^7.37.0",
49
+ "@fluidframework/build-tools": "^0.28.0",
50
+ "@fluidframework/eslint-config-fluid": "^3.1.0",
51
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
52
+ "@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-internal.7.2.0",
53
+ "@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
54
+ "@microsoft/api-extractor": "^7.38.3",
54
55
  "@types/benchmark": "^2.1.0",
55
56
  "@types/mocha": "^9.1.1",
56
- "@types/node": "^16.18.38",
57
+ "@types/node": "^18.19.0",
57
58
  "benchmark": "^2.1.4",
58
59
  "c8": "^7.7.1",
60
+ "copyfiles": "^2.4.1",
59
61
  "cross-env": "^7.0.3",
60
62
  "eslint": "~8.50.0",
61
63
  "mocha": "^10.2.0",
@@ -64,34 +66,52 @@
64
66
  "moment": "^2.21.0",
65
67
  "prettier": "~3.0.3",
66
68
  "rimraf": "^4.4.0",
69
+ "tsc-multi": "^1.1.0",
67
70
  "typescript": "~5.1.6"
68
71
  },
72
+ "fluidBuild": {
73
+ "tasks": {
74
+ "build:docs": {
75
+ "dependsOn": [
76
+ "...",
77
+ "api-extractor:commonjs",
78
+ "api-extractor:esnext"
79
+ ],
80
+ "script": false
81
+ }
82
+ }
83
+ },
69
84
  "typeValidation": {
70
85
  "broken": {}
71
86
  },
72
87
  "scripts": {
88
+ "api": "fluid-build . --task api",
89
+ "api-extractor:commonjs": "api-extractor run --local",
90
+ "api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
73
91
  "build": "fluid-build . --task build",
74
92
  "build:commonjs": "fluid-build . --task commonjs",
75
93
  "build:compile": "fluid-build . --task compile",
76
94
  "build:compile:min": "npm run build:compile",
77
- "build:docs": "api-extractor run --local",
78
- "build:esnext": "tsc --project ./tsconfig.esnext.json",
95
+ "build:docs": "fluid-build . --task api",
96
+ "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
79
97
  "build:genver": "gen-version",
80
- "build:test": "tsc --project ./src/test/tsconfig.json",
98
+ "build:test": "tsc-multi --config ./tsc-multi.test.json",
99
+ "check:are-the-types-wrong": "attw --pack",
100
+ "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
81
101
  "ci:build:docs": "api-extractor run",
82
- "clean": "rimraf --glob dist lib \"*.tsbuildinfo\" \"*.build.log\" _api-extractor-temp nyc",
102
+ "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
83
103
  "eslint": "eslint --format stylish src",
84
104
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
85
105
  "format": "npm run prettier:fix",
86
- "lint": "npm run prettier && npm run eslint",
106
+ "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
87
107
  "lint:fix": "npm run prettier:fix && npm run eslint:fix",
88
- "prettier": "prettier --check . --ignore-path ../../../.prettierignore",
89
- "prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
108
+ "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
109
+ "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
90
110
  "test": "npm run test:mocha",
91
111
  "test:coverage": "c8 npm test",
92
- "test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup",
112
+ "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup",
93
113
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
94
- "tsc": "tsc",
114
+ "tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
95
115
  "typetests:gen": "fluid-type-test-generator",
96
116
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
97
117
  }
package/src/interfaces.ts CHANGED
@@ -11,8 +11,7 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
11
11
  * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
12
12
  * the set of calls on this interface to set data should be the same. This is critical because the object does not
13
13
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
14
- *
15
- * @public
14
+ * @internal
16
15
  */
17
16
  export interface ISharedSummaryBlock extends ISharedObject {
18
17
  /**
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/shared-summary-block";
9
- export const pkgVersion = "2.0.0-internal.7.2.2";
9
+ export const pkgVersion = "2.0.0-internal.7.4.0";
@@ -34,8 +34,7 @@ interface ISharedSummaryBlockDataSerializable {
34
34
  /**
35
35
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
36
36
  * Data should be set in this object in response to a remote op.
37
- *
38
- * @public
37
+ * @internal
39
38
  */
40
39
  export class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
41
40
  /**
@@ -17,7 +17,7 @@ import { SharedSummaryBlock } from "./sharedSummaryBlock";
17
17
  * The factory that defines the shared summary block.
18
18
  *
19
19
  * @sealed
20
- * @public
20
+ * @internal
21
21
  */
22
22
  export class SharedSummaryBlockFactory implements IChannelFactory {
23
23
  /**
@@ -0,0 +1,4 @@
1
+ {
2
+ "targets": [{ "extname": ".cjs", "module": "CommonJS", "moduleResolution": "Node10" }],
3
+ "projects": ["./tsconfig.json", "./src/test/tsconfig.json"]
4
+ }
package/tsconfig.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
- "extends": "@fluidframework/build-common/ts-common-config.json",
2
+ "extends": [
3
+ "../../../common/build/build-common/tsconfig.base.json",
4
+ "../../../common/build/build-common/tsconfig.cjs.json",
5
+ ],
6
+ "include": ["src/**/*"],
3
7
  "exclude": ["src/test/**/*"],
4
8
  "compilerOptions": {
5
9
  "rootDir": "./src",
6
10
  "outDir": "./dist",
7
- "composite": true,
8
11
  },
9
- "include": ["src/**/*"],
10
12
  }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ISharedSummaryBlock } from \"./interfaces\";\nexport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\nexport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sCAAsC,CAAC;AACjD,QAAA,UAAU,GAAG,sBAAsB,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-summary-block\";\nexport const pkgVersion = \"2.0.0-internal.7.2.2\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,+DAA4D;AAC5D,2EAI4C;AAC5C,2EAAwE;AAGxE,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;;GAKG;AACH,MAAa,kBAAmB,SAAQ,iCAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,qDAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,qDAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAAoB,CAAC;IAYpD,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QACnD,MAAM,YAAY,GAAwC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,IAAA,4CAAuB,EAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAY,EAClC,OAAO,EACP,gBAAgB,CAChB,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC1B;IACF,CAAC;IAED;;OAEG;IACO,YAAY,KAAI,CAAC;IAE3B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACvE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AA7FD,gDA6FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n *\n * @public\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,qDAA8C;AAC9C,6DAA0D;AAE1D;;;;;GAKG;AACH,MAAa,yBAAyB;IAerC;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,yBAAyB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,yBAAyB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAChD,EAAE,EACF,OAAO,EACP,yBAAyB,CAAC,UAAU,CACpC,CAAC;QACF,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAxDF,8DAyDC;AAxDA;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACvD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\n\n/**\n * The factory that defines the shared summary block.\n *\n * @sealed\n * @public\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedSummaryBlockFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type() {\n\t\treturn SharedSummaryBlockFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes() {\n\t\treturn SharedSummaryBlockFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedObject> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n\t\tawait sharedSummaryBlock.load(services);\n\n\t\treturn sharedSummaryBlock;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tSharedSummaryBlockFactory.Attributes,\n\t\t);\n\t\tsharedSummaryBlock.initializeLocal();\n\n\t\treturn sharedSummaryBlock;\n\t}\n}\n"]}
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ISharedSummaryBlock } from \"./interfaces\";\nexport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\nexport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Jsonable } from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\n\n/**\n * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.\n * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,\n * the set of calls on this interface to set data should be the same. This is critical because the object does not\n * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.\n *\n * @public\n */\nexport interface ISharedSummaryBlock extends ISharedObject {\n\t/**\n\t * Retrieves the given key from the map.\n\t * @param key - Key to retrieve from.\n\t * @returns The stored value, or undefined if the key is not set.\n\t */\n\tget<T>(key: string): Jsonable<T>;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set at.\n\t * @param value - Jsonable type value to set.\n\t */\n\tset<T>(key: string, value: Jsonable<T>): void;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,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-summary-block\";\nexport const pkgVersion = \"2.0.0-internal.7.2.2\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlock.js","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACN,uBAAuB,EAEvB,YAAY,GACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,yBAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,yBAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAAoB,CAAC;IAYpD,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,GAAG,CAAI,GAAW,EAAE,KAAkB;QAC5C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1B,mEAAmE;QACnE,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAA4B;QACnD,MAAM,YAAY,GAAwC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,QAAQ,CAAC,OAA+B;QACvD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAClC,OAAO,EACP,gBAAgB,CAChB,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SAC1B;IACF,CAAC;IAED;;OAEG;IACO,YAAY,KAAI,CAAC;IAE3B;;OAEG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc;QACvE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n *\n * @public\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.js","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,OAAO,yBAAyB;IAerC;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,yBAAyB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,yBAAyB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAChD,EAAE,EACF,OAAO,EACP,yBAAyB,CAAC,UAAU,CACpC,CAAC;QACF,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAvDD;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACvD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\n\n/**\n * The factory that defines the shared summary block.\n *\n * @sealed\n * @public\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedSummaryBlockFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type() {\n\t\treturn SharedSummaryBlockFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes() {\n\t\treturn SharedSummaryBlockFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedObject> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n\t\tawait sharedSummaryBlock.load(services);\n\n\t\treturn sharedSummaryBlock;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tSharedSummaryBlockFactory.Attributes,\n\t\t);\n\t\tsharedSummaryBlock.initializeLocal();\n\n\t\treturn sharedSummaryBlock;\n\t}\n}\n"]}
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./lib",
5
- "module": "esnext",
6
- },
7
- }