@fluidframework/id-compressor 2.0.0-rc.1.0.6 → 2.0.0-rc.2.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.
- package/{.eslintrc.js → .eslintrc.cjs} +5 -5
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +8 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/id-compressor.api.md +5 -42
- package/dist/finalSpace.d.ts +2 -2
- package/dist/finalSpace.d.ts.map +1 -1
- package/dist/finalSpace.js +4 -4
- package/dist/finalSpace.js.map +1 -1
- package/dist/id-compressor-alpha.d.ts +117 -112
- package/dist/id-compressor-beta.d.ts +84 -77
- package/dist/id-compressor-public.d.ts +84 -77
- package/dist/id-compressor-untrimmed.d.ts +117 -112
- package/dist/idCompressor.d.ts +15 -19
- package/dist/idCompressor.d.ts.map +1 -1
- package/dist/idCompressor.js +107 -94
- package/dist/idCompressor.js.map +1 -1
- package/dist/identifiers.d.ts +1 -1
- package/dist/identifiers.d.ts.map +1 -1
- package/dist/identifiers.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/persistanceUtilities.d.ts +1 -1
- package/dist/persistanceUtilities.d.ts.map +1 -1
- package/dist/persistanceUtilities.js.map +1 -1
- package/dist/sessionSpaceNormalizer.d.ts +2 -2
- package/dist/sessionSpaceNormalizer.d.ts.map +1 -1
- package/dist/sessionSpaceNormalizer.js +4 -4
- package/dist/sessionSpaceNormalizer.js.map +1 -1
- package/dist/sessions.d.ts +2 -2
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +12 -12
- package/dist/sessions.js.map +1 -1
- package/dist/test/appendOnlySortedMap.perf.spec.d.ts +6 -0
- package/dist/test/appendOnlySortedMap.perf.spec.d.ts.map +1 -0
- package/dist/test/appendOnlySortedMap.perf.spec.js.map +1 -0
- package/dist/test/appendOnlySortedMap.spec.d.ts +6 -0
- package/dist/test/appendOnlySortedMap.spec.d.ts.map +1 -0
- package/dist/test/appendOnlySortedMap.spec.js.map +1 -0
- package/dist/test/idCompressor.perf.spec.d.ts +6 -0
- package/dist/test/idCompressor.perf.spec.d.ts.map +1 -0
- package/dist/test/idCompressor.perf.spec.js.map +1 -0
- package/dist/test/idCompressor.spec.d.ts +6 -0
- package/dist/test/idCompressor.spec.d.ts.map +1 -0
- package/dist/test/idCompressor.spec.js.map +1 -0
- package/dist/test/idCompressorTestUtilities.d.ts +245 -0
- package/dist/test/idCompressorTestUtilities.d.ts.map +1 -0
- package/dist/test/idCompressorTestUtilities.js +589 -0
- package/dist/test/idCompressorTestUtilities.js.map +1 -0
- package/dist/test/index.d.ts +9 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +13 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/numericUuid.spec.d.ts +6 -0
- package/dist/test/numericUuid.spec.d.ts.map +1 -0
- package/dist/test/numericUuid.spec.js.map +1 -0
- package/dist/test/sessionSpaceNormalizer.spec.d.ts +6 -0
- package/dist/test/sessionSpaceNormalizer.spec.d.ts.map +1 -0
- package/dist/test/sessionSpaceNormalizer.spec.js.map +1 -0
- package/dist/test/snapshots/dirname.cjs +16 -0
- package/dist/test/snapshots/dirname.cjs.map +1 -0
- package/dist/test/snapshots/dirname.d.cts +6 -0
- package/dist/test/snapshots/dirname.d.cts.map +1 -0
- package/{lib/types/idCompressor.mjs → dist/test/snapshots/summary.spec.d.ts} +1 -1
- package/dist/test/snapshots/summary.spec.d.ts.map +1 -0
- package/dist/test/snapshots/summary.spec.js.map +1 -0
- package/dist/test/testCommon.d.ts +90 -0
- package/dist/test/testCommon.d.ts.map +1 -0
- package/dist/test/testCommon.js +90 -0
- package/dist/test/testCommon.js.map +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types/idCompressor.d.ts +134 -67
- package/dist/types/idCompressor.d.ts.map +1 -1
- package/dist/types/idCompressor.js.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/persisted-types/0.0.1.d.ts +1 -1
- package/dist/types/persisted-types/0.0.1.d.ts.map +1 -1
- package/dist/types/persisted-types/0.0.1.js.map +1 -1
- package/dist/types/persisted-types/index.d.ts +1 -1
- package/dist/types/persisted-types/index.d.ts.map +1 -1
- package/dist/types/persisted-types/index.js.map +1 -1
- package/dist/utilities.d.ts +2 -2
- package/dist/utilities.d.ts.map +1 -1
- package/dist/utilities.js.map +1 -1
- package/lib/{appendOnlySortedMap.d.mts → appendOnlySortedMap.d.ts} +1 -1
- package/lib/appendOnlySortedMap.d.ts.map +1 -0
- package/lib/{appendOnlySortedMap.mjs → appendOnlySortedMap.js} +3 -1
- package/lib/appendOnlySortedMap.js.map +1 -0
- package/lib/{finalSpace.d.mts → finalSpace.d.ts} +3 -3
- package/lib/finalSpace.d.ts.map +1 -0
- package/lib/{finalSpace.mjs → finalSpace.js} +2 -2
- package/lib/finalSpace.js.map +1 -0
- package/lib/{id-compressor-alpha.d.mts → id-compressor-alpha.d.ts} +117 -112
- package/lib/id-compressor-beta.d.ts +179 -0
- package/lib/id-compressor-public.d.ts +179 -0
- package/lib/{id-compressor-untrimmed.d.mts → id-compressor-untrimmed.d.ts} +117 -112
- package/lib/{idCompressor.d.mts → idCompressor.d.ts} +16 -20
- package/lib/idCompressor.d.ts.map +1 -0
- package/lib/{idCompressor.mjs → idCompressor.js} +54 -41
- package/lib/idCompressor.js.map +1 -0
- package/lib/{identifiers.d.mts → identifiers.d.ts} +2 -2
- package/lib/identifiers.d.ts.map +1 -0
- package/lib/{identifiers.mjs → identifiers.js} +1 -1
- package/lib/identifiers.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +7 -4
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/{persistanceUtilities.d.mts → persistanceUtilities.d.ts} +2 -2
- package/lib/persistanceUtilities.d.ts.map +1 -0
- package/lib/{persistanceUtilities.mjs → persistanceUtilities.js} +1 -1
- package/lib/persistanceUtilities.js.map +1 -0
- package/lib/{sessionSpaceNormalizer.d.mts → sessionSpaceNormalizer.d.ts} +3 -3
- package/lib/sessionSpaceNormalizer.d.ts.map +1 -0
- package/lib/{sessionSpaceNormalizer.mjs → sessionSpaceNormalizer.js} +3 -3
- package/lib/sessionSpaceNormalizer.js.map +1 -0
- package/lib/{sessions.d.mts → sessions.d.ts} +3 -3
- package/lib/sessions.d.ts.map +1 -0
- package/lib/{sessions.mjs → sessions.js} +2 -2
- package/lib/sessions.js.map +1 -0
- package/lib/test/appendOnlySortedMap.perf.spec.d.ts +6 -0
- package/lib/test/appendOnlySortedMap.perf.spec.d.ts.map +1 -0
- package/lib/test/appendOnlySortedMap.perf.spec.js +49 -0
- package/lib/test/appendOnlySortedMap.perf.spec.js.map +1 -0
- package/lib/test/appendOnlySortedMap.spec.d.ts +6 -0
- package/lib/test/appendOnlySortedMap.spec.d.ts.map +1 -0
- package/lib/test/appendOnlySortedMap.spec.js +166 -0
- package/lib/test/appendOnlySortedMap.spec.js.map +1 -0
- package/lib/test/idCompressor.perf.spec.d.ts +6 -0
- package/lib/test/idCompressor.perf.spec.d.ts.map +1 -0
- package/lib/test/idCompressor.perf.spec.js +281 -0
- package/lib/test/idCompressor.perf.spec.js.map +1 -0
- package/lib/test/idCompressor.spec.d.ts +6 -0
- package/lib/test/idCompressor.spec.d.ts.map +1 -0
- package/lib/test/idCompressor.spec.js +953 -0
- package/lib/test/idCompressor.spec.js.map +1 -0
- package/lib/test/idCompressorTestUtilities.d.ts +245 -0
- package/lib/test/idCompressorTestUtilities.d.ts.map +1 -0
- package/lib/test/idCompressorTestUtilities.js +576 -0
- package/lib/test/idCompressorTestUtilities.js.map +1 -0
- package/lib/test/index.d.ts +9 -0
- package/lib/test/index.d.ts.map +1 -0
- package/lib/test/index.js +9 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/numericUuid.spec.d.ts +6 -0
- package/lib/test/numericUuid.spec.d.ts.map +1 -0
- package/lib/test/numericUuid.spec.js +74 -0
- package/lib/test/numericUuid.spec.js.map +1 -0
- package/lib/test/sessionSpaceNormalizer.spec.d.ts +6 -0
- package/lib/test/sessionSpaceNormalizer.spec.d.ts.map +1 -0
- package/lib/test/sessionSpaceNormalizer.spec.js +43 -0
- package/lib/test/sessionSpaceNormalizer.spec.js.map +1 -0
- package/lib/test/snapshots/dirname.cjs +16 -0
- package/lib/test/snapshots/dirname.cjs.map +1 -0
- package/lib/test/snapshots/dirname.d.cts +6 -0
- package/lib/test/snapshots/dirname.d.cts.map +1 -0
- package/lib/test/snapshots/summary.spec.d.ts +6 -0
- package/lib/test/snapshots/summary.spec.d.ts.map +1 -0
- package/lib/test/snapshots/summary.spec.js +127 -0
- package/lib/test/snapshots/summary.spec.js.map +1 -0
- package/lib/test/testCommon.d.ts +90 -0
- package/lib/test/testCommon.d.ts.map +1 -0
- package/lib/test/testCommon.js +80 -0
- package/lib/test/testCommon.js.map +1 -0
- package/lib/types/{idCompressor.d.mts → idCompressor.d.ts} +135 -68
- package/lib/types/idCompressor.d.ts.map +1 -0
- package/lib/types/{identifiers.mjs → idCompressor.js} +1 -1
- package/lib/types/idCompressor.js.map +1 -0
- package/lib/types/{identifiers.d.mts → identifiers.d.ts} +1 -1
- package/lib/types/identifiers.d.ts.map +1 -0
- package/lib/types/identifiers.js +6 -0
- package/lib/types/identifiers.js.map +1 -0
- package/lib/types/{index.d.mts → index.d.ts} +4 -4
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/{persisted-types/0.0.1.mjs → index.js} +1 -1
- package/lib/types/index.js.map +1 -0
- package/lib/types/persisted-types/{0.0.1.d.mts → 0.0.1.d.ts} +2 -2
- package/lib/types/persisted-types/0.0.1.d.ts.map +1 -0
- package/lib/types/persisted-types/{index.mjs → 0.0.1.js} +1 -1
- package/lib/types/persisted-types/0.0.1.js.map +1 -0
- package/lib/types/persisted-types/{index.d.mts → index.d.ts} +2 -2
- package/lib/types/persisted-types/index.d.ts.map +1 -0
- package/lib/types/{index.mjs → persisted-types/index.js} +1 -1
- package/lib/types/persisted-types/index.js.map +1 -0
- package/lib/{utilities.d.mts → utilities.d.ts} +3 -3
- package/lib/utilities.d.ts.map +1 -0
- package/lib/{utilities.mjs → utilities.js} +2 -1
- package/lib/utilities.js.map +1 -0
- package/package.json +87 -21
- package/src/finalSpace.ts +2 -2
- package/src/idCompressor.ts +75 -59
- package/src/identifiers.ts +1 -1
- package/src/index.ts +3 -3
- package/src/packageVersion.ts +1 -1
- package/src/persistanceUtilities.ts +1 -1
- package/src/sessionSpaceNormalizer.ts +3 -3
- package/src/sessions.ts +3 -3
- package/src/test/idCompressorTestUtilities.ts +921 -0
- package/src/test/index.ts +10 -0
- package/src/test/snapshots/dirname.cts +13 -0
- package/src/test/snapshots/files/compressor-with-finalized-range-from-one-client +1 -0
- package/src/test/snapshots/files/compressor-with-finalized-range-from-one-client-client2 +1 -0
- package/src/test/snapshots/files/compressors-with-finalized-ranges-from-two-clients +1 -0
- package/src/test/snapshots/files/compressors-with-finalized-ranges-from-two-clients-client2 +1 -0
- package/src/test/snapshots/files/empty-compressor-summary +1 -0
- package/src/test/snapshots/files/expansion-semantics +1 -0
- package/src/test/snapshots/files/expansion-semantics-client2 +1 -0
- package/src/test/testCommon.ts +143 -0
- package/src/test/tsconfig.cjs.json +12 -0
- package/src/test/tsconfig.json +20 -0
- package/src/types/idCompressor.ts +147 -72
- package/src/types/index.ts +8 -3
- package/src/types/persisted-types/0.0.1.ts +1 -1
- package/src/types/persisted-types/index.ts +1 -1
- package/src/utilities.ts +2 -2
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/appendOnlySortedMap.d.mts.map +0 -1
- package/lib/appendOnlySortedMap.mjs.map +0 -1
- package/lib/finalSpace.d.mts.map +0 -1
- package/lib/finalSpace.mjs.map +0 -1
- package/lib/id-compressor-beta.d.mts +0 -172
- package/lib/id-compressor-public.d.mts +0 -172
- package/lib/idCompressor.d.mts.map +0 -1
- package/lib/idCompressor.mjs.map +0 -1
- package/lib/identifiers.d.mts.map +0 -1
- package/lib/identifiers.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -7
- package/lib/index.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
- package/lib/persistanceUtilities.d.mts.map +0 -1
- package/lib/persistanceUtilities.mjs.map +0 -1
- package/lib/sessionSpaceNormalizer.d.mts.map +0 -1
- package/lib/sessionSpaceNormalizer.mjs.map +0 -1
- package/lib/sessions.d.mts.map +0 -1
- package/lib/sessions.mjs.map +0 -1
- package/lib/types/idCompressor.d.mts.map +0 -1
- package/lib/types/idCompressor.mjs.map +0 -1
- package/lib/types/identifiers.d.mts.map +0 -1
- package/lib/types/identifiers.mjs.map +0 -1
- package/lib/types/index.d.mts.map +0 -1
- package/lib/types/index.mjs.map +0 -1
- package/lib/types/persisted-types/0.0.1.d.mts.map +0 -1
- package/lib/types/persisted-types/0.0.1.mjs.map +0 -1
- package/lib/types/persisted-types/index.d.mts.map +0 -1
- package/lib/types/persisted-types/index.mjs.map +0 -1
- package/lib/utilities.d.mts.map +0 -1
- package/lib/utilities.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/id-compressor",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.2.0.1",
|
|
4
4
|
"description": "ID compressor",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -11,8 +11,70 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"author": "Microsoft and contributors",
|
|
13
13
|
"sideEffects": false,
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./lib/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"require": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"./public": {
|
|
27
|
+
"import": {
|
|
28
|
+
"types": "./lib/id-compressor-public.d.ts",
|
|
29
|
+
"default": "./lib/index.js"
|
|
30
|
+
},
|
|
31
|
+
"require": {
|
|
32
|
+
"types": "./dist/id-compressor-public.d.ts",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"./alpha": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./lib/id-compressor-alpha.d.ts",
|
|
39
|
+
"default": "./lib/index.js"
|
|
40
|
+
},
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./dist/id-compressor-alpha.d.ts",
|
|
43
|
+
"default": "./dist/index.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"./internal": {
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./lib/index.d.ts",
|
|
49
|
+
"default": "./lib/index.js"
|
|
50
|
+
},
|
|
51
|
+
"require": {
|
|
52
|
+
"types": "./dist/index.d.ts",
|
|
53
|
+
"default": "./dist/index.js"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"./test": {
|
|
57
|
+
"import": {
|
|
58
|
+
"types": "./lib/test/index.d.ts",
|
|
59
|
+
"default": "./lib/test/index.js"
|
|
60
|
+
},
|
|
61
|
+
"require": {
|
|
62
|
+
"types": "./dist/test/index.d.ts",
|
|
63
|
+
"default": "./dist/test/index.js"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"./test/idCompressorTestUtilities": {
|
|
67
|
+
"import": {
|
|
68
|
+
"types": "./lib/test/idCompressorTestUtilities.d.ts",
|
|
69
|
+
"default": "./lib/test/idCompressorTestUtilities.js"
|
|
70
|
+
},
|
|
71
|
+
"require": {
|
|
72
|
+
"types": "./dist/test/idCompressorTestUtilities.d.ts",
|
|
73
|
+
"default": "./dist/test/idCompressorTestUtilities.js"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
14
77
|
"main": "dist/index.js",
|
|
15
|
-
"module": "lib/index.mjs",
|
|
16
78
|
"types": "dist/index.d.ts",
|
|
17
79
|
"c8": {
|
|
18
80
|
"all": true,
|
|
@@ -35,37 +97,36 @@
|
|
|
35
97
|
"temp-directory": "nyc/.nyc_output"
|
|
36
98
|
},
|
|
37
99
|
"dependencies": {
|
|
38
|
-
"@fluid-internal/client-utils": ">=2.0.0-rc.
|
|
39
|
-
"@fluidframework/core-interfaces": ">=2.0.0-rc.
|
|
40
|
-
"@fluidframework/core-utils": ">=2.0.0-rc.
|
|
41
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-rc.
|
|
100
|
+
"@fluid-internal/client-utils": ">=2.0.0-rc.2.0.1 <2.0.0-rc.2.1.0",
|
|
101
|
+
"@fluidframework/core-interfaces": ">=2.0.0-rc.2.0.1 <2.0.0-rc.2.1.0",
|
|
102
|
+
"@fluidframework/core-utils": ">=2.0.0-rc.2.0.1 <2.0.0-rc.2.1.0",
|
|
103
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-rc.2.0.1 <2.0.0-rc.2.1.0",
|
|
42
104
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
43
105
|
"uuid": "^9.0.0"
|
|
44
106
|
},
|
|
45
107
|
"devDependencies": {
|
|
46
108
|
"@arethetypeswrong/cli": "^0.13.3",
|
|
47
|
-
"@fluid-
|
|
109
|
+
"@fluid-internal/mocha-test-setup": ">=2.0.0-rc.2.0.1 <2.0.0-rc.2.1.0",
|
|
110
|
+
"@fluid-private/stochastic-test-utils": ">=2.0.0-rc.2.0.1 <2.0.0-rc.2.1.0",
|
|
48
111
|
"@fluid-tools/benchmark": "^0.48.0",
|
|
49
|
-
"@fluid-tools/build-cli": "^0.
|
|
112
|
+
"@fluid-tools/build-cli": "^0.34.0",
|
|
50
113
|
"@fluidframework/build-common": "^2.0.3",
|
|
51
|
-
"@fluidframework/build-tools": "^0.
|
|
52
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
114
|
+
"@fluidframework/build-tools": "^0.34.0",
|
|
115
|
+
"@fluidframework/eslint-config-fluid": "^4.0.0",
|
|
53
116
|
"@fluidframework/id-compressor-previous": "npm:@fluidframework/id-compressor@2.0.0-internal.8.0.0",
|
|
54
|
-
"@
|
|
55
|
-
"@microsoft/api-extractor": "^7.38.3",
|
|
117
|
+
"@microsoft/api-extractor": "^7.42.3",
|
|
56
118
|
"@types/mocha": "^9.1.1",
|
|
57
119
|
"@types/uuid": "^9.0.2",
|
|
58
120
|
"c8": "^8.0.1",
|
|
59
121
|
"copyfiles": "^2.4.1",
|
|
60
122
|
"cross-env": "^7.0.3",
|
|
61
|
-
"eslint": "~8.
|
|
123
|
+
"eslint": "~8.55.0",
|
|
62
124
|
"mocha": "^10.2.0",
|
|
63
125
|
"mocha-json-output-reporter": "^2.0.1",
|
|
64
126
|
"mocha-multi-reporters": "^1.5.1",
|
|
65
127
|
"moment": "^2.21.0",
|
|
66
128
|
"prettier": "~3.0.3",
|
|
67
129
|
"rimraf": "^4.4.0",
|
|
68
|
-
"tsc-multi": "^1.1.0",
|
|
69
130
|
"typescript": "~5.1.6"
|
|
70
131
|
},
|
|
71
132
|
"fluidBuild": {
|
|
@@ -85,16 +146,18 @@
|
|
|
85
146
|
},
|
|
86
147
|
"scripts": {
|
|
87
148
|
"api": "fluid-build . --task api",
|
|
88
|
-
"api-extractor:commonjs": "api-extractor run --
|
|
89
|
-
"api-extractor:esnext": "api-extractor run --
|
|
149
|
+
"api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
|
|
150
|
+
"api-extractor:esnext": "api-extractor run --local",
|
|
90
151
|
"build": "fluid-build . --task build",
|
|
91
152
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
92
153
|
"build:compile": "fluid-build . --task compile",
|
|
93
154
|
"build:docs": "fluid-build . --task api",
|
|
94
|
-
"build:esnext": "tsc
|
|
155
|
+
"build:esnext": "tsc --project ./tsconfig.json",
|
|
95
156
|
"build:genver": "gen-version",
|
|
96
|
-
"build:test": "
|
|
97
|
-
"
|
|
157
|
+
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
158
|
+
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
159
|
+
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
160
|
+
"check:are-the-types-wrong": "attw --pack . --entrypoints .",
|
|
98
161
|
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
99
162
|
"ci:build:docs": "api-extractor run",
|
|
100
163
|
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
@@ -108,9 +171,12 @@
|
|
|
108
171
|
"test": "npm run test:mocha",
|
|
109
172
|
"test:benchmark:report": "mocha --timeout 999999 --perfMode --parentProcess --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js \"./dist/**/*.perf.spec.*js\"",
|
|
110
173
|
"test:coverage": "c8 npm test",
|
|
111
|
-
"test:mocha": "
|
|
174
|
+
"test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
|
|
175
|
+
"test:mocha:cjs": "mocha --recursive \"dist/test/**/*.spec.*js\" --exit",
|
|
176
|
+
"test:mocha:esm": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit",
|
|
112
177
|
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
113
|
-
"
|
|
178
|
+
"test:snapshots:regen": "npm run test:mocha:esm -- --snapshot",
|
|
179
|
+
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
114
180
|
"tsc:watch": "tsc --watch"
|
|
115
181
|
}
|
|
116
182
|
}
|
package/src/finalSpace.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils";
|
|
7
|
-
import { IdCluster, clustersEqual, lastAllocatedFinal, lastFinalizedFinal } from "./sessions";
|
|
8
|
-
import { FinalCompressedId } from "./identifiers";
|
|
7
|
+
import { IdCluster, clustersEqual, lastAllocatedFinal, lastFinalizedFinal } from "./sessions.js";
|
|
8
|
+
import { FinalCompressedId } from "./identifiers.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* All IDs that have been finalized (acked), grouped into clusters sorted by their base final IDs.
|
package/src/idCompressor.ts
CHANGED
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
SessionId,
|
|
19
19
|
SessionSpaceCompressedId,
|
|
20
20
|
StableId,
|
|
21
|
-
} from "./types";
|
|
22
|
-
import { FinalCompressedId, isFinalId, LocalCompressedId, NumericUuid } from "./identifiers";
|
|
21
|
+
} from "./types/index.js";
|
|
22
|
+
import { FinalCompressedId, isFinalId, LocalCompressedId, NumericUuid } from "./identifiers.js";
|
|
23
23
|
import {
|
|
24
24
|
createSessionId,
|
|
25
25
|
localIdFromGenCount,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
offsetNumericUuid,
|
|
29
29
|
stableIdFromNumericUuid,
|
|
30
30
|
subtractNumericUuids,
|
|
31
|
-
} from "./utilities";
|
|
31
|
+
} from "./utilities.js";
|
|
32
32
|
import {
|
|
33
33
|
Index,
|
|
34
34
|
readBoolean,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
writeBoolean,
|
|
38
38
|
writeNumber,
|
|
39
39
|
writeNumericUuid,
|
|
40
|
-
} from "./persistanceUtilities";
|
|
40
|
+
} from "./persistanceUtilities.js";
|
|
41
41
|
import {
|
|
42
42
|
getAlignedLocal,
|
|
43
43
|
getAlignedFinal,
|
|
@@ -46,9 +46,9 @@ import {
|
|
|
46
46
|
Session,
|
|
47
47
|
Sessions,
|
|
48
48
|
lastFinalizedFinal,
|
|
49
|
-
} from "./sessions";
|
|
50
|
-
import { SessionSpaceNormalizer } from "./sessionSpaceNormalizer";
|
|
51
|
-
import { FinalSpace } from "./finalSpace";
|
|
49
|
+
} from "./sessions.js";
|
|
50
|
+
import { SessionSpaceNormalizer } from "./sessionSpaceNormalizer.js";
|
|
51
|
+
import { FinalSpace } from "./finalSpace.js";
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* The version of IdCompressor that is currently persisted.
|
|
@@ -58,11 +58,6 @@ const currentWrittenVersion = 2.0;
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* See {@link IIdCompressor} and {@link IIdCompressorCore}
|
|
61
|
-
*
|
|
62
|
-
* @alpha
|
|
63
|
-
*
|
|
64
|
-
* @deprecated Not intended for public use and will be removed from the public API in the future.
|
|
65
|
-
* Use `createIdCompressor` instead.
|
|
66
61
|
*/
|
|
67
62
|
export class IdCompressor implements IIdCompressor, IIdCompressorCore {
|
|
68
63
|
/**
|
|
@@ -109,7 +104,7 @@ export class IdCompressor implements IIdCompressor, IIdCompressorCore {
|
|
|
109
104
|
|
|
110
105
|
// #endregion
|
|
111
106
|
|
|
112
|
-
|
|
107
|
+
public constructor(
|
|
113
108
|
localSessionIdOrDeserialized: SessionId | Sessions,
|
|
114
109
|
private readonly logger?: ITelemetryLoggerExt,
|
|
115
110
|
) {
|
|
@@ -130,41 +125,6 @@ export class IdCompressor implements IIdCompressor, IIdCompressorCore {
|
|
|
130
125
|
}
|
|
131
126
|
}
|
|
132
127
|
|
|
133
|
-
/**
|
|
134
|
-
* @deprecated Use `createIdCompressor` instead.
|
|
135
|
-
*/
|
|
136
|
-
public static create(logger?: ITelemetryBaseLogger): IIdCompressor & IIdCompressorCore;
|
|
137
|
-
/**
|
|
138
|
-
* @deprecated Use `createIdCompressor` instead.
|
|
139
|
-
*/
|
|
140
|
-
public static create(
|
|
141
|
-
sessionId: SessionId,
|
|
142
|
-
logger?: ITelemetryBaseLogger,
|
|
143
|
-
): IIdCompressor & IIdCompressorCore;
|
|
144
|
-
public static create(
|
|
145
|
-
sessionIdOrLogger?: SessionId | ITelemetryBaseLogger,
|
|
146
|
-
loggerOrUndefined?: ITelemetryBaseLogger,
|
|
147
|
-
): IIdCompressor & IIdCompressorCore {
|
|
148
|
-
let localSessionId: SessionId;
|
|
149
|
-
let logger: ITelemetryBaseLogger | undefined;
|
|
150
|
-
if (sessionIdOrLogger === undefined) {
|
|
151
|
-
localSessionId = createSessionId();
|
|
152
|
-
} else {
|
|
153
|
-
if (typeof sessionIdOrLogger === "string") {
|
|
154
|
-
localSessionId = sessionIdOrLogger;
|
|
155
|
-
logger = loggerOrUndefined;
|
|
156
|
-
} else {
|
|
157
|
-
localSessionId = createSessionId();
|
|
158
|
-
logger = loggerOrUndefined;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
const compressor = new IdCompressor(
|
|
162
|
-
localSessionId,
|
|
163
|
-
logger === undefined ? undefined : createChildLogger({ logger }),
|
|
164
|
-
);
|
|
165
|
-
return compressor;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
128
|
public generateCompressedId(): SessionSpaceCompressedId {
|
|
169
129
|
// This ghost session code inside this block should not be changed without a version bump (it is performed at a consensus point)
|
|
170
130
|
if (this.ongoingGhostSession) {
|
|
@@ -206,11 +166,25 @@ export class IdCompressor implements IIdCompressor, IIdCompressorCore {
|
|
|
206
166
|
}
|
|
207
167
|
}
|
|
208
168
|
|
|
169
|
+
public generateDocumentUniqueId(): (SessionSpaceCompressedId & OpSpaceCompressedId) | StableId {
|
|
170
|
+
const id = this.generateCompressedId();
|
|
171
|
+
return isFinalId(id) ? id : this.decompress(id);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Starts a ghost session. Only exposed for test purposes (this class is not exported from the package).
|
|
176
|
+
* @param ghostSessionId - The session ID to start the ghost session with.
|
|
177
|
+
*/
|
|
178
|
+
public startGhostSession(ghostSessionId: SessionId): void {
|
|
179
|
+
assert(!this.ongoingGhostSession, 0x8fe /* Ghost session already in progress. */);
|
|
180
|
+
this.ongoingGhostSession = { ghostSessionId };
|
|
181
|
+
}
|
|
182
|
+
|
|
209
183
|
/**
|
|
210
184
|
* {@inheritdoc IIdCompressorCore.beginGhostSession}
|
|
211
185
|
*/
|
|
212
186
|
public beginGhostSession(ghostSessionId: SessionId, ghostSessionCallback: () => void) {
|
|
213
|
-
this.
|
|
187
|
+
this.startGhostSession(ghostSessionId);
|
|
214
188
|
try {
|
|
215
189
|
ghostSessionCallback();
|
|
216
190
|
} finally {
|
|
@@ -589,15 +563,27 @@ export class IdCompressor implements IIdCompressor, IIdCompressorCore {
|
|
|
589
563
|
return bufferToString(serializedFloat.buffer, "base64") as SerializedIdCompressor;
|
|
590
564
|
}
|
|
591
565
|
|
|
592
|
-
public static deserialize(
|
|
566
|
+
public static deserialize(
|
|
567
|
+
serialized: SerializedIdCompressorWithOngoingSession,
|
|
568
|
+
logger?: ITelemetryLoggerExt,
|
|
569
|
+
): IdCompressor;
|
|
593
570
|
public static deserialize(
|
|
594
571
|
serialized: SerializedIdCompressorWithNoSession,
|
|
595
572
|
newSessionId: SessionId,
|
|
573
|
+
logger?: ITelemetryLoggerExt,
|
|
596
574
|
): IdCompressor;
|
|
597
575
|
public static deserialize(
|
|
598
576
|
serialized: SerializedIdCompressor,
|
|
599
|
-
|
|
577
|
+
loggerOrSessionId?: ITelemetryLoggerExt | SessionId,
|
|
600
578
|
): IdCompressor {
|
|
579
|
+
let sessionId: SessionId | undefined;
|
|
580
|
+
let logger: ITelemetryLoggerExt | undefined;
|
|
581
|
+
if (typeof loggerOrSessionId === "string") {
|
|
582
|
+
sessionId = loggerOrSessionId;
|
|
583
|
+
} else {
|
|
584
|
+
logger = loggerOrSessionId;
|
|
585
|
+
}
|
|
586
|
+
|
|
601
587
|
const buffer = stringToBuffer(serialized, "base64");
|
|
602
588
|
const index: Index = {
|
|
603
589
|
index: 0,
|
|
@@ -609,13 +595,17 @@ export class IdCompressor implements IIdCompressor, IIdCompressorCore {
|
|
|
609
595
|
case 1.0:
|
|
610
596
|
throw new Error("IdCompressor version 1.0 is no longer supported.");
|
|
611
597
|
case 2.0:
|
|
612
|
-
return IdCompressor.deserialize2_0(index, sessionId);
|
|
598
|
+
return IdCompressor.deserialize2_0(index, sessionId, logger);
|
|
613
599
|
default:
|
|
614
600
|
throw new Error("Unknown IdCompressor serialized version.");
|
|
615
601
|
}
|
|
616
602
|
}
|
|
617
603
|
|
|
618
|
-
|
|
604
|
+
static deserialize2_0(
|
|
605
|
+
index: Index,
|
|
606
|
+
sessionId?: SessionId,
|
|
607
|
+
logger?: ITelemetryLoggerExt,
|
|
608
|
+
): IdCompressor {
|
|
619
609
|
const hasLocalState = readBoolean(index);
|
|
620
610
|
const sessionCount = readNumber(index);
|
|
621
611
|
const clusterCount = readNumber(index);
|
|
@@ -641,7 +631,7 @@ export class IdCompressor implements IIdCompressor, IIdCompressorCore {
|
|
|
641
631
|
sessions.push([numeric, new Session(numeric)]);
|
|
642
632
|
}
|
|
643
633
|
|
|
644
|
-
const compressor = new IdCompressor(new Sessions(sessions));
|
|
634
|
+
const compressor = new IdCompressor(new Sessions(sessions), logger);
|
|
645
635
|
|
|
646
636
|
// Clusters
|
|
647
637
|
let baseFinalId = 0;
|
|
@@ -714,7 +704,24 @@ export function createIdCompressor(
|
|
|
714
704
|
sessionIdOrLogger?: SessionId | ITelemetryBaseLogger,
|
|
715
705
|
loggerOrUndefined?: ITelemetryBaseLogger,
|
|
716
706
|
): IIdCompressor & IIdCompressorCore {
|
|
717
|
-
|
|
707
|
+
let localSessionId: SessionId;
|
|
708
|
+
let logger: ITelemetryBaseLogger | undefined;
|
|
709
|
+
if (sessionIdOrLogger === undefined) {
|
|
710
|
+
localSessionId = createSessionId();
|
|
711
|
+
} else {
|
|
712
|
+
if (typeof sessionIdOrLogger === "string") {
|
|
713
|
+
localSessionId = sessionIdOrLogger;
|
|
714
|
+
logger = loggerOrUndefined;
|
|
715
|
+
} else {
|
|
716
|
+
localSessionId = createSessionId();
|
|
717
|
+
logger = sessionIdOrLogger;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
const compressor = new IdCompressor(
|
|
721
|
+
localSessionId,
|
|
722
|
+
logger === undefined ? undefined : createChildLogger({ logger }),
|
|
723
|
+
);
|
|
724
|
+
return compressor;
|
|
718
725
|
}
|
|
719
726
|
|
|
720
727
|
/**
|
|
@@ -723,6 +730,7 @@ export function createIdCompressor(
|
|
|
723
730
|
*/
|
|
724
731
|
export function deserializeIdCompressor(
|
|
725
732
|
serialized: SerializedIdCompressorWithOngoingSession,
|
|
733
|
+
logger?: ITelemetryLoggerExt,
|
|
726
734
|
): IIdCompressor & IIdCompressorCore;
|
|
727
735
|
/**
|
|
728
736
|
* Deserializes the supplied state into an ID compressor.
|
|
@@ -731,12 +739,20 @@ export function deserializeIdCompressor(
|
|
|
731
739
|
export function deserializeIdCompressor(
|
|
732
740
|
serialized: SerializedIdCompressorWithNoSession,
|
|
733
741
|
newSessionId: SessionId,
|
|
742
|
+
logger?: ITelemetryLoggerExt,
|
|
734
743
|
): IIdCompressor & IIdCompressorCore;
|
|
735
744
|
export function deserializeIdCompressor(
|
|
736
745
|
serialized: SerializedIdCompressor | SerializedIdCompressorWithNoSession,
|
|
737
|
-
|
|
746
|
+
sessionIdOrLogger?: SessionId | ITelemetryLoggerExt,
|
|
747
|
+
logger?: ITelemetryLoggerExt | undefined,
|
|
738
748
|
): IIdCompressor & IIdCompressorCore {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
749
|
+
if (typeof sessionIdOrLogger === "string") {
|
|
750
|
+
return IdCompressor.deserialize(
|
|
751
|
+
serialized as SerializedIdCompressorWithNoSession,
|
|
752
|
+
sessionIdOrLogger,
|
|
753
|
+
logger,
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
return IdCompressor.deserialize(serialized as SerializedIdCompressorWithOngoingSession, logger);
|
|
742
758
|
}
|
package/src/identifiers.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { OpSpaceCompressedId, SessionSpaceCompressedId } from "./types";
|
|
6
|
+
import { OpSpaceCompressedId, SessionSpaceCompressedId } from "./types/index.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A compressed ID that is stable and unique within the scope of network of compressors (i.e. a document).
|
package/src/index.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Exports for `id-compressor`
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export { createIdCompressor, deserializeIdCompressor
|
|
11
|
-
export { createSessionId, assertIsStableId, generateStableId, isStableId } from "./utilities";
|
|
10
|
+
export { createIdCompressor, deserializeIdCompressor } from "./idCompressor.js";
|
|
11
|
+
export { createSessionId, assertIsStableId, generateStableId, isStableId } from "./utilities.js";
|
|
12
12
|
export {
|
|
13
13
|
IIdCompressorCore,
|
|
14
14
|
IIdCompressor,
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
SessionId,
|
|
21
21
|
StableId,
|
|
22
22
|
IdCreationRange,
|
|
23
|
-
} from "./types";
|
|
23
|
+
} from "./types/index.js";
|
package/src/packageVersion.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { AppendOnlySortedMap } from "./appendOnlySortedMap";
|
|
7
|
-
import { LocalCompressedId } from "./identifiers";
|
|
8
|
-
import { compareFiniteNumbers, genCountFromLocalId } from "./utilities";
|
|
6
|
+
import { AppendOnlySortedMap } from "./appendOnlySortedMap.js";
|
|
7
|
+
import { LocalCompressedId } from "./identifiers.js";
|
|
8
|
+
import { compareFiniteNumbers, genCountFromLocalId } from "./utilities.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* The `SessionSpaceNormalizer` tracks the form of the IDs created by the local session.
|
package/src/sessions.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { BTree } from "@tylerbu/sorted-btree-es6";
|
|
7
7
|
import { assert } from "@fluidframework/core-utils";
|
|
8
|
-
import { SessionId, StableId } from "./types";
|
|
8
|
+
import { SessionId, StableId } from "./types/index.js";
|
|
9
9
|
import {
|
|
10
10
|
compareBigints,
|
|
11
11
|
localIdFromGenCount,
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
stableIdFromNumericUuid,
|
|
15
15
|
subtractNumericUuids,
|
|
16
16
|
offsetNumericUuid,
|
|
17
|
-
} from "./utilities";
|
|
18
|
-
import { FinalCompressedId, LocalCompressedId, NumericUuid } from "./identifiers";
|
|
17
|
+
} from "./utilities.js";
|
|
18
|
+
import { FinalCompressedId, LocalCompressedId, NumericUuid } from "./identifiers.js";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* A collection of all sessions known to the compressor (i.e. all finalized/acked allocated UUIDs and their corresponding local and final forms).
|