@fluid-experimental/attributor 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.1

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 (80) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-report/attributor.api.md +3 -3
  3. package/dist/attributor.d.ts +6 -2
  4. package/dist/attributor.d.ts.map +1 -1
  5. package/dist/attributor.js +6 -6
  6. package/dist/attributor.js.map +1 -1
  7. package/dist/encoders.d.ts +5 -1
  8. package/dist/encoders.d.ts.map +1 -1
  9. package/dist/encoders.js +5 -5
  10. package/dist/encoders.js.map +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/lz4Encoder.d.ts +5 -1
  15. package/dist/lz4Encoder.d.ts.map +1 -1
  16. package/dist/lz4Encoder.js +3 -3
  17. package/dist/lz4Encoder.js.map +1 -1
  18. package/dist/mixinAttributor.d.ts +6 -2
  19. package/dist/mixinAttributor.d.ts.map +1 -1
  20. package/dist/mixinAttributor.js +21 -17
  21. package/dist/mixinAttributor.js.map +1 -1
  22. package/dist/stringInterner.js +2 -2
  23. package/dist/stringInterner.js.map +1 -1
  24. package/lib/attributor.d.ts +6 -2
  25. package/lib/attributor.d.ts.map +1 -1
  26. package/lib/attributor.js +2 -2
  27. package/lib/attributor.js.map +1 -1
  28. package/lib/encoders.d.ts +5 -1
  29. package/lib/encoders.d.ts.map +1 -1
  30. package/lib/encoders.js +1 -1
  31. package/lib/encoders.js.map +1 -1
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js.map +1 -1
  34. package/lib/lz4Encoder.d.ts +5 -1
  35. package/lib/lz4Encoder.d.ts.map +1 -1
  36. package/lib/lz4Encoder.js +1 -1
  37. package/lib/lz4Encoder.js.map +1 -1
  38. package/lib/mixinAttributor.d.ts +6 -2
  39. package/lib/mixinAttributor.d.ts.map +1 -1
  40. package/lib/mixinAttributor.js +8 -4
  41. package/lib/mixinAttributor.js.map +1 -1
  42. package/lib/stringInterner.js +1 -1
  43. package/lib/stringInterner.js.map +1 -1
  44. package/package.json +31 -65
  45. package/src/attributor.ts +5 -4
  46. package/src/encoders.ts +4 -2
  47. package/src/index.ts +1 -0
  48. package/src/lz4Encoder.ts +4 -2
  49. package/src/mixinAttributor.ts +22 -18
  50. package/src/stringInterner.ts +1 -1
  51. package/api-extractor-cjs.json +0 -8
  52. package/dist/attributor-alpha.d.ts +0 -27
  53. package/dist/attributor-beta.d.ts +0 -31
  54. package/dist/attributor-public.d.ts +0 -31
  55. package/dist/attributor-untrimmed.d.ts +0 -127
  56. package/lib/attributor-alpha.d.ts +0 -27
  57. package/lib/attributor-beta.d.ts +0 -31
  58. package/lib/attributor-public.d.ts +0 -31
  59. package/lib/attributor-untrimmed.d.ts +0 -127
  60. package/lib/test/attribution/dirname.cjs +0 -16
  61. package/lib/test/attribution/dirname.cjs.map +0 -1
  62. package/lib/test/attribution/sharedString.attribution.spec.js +0 -398
  63. package/lib/test/attribution/sharedString.attribution.spec.js.map +0 -1
  64. package/lib/test/attributor.spec.js +0 -32
  65. package/lib/test/attributor.spec.js.map +0 -1
  66. package/lib/test/attributorSerializer.spec.js +0 -123
  67. package/lib/test/attributorSerializer.spec.js.map +0 -1
  68. package/lib/test/deltaEncoder.spec.js +0 -36
  69. package/lib/test/deltaEncoder.spec.js.map +0 -1
  70. package/lib/test/lz4Encoder.spec.js +0 -27
  71. package/lib/test/lz4Encoder.spec.js.map +0 -1
  72. package/lib/test/mixinAttributor.spec.js +0 -219
  73. package/lib/test/mixinAttributor.spec.js.map +0 -1
  74. package/lib/test/opStreamAttributor.spec.js +0 -43
  75. package/lib/test/opStreamAttributor.spec.js.map +0 -1
  76. package/lib/test/stringInterner.spec.js +0 -71
  77. package/lib/test/stringInterner.spec.js.map +0 -1
  78. package/lib/test/utils.js +0 -32
  79. package/lib/test/utils.js.map +0 -1
  80. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -1,27 +0,0 @@
1
- import { AttributionInfo } from '@fluidframework/runtime-definitions';
2
- import { AttributionKey } from '@fluidframework/runtime-definitions';
3
- import { ContainerRuntime } from '@fluidframework/container-runtime';
4
- import { IAudience } from '@fluidframework/container-definitions';
5
- import { IDeltaManager } from '@fluidframework/container-definitions';
6
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
-
9
- /* Excluded from this release type: AttributionInfo */
10
-
11
- /* Excluded from this release type: Attributor */
12
-
13
- /* Excluded from this release type: createRuntimeAttributor */
14
-
15
- /* Excluded from this release type: enableOnNewFileKey */
16
-
17
- /* Excluded from this release type: IAttributor */
18
-
19
- /* Excluded from this release type: IProvideRuntimeAttributor */
20
-
21
- /* Excluded from this release type: IRuntimeAttributor */
22
-
23
- /* Excluded from this release type: mixinAttributor */
24
-
25
- /* Excluded from this release type: OpStreamAttributor */
26
-
27
- export { }
@@ -1,31 +0,0 @@
1
- import { AttributionInfo } from '@fluidframework/runtime-definitions';
2
- import { AttributionKey } from '@fluidframework/runtime-definitions';
3
- import { ContainerRuntime } from '@fluidframework/container-runtime';
4
- import { IAudience } from '@fluidframework/container-definitions';
5
- import { IDeltaManager } from '@fluidframework/container-definitions';
6
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
-
9
- /* Excluded from this release type: AttributionInfo */
10
-
11
- /* Excluded from this release type: AttributionKey */
12
-
13
- /* Excluded from this release type: Attributor */
14
-
15
- /* Excluded from this release type: ContainerRuntime */
16
-
17
- /* Excluded from this release type: createRuntimeAttributor */
18
-
19
- /* Excluded from this release type: enableOnNewFileKey */
20
-
21
- /* Excluded from this release type: IAttributor */
22
-
23
- /* Excluded from this release type: IProvideRuntimeAttributor */
24
-
25
- /* Excluded from this release type: IRuntimeAttributor */
26
-
27
- /* Excluded from this release type: mixinAttributor */
28
-
29
- /* Excluded from this release type: OpStreamAttributor */
30
-
31
- export { }
@@ -1,31 +0,0 @@
1
- import { AttributionInfo } from '@fluidframework/runtime-definitions';
2
- import { AttributionKey } from '@fluidframework/runtime-definitions';
3
- import { ContainerRuntime } from '@fluidframework/container-runtime';
4
- import { IAudience } from '@fluidframework/container-definitions';
5
- import { IDeltaManager } from '@fluidframework/container-definitions';
6
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
-
9
- /* Excluded from this release type: AttributionInfo */
10
-
11
- /* Excluded from this release type: AttributionKey */
12
-
13
- /* Excluded from this release type: Attributor */
14
-
15
- /* Excluded from this release type: ContainerRuntime */
16
-
17
- /* Excluded from this release type: createRuntimeAttributor */
18
-
19
- /* Excluded from this release type: enableOnNewFileKey */
20
-
21
- /* Excluded from this release type: IAttributor */
22
-
23
- /* Excluded from this release type: IProvideRuntimeAttributor */
24
-
25
- /* Excluded from this release type: IRuntimeAttributor */
26
-
27
- /* Excluded from this release type: mixinAttributor */
28
-
29
- /* Excluded from this release type: OpStreamAttributor */
30
-
31
- export { }
@@ -1,127 +0,0 @@
1
- import { AttributionInfo } from '@fluidframework/runtime-definitions';
2
- import { AttributionKey } from '@fluidframework/runtime-definitions';
3
- import { ContainerRuntime } from '@fluidframework/container-runtime';
4
- import { IAudience } from '@fluidframework/container-definitions';
5
- import { IDeltaManager } from '@fluidframework/container-definitions';
6
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
-
9
- /**
10
- * {@inheritdoc IAttributor}
11
- * @internal
12
- */
13
- export declare class Attributor implements IAttributor {
14
- protected readonly keyToInfo: Map<number, AttributionInfo>;
15
- /**
16
- * @param initialEntries - Any entries which should be populated on instantiation.
17
- */
18
- constructor(initialEntries?: Iterable<[number, AttributionInfo]>);
19
- /**
20
- * {@inheritdoc IAttributor.getAttributionInfo}
21
- */
22
- getAttributionInfo(key: number): AttributionInfo;
23
- /**
24
- * {@inheritdoc IAttributor.tryGetAttributionInfo}
25
- */
26
- tryGetAttributionInfo(key: number): AttributionInfo | undefined;
27
- /**
28
- * {@inheritdoc IAttributor.entries}
29
- */
30
- entries(): IterableIterator<[number, AttributionInfo]>;
31
- }
32
-
33
- /**
34
- * Creates an `IRuntimeAttributor` for usage with {@link mixinAttributor}.
35
- *
36
- * @remarks The attributor will only be populated with data once it's passed via scope to a container runtime load flow.
37
- *
38
- * @internal
39
- */
40
- export declare function createRuntimeAttributor(): IRuntimeAttributor;
41
-
42
- /**
43
- * @internal
44
- */
45
- export declare const enableOnNewFileKey = "Fluid.Attribution.EnableOnNewFile";
46
-
47
- /**
48
- * Provides lookup between attribution keys and their associated attribution information.
49
- * @internal
50
- */
51
- export declare interface IAttributor {
52
- /**
53
- * Retrieves attribution information associated with a particular key.
54
- * @param key - Attribution key to look up.
55
- * @throws If no attribution information is recorded for that key.
56
- */
57
- getAttributionInfo(key: number): AttributionInfo;
58
- /**
59
- * @param key - Attribution key to look up.
60
- * @returns the attribution information associated with the provided key, or undefined if no information exists.
61
- */
62
- tryGetAttributionInfo(key: number): AttributionInfo | undefined;
63
- /**
64
- * @returns an iterable of (attribution key, attribution info) pairs for each stored key.
65
- */
66
- entries(): IterableIterator<[number, AttributionInfo]>;
67
- }
68
-
69
- /**
70
- * @internal
71
- */
72
- export declare interface IProvideRuntimeAttributor {
73
- readonly IRuntimeAttributor: IRuntimeAttributor;
74
- }
75
-
76
- /**
77
- * @internal
78
- */
79
- export declare const IRuntimeAttributor: keyof IProvideRuntimeAttributor;
80
-
81
- /**
82
- * Provides access to attribution information stored on the container runtime.
83
- *
84
- * @remarks Attributors are only populated after the container runtime into which they are being injected has initialized.
85
- *
86
- * @sealed
87
- * @internal
88
- */
89
- export declare interface IRuntimeAttributor extends IProvideRuntimeAttributor {
90
- /**
91
- * @throws - If no AttributionInfo exists for this key.
92
- */
93
- get(key: AttributionKey): AttributionInfo;
94
- /**
95
- * @returns Whether any AttributionInfo exists for the provided key.
96
- */
97
- has(key: AttributionKey): boolean;
98
- /**
99
- * @returns Whether the runtime is currently tracking attribution information for the loaded container.
100
- * See {@link mixinAttributor} for more details on when this happens.
101
- */
102
- readonly isEnabled: boolean;
103
- }
104
-
105
- /**
106
- * Mixes in logic to load and store runtime-based attribution functionality.
107
- *
108
- * The `scope` passed to `load` should implement `IProvideRuntimeAttributor`.
109
- *
110
- * Existing documents without stored attributors will not start storing attribution information: if an
111
- * IRuntimeAttributor is passed via scope to load a document that never previously had attribution information,
112
- * that attributor's `has` method will always return `false`.
113
- * @param Base - base class, inherits from FluidAttributorRuntime
114
- * @internal
115
- */
116
- export declare const mixinAttributor: (Base?: typeof ContainerRuntime) => typeof ContainerRuntime;
117
-
118
- /**
119
- * Attributor which listens to an op stream and records entries for each op.
120
- * Sequence numbers are used as attribution keys.
121
- * @internal
122
- */
123
- export declare class OpStreamAttributor extends Attributor implements IAttributor {
124
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, audience: IAudience, initialEntries?: Iterable<[number, AttributionInfo]>);
125
- }
126
-
127
- export { }
@@ -1,27 +0,0 @@
1
- import { AttributionInfo } from '@fluidframework/runtime-definitions';
2
- import { AttributionKey } from '@fluidframework/runtime-definitions';
3
- import { ContainerRuntime } from '@fluidframework/container-runtime';
4
- import { IAudience } from '@fluidframework/container-definitions';
5
- import { IDeltaManager } from '@fluidframework/container-definitions';
6
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
-
9
- /* Excluded from this release type: AttributionInfo */
10
-
11
- /* Excluded from this release type: Attributor */
12
-
13
- /* Excluded from this release type: createRuntimeAttributor */
14
-
15
- /* Excluded from this release type: enableOnNewFileKey */
16
-
17
- /* Excluded from this release type: IAttributor */
18
-
19
- /* Excluded from this release type: IProvideRuntimeAttributor */
20
-
21
- /* Excluded from this release type: IRuntimeAttributor */
22
-
23
- /* Excluded from this release type: mixinAttributor */
24
-
25
- /* Excluded from this release type: OpStreamAttributor */
26
-
27
- export { }
@@ -1,31 +0,0 @@
1
- import { AttributionInfo } from '@fluidframework/runtime-definitions';
2
- import { AttributionKey } from '@fluidframework/runtime-definitions';
3
- import { ContainerRuntime } from '@fluidframework/container-runtime';
4
- import { IAudience } from '@fluidframework/container-definitions';
5
- import { IDeltaManager } from '@fluidframework/container-definitions';
6
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
-
9
- /* Excluded from this release type: AttributionInfo */
10
-
11
- /* Excluded from this release type: AttributionKey */
12
-
13
- /* Excluded from this release type: Attributor */
14
-
15
- /* Excluded from this release type: ContainerRuntime */
16
-
17
- /* Excluded from this release type: createRuntimeAttributor */
18
-
19
- /* Excluded from this release type: enableOnNewFileKey */
20
-
21
- /* Excluded from this release type: IAttributor */
22
-
23
- /* Excluded from this release type: IProvideRuntimeAttributor */
24
-
25
- /* Excluded from this release type: IRuntimeAttributor */
26
-
27
- /* Excluded from this release type: mixinAttributor */
28
-
29
- /* Excluded from this release type: OpStreamAttributor */
30
-
31
- export { }
@@ -1,31 +0,0 @@
1
- import { AttributionInfo } from '@fluidframework/runtime-definitions';
2
- import { AttributionKey } from '@fluidframework/runtime-definitions';
3
- import { ContainerRuntime } from '@fluidframework/container-runtime';
4
- import { IAudience } from '@fluidframework/container-definitions';
5
- import { IDeltaManager } from '@fluidframework/container-definitions';
6
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
-
9
- /* Excluded from this release type: AttributionInfo */
10
-
11
- /* Excluded from this release type: AttributionKey */
12
-
13
- /* Excluded from this release type: Attributor */
14
-
15
- /* Excluded from this release type: ContainerRuntime */
16
-
17
- /* Excluded from this release type: createRuntimeAttributor */
18
-
19
- /* Excluded from this release type: enableOnNewFileKey */
20
-
21
- /* Excluded from this release type: IAttributor */
22
-
23
- /* Excluded from this release type: IProvideRuntimeAttributor */
24
-
25
- /* Excluded from this release type: IRuntimeAttributor */
26
-
27
- /* Excluded from this release type: mixinAttributor */
28
-
29
- /* Excluded from this release type: OpStreamAttributor */
30
-
31
- export { }
@@ -1,127 +0,0 @@
1
- import { AttributionInfo } from '@fluidframework/runtime-definitions';
2
- import { AttributionKey } from '@fluidframework/runtime-definitions';
3
- import { ContainerRuntime } from '@fluidframework/container-runtime';
4
- import { IAudience } from '@fluidframework/container-definitions';
5
- import { IDeltaManager } from '@fluidframework/container-definitions';
6
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
-
9
- /**
10
- * {@inheritdoc IAttributor}
11
- * @internal
12
- */
13
- export declare class Attributor implements IAttributor {
14
- protected readonly keyToInfo: Map<number, AttributionInfo>;
15
- /**
16
- * @param initialEntries - Any entries which should be populated on instantiation.
17
- */
18
- constructor(initialEntries?: Iterable<[number, AttributionInfo]>);
19
- /**
20
- * {@inheritdoc IAttributor.getAttributionInfo}
21
- */
22
- getAttributionInfo(key: number): AttributionInfo;
23
- /**
24
- * {@inheritdoc IAttributor.tryGetAttributionInfo}
25
- */
26
- tryGetAttributionInfo(key: number): AttributionInfo | undefined;
27
- /**
28
- * {@inheritdoc IAttributor.entries}
29
- */
30
- entries(): IterableIterator<[number, AttributionInfo]>;
31
- }
32
-
33
- /**
34
- * Creates an `IRuntimeAttributor` for usage with {@link mixinAttributor}.
35
- *
36
- * @remarks The attributor will only be populated with data once it's passed via scope to a container runtime load flow.
37
- *
38
- * @internal
39
- */
40
- export declare function createRuntimeAttributor(): IRuntimeAttributor;
41
-
42
- /**
43
- * @internal
44
- */
45
- export declare const enableOnNewFileKey = "Fluid.Attribution.EnableOnNewFile";
46
-
47
- /**
48
- * Provides lookup between attribution keys and their associated attribution information.
49
- * @internal
50
- */
51
- export declare interface IAttributor {
52
- /**
53
- * Retrieves attribution information associated with a particular key.
54
- * @param key - Attribution key to look up.
55
- * @throws If no attribution information is recorded for that key.
56
- */
57
- getAttributionInfo(key: number): AttributionInfo;
58
- /**
59
- * @param key - Attribution key to look up.
60
- * @returns the attribution information associated with the provided key, or undefined if no information exists.
61
- */
62
- tryGetAttributionInfo(key: number): AttributionInfo | undefined;
63
- /**
64
- * @returns an iterable of (attribution key, attribution info) pairs for each stored key.
65
- */
66
- entries(): IterableIterator<[number, AttributionInfo]>;
67
- }
68
-
69
- /**
70
- * @internal
71
- */
72
- export declare interface IProvideRuntimeAttributor {
73
- readonly IRuntimeAttributor: IRuntimeAttributor;
74
- }
75
-
76
- /**
77
- * @internal
78
- */
79
- export declare const IRuntimeAttributor: keyof IProvideRuntimeAttributor;
80
-
81
- /**
82
- * Provides access to attribution information stored on the container runtime.
83
- *
84
- * @remarks Attributors are only populated after the container runtime into which they are being injected has initialized.
85
- *
86
- * @sealed
87
- * @internal
88
- */
89
- export declare interface IRuntimeAttributor extends IProvideRuntimeAttributor {
90
- /**
91
- * @throws - If no AttributionInfo exists for this key.
92
- */
93
- get(key: AttributionKey): AttributionInfo;
94
- /**
95
- * @returns Whether any AttributionInfo exists for the provided key.
96
- */
97
- has(key: AttributionKey): boolean;
98
- /**
99
- * @returns Whether the runtime is currently tracking attribution information for the loaded container.
100
- * See {@link mixinAttributor} for more details on when this happens.
101
- */
102
- readonly isEnabled: boolean;
103
- }
104
-
105
- /**
106
- * Mixes in logic to load and store runtime-based attribution functionality.
107
- *
108
- * The `scope` passed to `load` should implement `IProvideRuntimeAttributor`.
109
- *
110
- * Existing documents without stored attributors will not start storing attribution information: if an
111
- * IRuntimeAttributor is passed via scope to load a document that never previously had attribution information,
112
- * that attributor's `has` method will always return `false`.
113
- * @param Base - base class, inherits from FluidAttributorRuntime
114
- * @internal
115
- */
116
- export declare const mixinAttributor: (Base?: typeof ContainerRuntime) => typeof ContainerRuntime;
117
-
118
- /**
119
- * Attributor which listens to an op stream and records entries for each op.
120
- * Sequence numbers are used as attribution keys.
121
- * @internal
122
- */
123
- export declare class OpStreamAttributor extends Attributor implements IAttributor {
124
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, audience: IAudience, initialEntries?: Iterable<[number, AttributionInfo]>);
125
- }
126
-
127
- export { }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports._dirname = void 0;
8
- // Problem:
9
- // - `__dirname` is not defined in ESM
10
- // - `import.meta.url` is not defined in CJS
11
- // Solution:
12
- // - Export '__dirname' from a .cjs file in the same directory.
13
- //
14
- // Note that *.cjs files are always CommonJS, but can be imported from ESM.
15
- exports._dirname = __dirname;
16
- //# sourceMappingURL=dirname.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dirname.cjs","sourceRoot":"","sources":["../../../src/test/attribution/dirname.cts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,WAAW;AACX,wCAAwC;AACxC,8CAA8C;AAC9C,YAAY;AACZ,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC9D,QAAA,QAAQ,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Problem:\n// - `__dirname` is not defined in ESM\n// - `import.meta.url` is not defined in CJS\n// Solution:\n// - Export '__dirname' from a .cjs file in the same directory.\n//\n// Note that *.cjs files are always CommonJS, but can be imported from ESM.\nexport const _dirname = __dirname;\n"]}