jazz-tools 0.16.3 → 0.16.5
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/.turbo/turbo-build.log +30 -30
- package/CHANGELOG.md +29 -0
- package/dist/{chunk-RAMDW4VL.js → chunk-H3BIFFQG.js} +32 -10
- package/dist/chunk-H3BIFFQG.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/dist/tools/coValues/group.d.ts +2 -2
- package/dist/tools/coValues/group.d.ts.map +1 -1
- package/dist/tools/coValues/interfaces.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +20 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/unionUtils.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/zodSchema.d.ts +1 -1
- package/dist/tools/implementation/zodSchema/zodSchema.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/tools/coValues/group.ts +3 -3
- package/src/tools/coValues/interfaces.ts +2 -3
- package/src/tools/implementation/zodSchema/schemaTypes/CoMapSchema.ts +59 -2
- package/src/tools/implementation/zodSchema/unionUtils.ts +7 -2
- package/src/tools/implementation/zodSchema/zodSchema.ts +1 -1
- package/src/tools/tests/coDiscriminatedUnion.test.ts +50 -0
- package/src/tools/tests/coMap.test-d.ts +143 -0
- package/src/tools/tests/coMap.test.ts +100 -53
- package/src/tools/tests/load.test.ts +19 -0
- package/dist/chunk-RAMDW4VL.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.16.
|
2
|
+
> jazz-tools@0.16.5 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup && pnpm types && pnpm build:svelte
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -107,18 +107,18 @@
|
|
107
107
|
[34mESM[39m Build start
|
108
108
|
[34mCLI[39m Cleaning output folder
|
109
109
|
[34mESM[39m Build start
|
110
|
-
[32mESM[39m [1mdist/worker/index.js [22m[32m2.31 KB[39m
|
111
|
-
[32mESM[39m [1mdist/worker/index.js.map [22m[32m4.77 KB[39m
|
112
|
-
[32mESM[39m ⚡️ Build success in 16ms
|
113
110
|
[32mESM[39m [1mdist/tiptap/index.js [22m[32m564.00 B[39m
|
114
111
|
[32mESM[39m [1mdist/tiptap/index.js.map [22m[32m1.21 KB[39m
|
115
|
-
[32mESM[39m ⚡️ Build success in
|
112
|
+
[32mESM[39m ⚡️ Build success in 15ms
|
116
113
|
[32mESM[39m [1mdist/react/ssr.js [22m[32m688.00 B[39m
|
117
114
|
[32mESM[39m [1mdist/react/ssr.js.map [22m[32m1.12 KB[39m
|
118
|
-
[32mESM[39m ⚡️ Build success in
|
115
|
+
[32mESM[39m ⚡️ Build success in 17ms
|
116
|
+
[32mESM[39m [1mdist/worker/index.js [22m[32m2.31 KB[39m
|
117
|
+
[32mESM[39m [1mdist/worker/index.js.map [22m[32m4.77 KB[39m
|
118
|
+
[32mESM[39m ⚡️ Build success in 15ms
|
119
119
|
[32mESM[39m [1mdist/browser-media-images/index.js [22m[32m2.55 KB[39m
|
120
120
|
[32mESM[39m [1mdist/browser-media-images/index.js.map [22m[32m5.46 KB[39m
|
121
|
-
[32mESM[39m ⚡️ Build success in
|
121
|
+
[32mESM[39m ⚡️ Build success in 20ms
|
122
122
|
[32mESM[39m [1mdist/react-native-media-images/index.js [22m[32m6.19 KB[39m
|
123
123
|
[32mESM[39m [1mdist/react-native-media-images/index.js.map [22m[32m10.96 KB[39m
|
124
124
|
[32mESM[39m ⚡️ Build success in 18ms
|
@@ -128,60 +128,60 @@
|
|
128
128
|
[32mESM[39m [1mdist/react-core/index.js.map [22m[32m20.69 KB[39m
|
129
129
|
[32mESM[39m [1mdist/react-core/testing.js.map [22m[32m1.82 KB[39m
|
130
130
|
[32mESM[39m [1mdist/react-core/chunk-7DYMJ74I.js.map [22m[32m533.00 B[39m
|
131
|
-
[32mESM[39m ⚡️ Build success in
|
132
|
-
[32mESM[39m [1mdist/browser/index.js [22m[32m13.43 KB[39m
|
133
|
-
[32mESM[39m [1mdist/browser/index.js.map [22m[32m28.65 KB[39m
|
134
|
-
[32mESM[39m ⚡️ Build success in 38ms
|
131
|
+
[32mESM[39m ⚡️ Build success in 19ms
|
135
132
|
[32mESM[39m [1mdist/react-native/index.js [22m[32m2.53 KB[39m
|
136
133
|
[32mESM[39m [1mdist/react-native/testing.js [22m[32m120.00 B[39m
|
137
134
|
[32mESM[39m [1mdist/react-native/crypto.js [22m[32m117.00 B[39m
|
138
135
|
[32mESM[39m [1mdist/react-native/index.js.map [22m[32m5.68 KB[39m
|
139
136
|
[32mESM[39m [1mdist/react-native/testing.js.map [22m[32m176.00 B[39m
|
140
137
|
[32mESM[39m [1mdist/react-native/crypto.js.map [22m[32m174.00 B[39m
|
141
|
-
[32mESM[39m ⚡️ Build success in
|
142
|
-
[32mESM[39m [1mdist/
|
143
|
-
[32mESM[39m [1mdist/
|
144
|
-
[32mESM[39m
|
145
|
-
[32mESM[39m [1mdist/react/index.js.map [22m[32m34.14 KB[39m
|
146
|
-
[32mESM[39m ⚡️ Build success in 36ms
|
147
|
-
[32mESM[39m [1mdist/expo/index.js [22m[32m4.65 KB[39m
|
138
|
+
[32mESM[39m ⚡️ Build success in 20ms
|
139
|
+
[32mESM[39m [1mdist/browser/index.js [22m[32m13.43 KB[39m
|
140
|
+
[32mESM[39m [1mdist/browser/index.js.map [22m[32m28.65 KB[39m
|
141
|
+
[32mESM[39m ⚡️ Build success in 24ms
|
148
142
|
[32mESM[39m [1mdist/expo/testing.js [22m[32m112.00 B[39m
|
143
|
+
[32mESM[39m [1mdist/expo/index.js [22m[32m4.65 KB[39m
|
149
144
|
[32mESM[39m [1mdist/expo/crypto.js [22m[32m109.00 B[39m
|
150
|
-
[32mESM[39m [1mdist/expo/index.js.map [22m[32m10.17 KB[39m
|
151
|
-
[32mESM[39m [1mdist/expo/crypto.js.map [22m[32m166.00 B[39m
|
152
145
|
[32mESM[39m [1mdist/expo/testing.js.map [22m[32m168.00 B[39m
|
153
|
-
[32mESM[39m
|
146
|
+
[32mESM[39m [1mdist/expo/crypto.js.map [22m[32m166.00 B[39m
|
147
|
+
[32mESM[39m [1mdist/expo/index.js.map [22m[32m10.17 KB[39m
|
148
|
+
[32mESM[39m ⚡️ Build success in 30ms
|
149
|
+
[32mESM[39m [1mdist/react/index.js [22m[32m20.70 KB[39m
|
150
|
+
[32mESM[39m [1mdist/react/testing.js [22m[32m122.00 B[39m
|
151
|
+
[32mESM[39m [1mdist/react/index.js.map [22m[32m34.14 KB[39m
|
152
|
+
[32mESM[39m [1mdist/react/testing.js.map [22m[32m165.00 B[39m
|
153
|
+
[32mESM[39m ⚡️ Build success in 37ms
|
154
154
|
[32mESM[39m [1mdist/react-native-core/index.js [22m[32m16.95 KB[39m
|
155
155
|
[32mESM[39m [1mdist/react-native-core/testing.js [22m[32m119.00 B[39m
|
156
156
|
[32mESM[39m [1mdist/react-native-core/crypto.js [22m[32m2.10 KB[39m
|
157
157
|
[32mESM[39m [1mdist/react-native-core/index.js.map [22m[32m33.57 KB[39m
|
158
158
|
[32mESM[39m [1mdist/react-native-core/testing.js.map [22m[32m175.00 B[39m
|
159
159
|
[32mESM[39m [1mdist/react-native-core/crypto.js.map [22m[32m4.25 KB[39m
|
160
|
-
[32mESM[39m ⚡️ Build success in
|
160
|
+
[32mESM[39m ⚡️ Build success in 36ms
|
161
161
|
[32mESM[39m [1mdist/prosemirror/index.js [22m[32m76.90 KB[39m
|
162
162
|
[32mESM[39m [1mdist/prosemirror/index.js.map [22m[32m305.53 KB[39m
|
163
|
-
[32mESM[39m ⚡️ Build success in
|
163
|
+
[32mESM[39m ⚡️ Build success in 39ms
|
164
164
|
[32mESM[39m [1mdist/inspector/index.js [22m[32m60.37 KB[39m
|
165
165
|
[32mESM[39m [1mdist/inspector/index.js.map [22m[32m107.85 KB[39m
|
166
|
-
[32mESM[39m ⚡️ Build success in
|
166
|
+
[32mESM[39m ⚡️ Build success in 52ms
|
167
167
|
[32mESM[39m [1mdist/testing.js [22m[32m6.76 KB[39m
|
168
168
|
[32mESM[39m [1mdist/index.js [22m[32m26.00 KB[39m
|
169
|
-
[32mESM[39m [1mdist/chunk-
|
169
|
+
[32mESM[39m [1mdist/chunk-H3BIFFQG.js [22m[32m151.06 KB[39m
|
170
170
|
[32mESM[39m [1mdist/testing.js.map [22m[32m13.06 KB[39m
|
171
171
|
[32mESM[39m [1mdist/index.js.map [22m[32m52.65 KB[39m
|
172
|
-
[32mESM[39m [1mdist/chunk-
|
173
|
-
[32mESM[39m ⚡️ Build success in
|
172
|
+
[32mESM[39m [1mdist/chunk-H3BIFFQG.js.map [22m[32m362.50 KB[39m
|
173
|
+
[32mESM[39m ⚡️ Build success in 69ms
|
174
174
|
[32mESM[39m [1mdist/inspector/register-custom-element.js [22m[32m218.00 B[39m
|
175
175
|
[32mESM[39m [1mdist/inspector/register-custom-element.js.map [22m[32m314.00 B[39m
|
176
176
|
[32mESM[39m [1mdist/inspector/custom-element-TUXKXSZU.js [22m[32m1.53 MB[39m
|
177
177
|
[32mESM[39m [1mdist/inspector/custom-element-TUXKXSZU.js.map [22m[32m2.35 MB[39m
|
178
|
-
[32mESM[39m ⚡️ Build success in
|
178
|
+
[32mESM[39m ⚡️ Build success in 107ms
|
179
179
|
|
180
|
-
> jazz-tools@0.16.
|
180
|
+
> jazz-tools@0.16.5 types /home/runner/_work/jazz/jazz/packages/jazz-tools
|
181
181
|
> tsc --outDir dist
|
182
182
|
|
183
183
|
|
184
|
-
> jazz-tools@0.16.
|
184
|
+
> jazz-tools@0.16.5 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
|
185
185
|
> rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
|
186
186
|
|
187
187
|
src/svelte -> dist/svelte
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,34 @@
|
|
1
1
|
# jazz-tools
|
2
2
|
|
3
|
+
## 0.16.5
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 3cd1586: Makes the key rotation not fail when child groups are unavailable or their readkey is not accessible.
|
8
|
+
|
9
|
+
Also changes the Group.removeMember method to not return a Promise, because:
|
10
|
+
|
11
|
+
- All the locally available child groups are rotated immediately
|
12
|
+
- All the remote child groups are rotated in background, but since they are not locally available the user won't need the new key immediately
|
13
|
+
|
14
|
+
- 33ebbf0: Fix error when using nested discriminatedUnion
|
15
|
+
- Updated dependencies [3cd1586]
|
16
|
+
- Updated dependencies [267f689]
|
17
|
+
- cojson@0.16.5
|
18
|
+
- cojson-storage-indexeddb@0.16.5
|
19
|
+
- cojson-transport-ws@0.16.5
|
20
|
+
|
21
|
+
## 0.16.4
|
22
|
+
|
23
|
+
### Patch Changes
|
24
|
+
|
25
|
+
- 16764f6: Added `pick()` and `partial()` methods to CoMapSchema
|
26
|
+
- Updated dependencies [f9d538f]
|
27
|
+
- Updated dependencies [802b5a3]
|
28
|
+
- cojson@0.16.4
|
29
|
+
- cojson-storage-indexeddb@0.16.4
|
30
|
+
- cojson-transport-ws@0.16.4
|
31
|
+
|
3
32
|
## 0.16.3
|
4
33
|
|
5
34
|
### Patch Changes
|
@@ -118,11 +118,6 @@ function isAnyCoValueSchema(schema) {
|
|
118
118
|
return "collaborative" in schema && schema.collaborative === true;
|
119
119
|
}
|
120
120
|
|
121
|
-
// src/tools/coValues/interfaces.ts
|
122
|
-
import {
|
123
|
-
emptyKnownState
|
124
|
-
} from "cojson";
|
125
|
-
|
126
121
|
// src/tools/coValues/CoValueBase.ts
|
127
122
|
import { ControlledAccount, RawAccount } from "cojson";
|
128
123
|
var CoValueBase = class {
|
@@ -2095,7 +2090,7 @@ var _Group = class _Group extends CoValueBase {
|
|
2095
2090
|
}
|
2096
2091
|
removeMember(member) {
|
2097
2092
|
if (member !== "everyone" && member._type === "Group") {
|
2098
|
-
|
2093
|
+
this._raw.revokeExtend(member._raw);
|
2099
2094
|
} else {
|
2100
2095
|
return this._raw.removeMember(
|
2101
2096
|
member === "everyone" ? member : member._raw
|
@@ -4063,6 +4058,33 @@ function enrichCoMapSchema(schema, coValueClass) {
|
|
4063
4058
|
},
|
4064
4059
|
optional: () => {
|
4065
4060
|
return coOptionalDefiner(coValueSchema);
|
4061
|
+
},
|
4062
|
+
pick: (keys) => {
|
4063
|
+
const keysSet = new Set(Object.keys(keys));
|
4064
|
+
const pickedShape = {};
|
4065
|
+
for (const [key, value] of Object.entries(coValueSchema.shape)) {
|
4066
|
+
if (keysSet.has(key)) {
|
4067
|
+
pickedShape[key] = value;
|
4068
|
+
}
|
4069
|
+
}
|
4070
|
+
return coMapDefiner(pickedShape);
|
4071
|
+
},
|
4072
|
+
partial: () => {
|
4073
|
+
const partialShape = {};
|
4074
|
+
for (const [key, value] of Object.entries(coValueSchema.shape)) {
|
4075
|
+
if (isAnyCoValueSchema2(value)) {
|
4076
|
+
partialShape[key] = coOptionalDefiner(value);
|
4077
|
+
} else {
|
4078
|
+
partialShape[key] = z.optional(coValueSchema.shape[key]);
|
4079
|
+
}
|
4080
|
+
}
|
4081
|
+
const partialCoMapSchema = coMapDefiner(partialShape);
|
4082
|
+
if (coValueSchema.catchAll) {
|
4083
|
+
return partialCoMapSchema.catchall(
|
4084
|
+
coValueSchema.catchAll
|
4085
|
+
);
|
4086
|
+
}
|
4087
|
+
return partialCoMapSchema;
|
4066
4088
|
}
|
4067
4089
|
});
|
4068
4090
|
return coValueSchema;
|
@@ -4292,7 +4314,7 @@ function schemaUnionDiscriminatorFor(schema) {
|
|
4292
4314
|
continue;
|
4293
4315
|
}
|
4294
4316
|
}
|
4295
|
-
if (discriminatorDef._zod
|
4317
|
+
if (discriminatorDef._zod?.def.type !== "literal") {
|
4296
4318
|
break;
|
4297
4319
|
}
|
4298
4320
|
const literalDef = discriminatorDef._zod.def;
|
@@ -5211,8 +5233,8 @@ function loadContentPiecesFromCoValue(core2, valuesExported, contentPieces) {
|
|
5211
5233
|
loadContentPiecesFromCoValue(depCoValue, valuesExported, contentPieces);
|
5212
5234
|
}
|
5213
5235
|
}
|
5214
|
-
const pieces = core2.verified.newContentSince(
|
5215
|
-
for (const piece of pieces
|
5236
|
+
const pieces = core2.verified.newContentSince(void 0) ?? [];
|
5237
|
+
for (const piece of pieces) {
|
5216
5238
|
contentPieces.push(piece);
|
5217
5239
|
}
|
5218
5240
|
}
|
@@ -5265,4 +5287,4 @@ export {
|
|
5265
5287
|
JazzContextManager
|
5266
5288
|
};
|
5267
5289
|
/* istanbul ignore file -- @preserve */
|
5268
|
-
//# sourceMappingURL=chunk-
|
5290
|
+
//# sourceMappingURL=chunk-H3BIFFQG.js.map
|