jazz-tools 0.20.0 → 0.20.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 (39) hide show
  1. package/.turbo/turbo-build.log +38 -38
  2. package/CHANGELOG.md +11 -0
  3. package/dist/{chunk-3CAPPS2F.js → chunk-2OPP7KWV.js} +149 -74
  4. package/dist/chunk-2OPP7KWV.js.map +1 -0
  5. package/dist/chunk-ZQWSQH6L.js +20 -0
  6. package/dist/index.js +2 -2
  7. package/dist/testing.js +2 -2
  8. package/dist/tools/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -1
  9. package/dist/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts +2 -1
  10. package/dist/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +1 -1
  11. package/dist/tools/implementation/zodSchema/schemaTypes/CoListSchema.d.ts +2 -1
  12. package/dist/tools/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +1 -1
  13. package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +2 -1
  14. package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -1
  15. package/dist/tools/implementation/zodSchema/schemaTypes/CoVectorSchema.d.ts +3 -1
  16. package/dist/tools/implementation/zodSchema/schemaTypes/CoVectorSchema.d.ts.map +1 -1
  17. package/dist/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts +3 -1
  18. package/dist/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +1 -1
  19. package/dist/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts +2 -1
  20. package/dist/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +1 -1
  21. package/dist/tools/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts +6 -1
  22. package/dist/tools/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +1 -1
  23. package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -1
  24. package/dist/tools/ssr.js +1 -1
  25. package/package.json +4 -4
  26. package/src/tools/coValues/coList.ts +73 -37
  27. package/src/tools/implementation/zodSchema/schemaTypes/AccountSchema.ts +0 -2
  28. package/src/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.ts +5 -2
  29. package/src/tools/implementation/zodSchema/schemaTypes/CoListSchema.ts +5 -2
  30. package/src/tools/implementation/zodSchema/schemaTypes/CoMapSchema.ts +5 -2
  31. package/src/tools/implementation/zodSchema/schemaTypes/CoVectorSchema.ts +6 -2
  32. package/src/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.ts +6 -2
  33. package/src/tools/implementation/zodSchema/schemaTypes/PlainTextSchema.ts +5 -2
  34. package/src/tools/implementation/zodSchema/schemaTypes/RichTextSchema.ts +9 -2
  35. package/src/tools/tests/coList.test.ts +262 -0
  36. package/src/tools/tests/schema.withPermissions.test.ts +27 -4
  37. package/dist/chunk-3CAPPS2F.js.map +0 -1
  38. package/dist/chunk-PZ5AY32C.js +0 -10
  39. /package/dist/{chunk-PZ5AY32C.js.map → chunk-ZQWSQH6L.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.20.0 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.20.1 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types && pnpm build:svelte && pnpm build:better-auth-svelte
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts","tools/ssr":"src/tools/ssr/index.ts"}
@@ -107,9 +107,16 @@
107
107
  ESM Build start
108
108
  CLI Cleaning output folder
109
109
  ESM Build start
110
+ ESM dist/better-auth/auth/client.js 4.54 KB
111
+ ESM dist/better-auth/auth/server.js 8.40 KB
112
+ ESM dist/better-auth/auth/react.js 813.00 B
113
+ ESM dist/better-auth/auth/client.js.map 8.44 KB
114
+ ESM dist/better-auth/auth/server.js.map 15.40 KB
115
+ ESM dist/better-auth/auth/react.js.map 2.07 KB
116
+ ESM ⚡️ Build success in 24ms
110
117
  ESM dist/tiptap/index.js 564.00 B
111
118
  ESM dist/tiptap/index.js.map 1.21 KB
112
- ESM ⚡️ Build success in 34ms
119
+ ESM ⚡️ Build success in 32ms
113
120
  ESM dist/worker/index.js 3.45 KB
114
121
  ESM dist/worker/edge-wasm.js 259.00 B
115
122
  ESM dist/worker/napi-crypto.js 110.00 B
@@ -127,56 +134,49 @@
127
134
  ESM dist/media/index.native.js.map 8.17 KB
128
135
  ESM dist/media/index.server.js.map 6.37 KB
129
136
  ESM dist/media/chunk-IRL3KNPO.js.map 17.00 KB
130
- ESM ⚡️ Build success in 37ms
131
- ESM dist/better-auth/auth/client.js 4.54 KB
132
- ESM dist/better-auth/auth/server.js 8.40 KB
133
- ESM dist/better-auth/auth/react.js 813.00 B
134
- ESM dist/better-auth/auth/client.js.map 8.44 KB
135
- ESM dist/better-auth/auth/server.js.map 15.40 KB
136
- ESM dist/better-auth/auth/react.js.map 2.07 KB
137
- ESM ⚡️ Build success in 32ms
137
+ ESM ⚡️ Build success in 39ms
138
138
  ESM dist/expo/index.js 4.70 KB
139
139
  ESM dist/expo/testing.js 112.00 B
140
140
  ESM dist/expo/polyfills.js 858.00 B
141
141
  ESM dist/expo/index.js.map 10.26 KB
142
142
  ESM dist/expo/testing.js.map 168.00 B
143
143
  ESM dist/expo/polyfills.js.map 1.61 KB
144
- ESM ⚡️ Build success in 39ms
144
+ ESM ⚡️ Build success in 33ms
145
145
  ESM dist/react-core/index.js 17.38 KB
146
146
  ESM dist/react-core/testing.js 904.00 B
147
147
  ESM dist/react-core/chunk-UOYH6JFJ.js 189.00 B
148
148
  ESM dist/react-core/index.js.map 57.66 KB
149
149
  ESM dist/react-core/testing.js.map 1.34 KB
150
150
  ESM dist/react-core/chunk-UOYH6JFJ.js.map 363.00 B
151
- ESM ⚡️ Build success in 49ms
152
- ESM dist/browser/index.js 15.96 KB
153
- ESM dist/browser/index.js.map 34.06 KB
154
- ESM ⚡️ Build success in 61ms
151
+ ESM ⚡️ Build success in 56ms
155
152
  ESM dist/prosemirror/index.js 77.76 KB
156
153
  ESM dist/prosemirror/index.js.map 307.20 KB
157
- ESM ⚡️ Build success in 63ms
154
+ ESM ⚡️ Build success in 57ms
158
155
  ESM dist/better-auth/database-adapter/index.js 26.65 KB
159
156
  ESM dist/better-auth/database-adapter/index.js.map 58.27 KB
160
- ESM ⚡️ Build success in 53ms
161
- ESM dist/react/testing.js 122.00 B
157
+ ESM ⚡️ Build success in 47ms
158
+ ESM dist/browser/index.js 15.96 KB
159
+ ESM dist/browser/index.js.map 34.06 KB
160
+ ESM ⚡️ Build success in 61ms
161
+ ESM dist/react-native-core/index.js 34.14 KB
162
+ ESM dist/react-native-core/testing.js 119.00 B
163
+ ESM dist/react-native-core/index.js.map 68.45 KB
164
+ ESM dist/react-native-core/testing.js.map 175.00 B
165
+ ESM ⚡️ Build success in 63ms
162
166
  ESM dist/react/index.js 26.02 KB
167
+ ESM dist/react/testing.js 122.00 B
163
168
  ESM dist/react/ssr.js 693.00 B
169
+ ESM dist/react/index.js.map 55.45 KB
164
170
  ESM dist/react/testing.js.map 165.00 B
165
171
  ESM dist/react/ssr.js.map 1.10 KB
166
- ESM dist/react/index.js.map 55.45 KB
167
172
  ESM ⚡️ Build success in 62ms
168
- ESM dist/react-native-core/index.js 34.14 KB
169
- ESM dist/react-native-core/testing.js 119.00 B
170
- ESM dist/react-native-core/index.js.map 68.45 KB
171
- ESM dist/react-native-core/testing.js.map 175.00 B
172
- ESM ⚡️ Build success in 70ms
173
- ESM dist/react-native/polyfills.js 858.00 B
174
173
  ESM dist/react-native/index.js 36.68 KB
175
174
  ESM dist/react-native/testing.js 120.00 B
175
+ ESM dist/react-native/polyfills.js 858.00 B
176
176
  ESM dist/react-native/index.js.map 74.00 KB
177
- ESM dist/react-native/polyfills.js.map 1.61 KB
178
177
  ESM dist/react-native/testing.js.map 176.00 B
179
- ESM ⚡️ Build success in 76ms
178
+ ESM dist/react-native/polyfills.js.map 1.61 KB
179
+ ESM ⚡️ Build success in 75ms
180
180
  ESM dist/inspector/index.js 6.30 KB
181
181
  ESM dist/inspector/standalone.js 12.61 KB
182
182
  ESM dist/inspector/chunk-MCTB5ZJC.js 127.21 KB
@@ -186,33 +186,33 @@
186
186
  ESM ⚡️ Build success in 86ms
187
187
  ESM dist/index.js 32.17 KB
188
188
  ESM dist/testing.js 8.56 KB
189
- ESM dist/chunk-3CAPPS2F.js 232.60 KB
189
+ ESM dist/chunk-2OPP7KWV.js 234.52 KB
190
190
  ESM dist/tools/ssr.js 156.00 B
191
191
  ESM dist/chunk-K4D7IMFM.js 690.00 B
192
- ESM dist/chunk-PZ5AY32C.js 233.00 B
192
+ ESM dist/chunk-ZQWSQH6L.js 945.00 B
193
193
  ESM dist/index.js.map 65.34 KB
194
194
  ESM dist/testing.js.map 16.22 KB
195
- ESM dist/chunk-K4D7IMFM.js.map 1.10 KB
196
195
  ESM dist/tools/ssr.js.map 71.00 B
197
- ESM dist/chunk-PZ5AY32C.js.map 71.00 B
198
- ESM dist/chunk-3CAPPS2F.js.map 548.44 KB
199
- ESM ⚡️ Build success in 104ms
196
+ ESM dist/chunk-K4D7IMFM.js.map 1.10 KB
197
+ ESM dist/chunk-ZQWSQH6L.js.map 71.00 B
198
+ ESM dist/chunk-2OPP7KWV.js.map 550.64 KB
199
+ ESM ⚡️ Build success in 108ms
200
200
  ESM dist/inspector/register-custom-element.js 218.00 B
201
- ESM dist/inspector/register-custom-element.js.map 314.00 B
202
201
  ESM dist/inspector/custom-element-5YWVZBWA.js 1.60 MB
202
+ ESM dist/inspector/register-custom-element.js.map 314.00 B
203
203
  ESM dist/inspector/custom-element-5YWVZBWA.js.map 2.47 MB
204
- ESM ⚡️ Build success in 144ms
204
+ ESM ⚡️ Build success in 140ms
205
205
 
206
- > jazz-tools@0.20.0 types /home/runner/_work/jazz/jazz/packages/jazz-tools
206
+ > jazz-tools@0.20.1 types /home/runner/_work/jazz/jazz/packages/jazz-tools
207
207
  > tsc --outDir dist
208
208
 
209
209
 
210
- > jazz-tools@0.20.0 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
210
+ > jazz-tools@0.20.1 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
211
211
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
212
212
 
213
213
  src/svelte -> dist/svelte
214
214
 
215
- > jazz-tools@0.20.0 build:better-auth-svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
215
+ > jazz-tools@0.20.1 build:better-auth-svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
216
216
  > mkdir -p dist/better-auth/auth && svelte-package -i src/better-auth/auth -o dist/better-auth/auth-temp --tsconfig tsconfig.svelte.json && cp dist/better-auth/auth-temp/svelte.svelte dist/better-auth/auth/svelte.svelte && cp dist/better-auth/auth-temp/svelte.svelte.d.ts dist/better-auth/auth/svelte.d.ts && rm -rf dist/better-auth/auth-temp
217
217
 
218
218
  src/better-auth/auth -> dist/better-auth/auth-temp
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.20.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ca306c0: Fixed `CoList` to return the correct length when calling `getOwnPropertyDescriptor` with `length`. Previously it was always returning 0.
8
+ - d7f9cba: `setDefaultSchemaPermissions` now modifies existing CoValue schemas
9
+ - Updated dependencies [03195eb]
10
+ - cojson@0.20.1
11
+ - cojson-storage-indexeddb@0.20.1
12
+ - cojson-transport-ws@0.20.1
13
+
3
14
  ## 0.20.0
4
15
 
5
16
  ### Minor Changes
@@ -1,6 +1,9 @@
1
1
  import {
2
- __export
3
- } from "./chunk-PZ5AY32C.js";
2
+ __export,
3
+ __privateAdd,
4
+ __privateGet,
5
+ __privateSet
6
+ } from "./chunk-ZQWSQH6L.js";
4
7
 
5
8
  // src/tools/implementation/zodSchema/zodReExport.ts
6
9
  var zodReExport_exports = {};
@@ -1279,7 +1282,7 @@ var CoListJazzApi = class extends CoValueJazzApi {
1279
1282
  void 0,
1280
1283
  "private"
1281
1284
  );
1282
- return this.raw.entries().length;
1285
+ return this.raw.length();
1283
1286
  }
1284
1287
  /**
1285
1288
  * Inserts new elements at the start of an array, and returns the new length of the array.
@@ -1295,7 +1298,7 @@ var CoListJazzApi = class extends CoValueJazzApi {
1295
1298
  )) {
1296
1299
  this.raw.prepend(item);
1297
1300
  }
1298
- return this.raw.entries().length;
1301
+ return this.raw.length();
1299
1302
  }
1300
1303
  /**
1301
1304
  * Removes the last element from an array and returns it.
@@ -1527,40 +1530,60 @@ function toRawItems(items, itemDescriptor, owner) {
1527
1530
  }
1528
1531
  return rawItems;
1529
1532
  }
1533
+ function getCoListItemValue(target, key) {
1534
+ const rawValue = target.$jazz.raw.get(Number(key));
1535
+ if (rawValue === void 0) {
1536
+ return void 0;
1537
+ }
1538
+ const itemDescriptor = target.$jazz.schema[ItemsSym];
1539
+ if (itemDescriptor === "json") {
1540
+ return rawValue;
1541
+ } else if ("encoded" in itemDescriptor) {
1542
+ return itemDescriptor.encoded.decode(rawValue);
1543
+ } else if (isRefEncoded(itemDescriptor)) {
1544
+ if (rawValue === null) {
1545
+ return void 0;
1546
+ }
1547
+ return accessChildByKey(target, rawValue, key);
1548
+ }
1549
+ return void 0;
1550
+ }
1530
1551
  var CoListProxyHandler = {
1531
1552
  get(target, key, receiver) {
1532
- if (typeof key === "string" && !isNaN(+key)) {
1533
- const itemDescriptor = target.$jazz.schema[ItemsSym];
1534
- const rawValue = target.$jazz.raw.get(Number(key));
1535
- if (itemDescriptor === "json") {
1536
- return rawValue;
1537
- } else if ("encoded" in itemDescriptor) {
1538
- return rawValue === void 0 ? void 0 : itemDescriptor.encoded.decode(rawValue);
1539
- } else if (isRefEncoded(itemDescriptor)) {
1540
- return rawValue === void 0 || rawValue === null ? void 0 : accessChildByKey(target, rawValue, key);
1541
- }
1542
- } else if (key === "length") {
1543
- return target.$jazz.raw.entries().length;
1544
- } else {
1553
+ if (typeof key === "symbol") {
1545
1554
  return Reflect.get(target, key, receiver);
1546
1555
  }
1556
+ if (!isNaN(+key)) {
1557
+ return getCoListItemValue(target, key);
1558
+ } else if (key === "length") {
1559
+ return target.$jazz.raw.length();
1560
+ }
1561
+ return Reflect.get(target, key, receiver);
1547
1562
  },
1548
1563
  set(target, key, value, receiver) {
1564
+ if (typeof key === "symbol") {
1565
+ return Reflect.set(target, key, value, receiver);
1566
+ }
1549
1567
  if (key === ItemsSym && typeof value === "object" && SchemaInit in value) {
1550
- target.constructor._schema ||= {};
1551
- target.constructor._schema[ItemsSym] = value[SchemaInit];
1568
+ const constructor = target.constructor;
1569
+ if (!constructor._schema) {
1570
+ constructor._schema = {};
1571
+ }
1572
+ constructor._schema[ItemsSym] = value[SchemaInit];
1552
1573
  return true;
1553
1574
  }
1554
- if (typeof key === "string" && !isNaN(+key)) {
1575
+ if (!isNaN(+key)) {
1555
1576
  throw Error("Cannot update a CoList directly. Use `$jazz.set` instead.");
1556
- } else {
1557
- return Reflect.set(target, key, value, receiver);
1558
1577
  }
1578
+ return Reflect.set(target, key, value, receiver);
1559
1579
  },
1560
1580
  defineProperty(target, key, descriptor) {
1561
1581
  if (descriptor.value && key === ItemsSym && typeof descriptor.value === "object" && SchemaInit in descriptor.value) {
1562
- target.constructor._schema ||= {};
1563
- target.constructor._schema[ItemsSym] = descriptor.value[SchemaInit];
1582
+ const constructor = target.constructor;
1583
+ if (!constructor._schema) {
1584
+ constructor._schema = {};
1585
+ }
1586
+ constructor._schema[ItemsSym] = descriptor.value[SchemaInit];
1564
1587
  return true;
1565
1588
  } else {
1566
1589
  return Reflect.defineProperty(target, key, descriptor);
@@ -1568,18 +1591,23 @@ var CoListProxyHandler = {
1568
1591
  },
1569
1592
  has(target, key) {
1570
1593
  if (typeof key === "string" && !isNaN(+key)) {
1571
- return Number(key) < target.$jazz.raw.entries().length;
1594
+ return Number(key) < target.$jazz.raw.length();
1572
1595
  } else {
1573
1596
  return Reflect.has(target, key);
1574
1597
  }
1575
1598
  },
1576
1599
  ownKeys(target) {
1577
1600
  const keys = Reflect.ownKeys(target);
1578
- const indexKeys = target.$jazz.raw.entries().map((_entry, i) => String(i));
1579
- keys.push(...indexKeys);
1601
+ const length = target.$jazz.raw.length();
1602
+ for (let i = 0; i < length; i++) {
1603
+ keys.push(String(i));
1604
+ }
1580
1605
  return keys;
1581
1606
  },
1582
1607
  getOwnPropertyDescriptor(target, key) {
1608
+ if (typeof key === "symbol") {
1609
+ return Reflect.getOwnPropertyDescriptor(target, key);
1610
+ }
1583
1611
  if (key === TypeSym) {
1584
1612
  return {
1585
1613
  enumerable: false,
@@ -1587,24 +1615,26 @@ var CoListProxyHandler = {
1587
1615
  writable: false,
1588
1616
  value: target[TypeSym]
1589
1617
  };
1590
- } else if (key in target) {
1591
- return Reflect.getOwnPropertyDescriptor(target, key);
1592
- } else if (typeof key === "string" && !isNaN(+key)) {
1618
+ } else if (!isNaN(+key)) {
1593
1619
  const index = Number(key);
1594
- if (index >= 0 && index < target.$jazz.raw.entries().length) {
1620
+ if (index >= 0 && index < target.$jazz.raw.length()) {
1595
1621
  return {
1596
1622
  enumerable: true,
1597
1623
  configurable: true,
1598
- writable: true
1624
+ writable: false,
1625
+ value: getCoListItemValue(target, key)
1599
1626
  };
1600
1627
  }
1601
1628
  } else if (key === "length") {
1602
1629
  return {
1603
1630
  enumerable: false,
1604
1631
  configurable: false,
1605
- writable: false
1632
+ writable: true,
1633
+ // Must be writable, otherwise JS complains
1634
+ value: target.$jazz.raw.length()
1606
1635
  };
1607
1636
  }
1637
+ return Reflect.getOwnPropertyDescriptor(target, key);
1608
1638
  }
1609
1639
  };
1610
1640
 
@@ -5412,13 +5442,21 @@ function createCoreCoRichTextSchema() {
5412
5442
  resolveQuery: true
5413
5443
  };
5414
5444
  }
5415
- var RichTextSchema = class _RichTextSchema {
5445
+ var _permissions;
5446
+ var _RichTextSchema = class _RichTextSchema {
5416
5447
  constructor(coValueClass) {
5417
5448
  this.coValueClass = coValueClass;
5418
5449
  this.collaborative = true;
5419
5450
  this.builtin = "CoRichText";
5420
5451
  this.resolveQuery = true;
5421
- this.permissions = DEFAULT_SCHEMA_PERMISSIONS;
5452
+ __privateAdd(this, _permissions, null);
5453
+ }
5454
+ /**
5455
+ * Permissions to be used when creating or composing CoValues
5456
+ * @internal
5457
+ */
5458
+ get permissions() {
5459
+ return __privateGet(this, _permissions) ?? DEFAULT_SCHEMA_PERMISSIONS;
5422
5460
  }
5423
5461
  create(text, options) {
5424
5462
  const optionsWithPermissions = withSchemaPermissions(
@@ -5447,10 +5485,12 @@ var RichTextSchema = class _RichTextSchema {
5447
5485
  */
5448
5486
  withPermissions(permissions) {
5449
5487
  const copy = new _RichTextSchema(this.coValueClass);
5450
- copy.permissions = permissions;
5488
+ __privateSet(copy, _permissions, permissions);
5451
5489
  return copy;
5452
5490
  }
5453
5491
  };
5492
+ _permissions = new WeakMap();
5493
+ var RichTextSchema = _RichTextSchema;
5454
5494
 
5455
5495
  // src/tools/implementation/zodSchema/schemaTypes/GroupSchema.ts
5456
5496
  function createCoreGroupSchema() {
@@ -5624,6 +5664,7 @@ __export(coExport_exports, {
5624
5664
  });
5625
5665
 
5626
5666
  // src/tools/implementation/zodSchema/schemaTypes/CoMapSchema.ts
5667
+ var _permissions2;
5627
5668
  var CoMapSchema = class {
5628
5669
  constructor(coreSchema, coValueClass) {
5629
5670
  this.coValueClass = coValueClass;
@@ -5635,15 +5676,18 @@ var CoMapSchema = class {
5635
5676
  * @default true
5636
5677
  */
5637
5678
  this.resolveQuery = true;
5638
- /**
5639
- * Permissions to be used when creating or composing CoValues
5640
- * @internal
5641
- */
5642
- this.permissions = DEFAULT_SCHEMA_PERMISSIONS;
5679
+ __privateAdd(this, _permissions2, null);
5643
5680
  this.shape = coreSchema.shape;
5644
5681
  this.catchAll = coreSchema.catchAll;
5645
5682
  this.getDefinition = coreSchema.getDefinition;
5646
5683
  }
5684
+ /**
5685
+ * Permissions to be used when creating or composing CoValues
5686
+ * @internal
5687
+ */
5688
+ get permissions() {
5689
+ return __privateGet(this, _permissions2) ?? DEFAULT_SCHEMA_PERMISSIONS;
5690
+ }
5647
5691
  create(init, options) {
5648
5692
  const optionsWithPermissions = withSchemaPermissions(
5649
5693
  options,
@@ -5797,10 +5841,11 @@ var CoMapSchema = class {
5797
5841
  const copy = hydrateCoreCoValueSchema(coreSchema);
5798
5842
  copy.coValueClass.prototype.migrate = this.coValueClass.prototype.migrate;
5799
5843
  copy.resolveQuery = resolveQuery ?? this.resolveQuery;
5800
- copy.permissions = permissions ?? this.permissions;
5844
+ __privateSet(copy, _permissions2, permissions ?? __privateGet(this, _permissions2));
5801
5845
  return copy;
5802
5846
  }
5803
5847
  };
5848
+ _permissions2 = new WeakMap();
5804
5849
  function createCoreCoMapSchema(shape, catchAll) {
5805
5850
  return {
5806
5851
  collaborative: true,
@@ -5834,6 +5879,7 @@ function createCoreCoMapSchema(shape, catchAll) {
5834
5879
  }
5835
5880
 
5836
5881
  // src/tools/implementation/zodSchema/schemaTypes/CoListSchema.ts
5882
+ var _permissions3;
5837
5883
  var CoListSchema = class {
5838
5884
  constructor(element, coValueClass) {
5839
5885
  this.element = element;
@@ -5846,11 +5892,14 @@ var CoListSchema = class {
5846
5892
  * @default true
5847
5893
  */
5848
5894
  this.resolveQuery = true;
5849
- /**
5850
- * Permissions to be used when creating or composing CoValues
5851
- * @internal
5852
- */
5853
- this.permissions = DEFAULT_SCHEMA_PERMISSIONS;
5895
+ __privateAdd(this, _permissions3, null);
5896
+ }
5897
+ /**
5898
+ * Permissions to be used when creating or composing CoValues
5899
+ * @internal
5900
+ */
5901
+ get permissions() {
5902
+ return __privateGet(this, _permissions3) ?? DEFAULT_SCHEMA_PERMISSIONS;
5854
5903
  }
5855
5904
  create(items, options) {
5856
5905
  const optionsWithPermissions = withSchemaPermissions(
@@ -5936,10 +5985,11 @@ var CoListSchema = class {
5936
5985
  const coreSchema = createCoreCoListSchema(this.element);
5937
5986
  const copy = hydrateCoreCoValueSchema(coreSchema);
5938
5987
  copy.resolveQuery = resolveQuery ?? this.resolveQuery;
5939
- copy.permissions = permissions ?? this.permissions;
5988
+ __privateSet(copy, _permissions3, permissions ?? __privateGet(this, _permissions3));
5940
5989
  return copy;
5941
5990
  }
5942
5991
  };
5992
+ _permissions3 = new WeakMap();
5943
5993
  function createCoreCoListSchema(element) {
5944
5994
  return {
5945
5995
  collaborative: true,
@@ -5950,6 +6000,7 @@ function createCoreCoListSchema(element) {
5950
6000
  }
5951
6001
 
5952
6002
  // src/tools/implementation/zodSchema/schemaTypes/CoFeedSchema.ts
6003
+ var _permissions4;
5953
6004
  var CoFeedSchema = class {
5954
6005
  constructor(element, coValueClass) {
5955
6006
  this.element = element;
@@ -5962,11 +6013,14 @@ var CoFeedSchema = class {
5962
6013
  * @default true
5963
6014
  */
5964
6015
  this.resolveQuery = true;
5965
- /**
5966
- * Permissions to be used when creating or composing CoValues
5967
- * @internal
5968
- */
5969
- this.permissions = DEFAULT_SCHEMA_PERMISSIONS;
6016
+ __privateAdd(this, _permissions4, null);
6017
+ }
6018
+ /**
6019
+ * Permissions to be used when creating or composing CoValues
6020
+ * @internal
6021
+ */
6022
+ get permissions() {
6023
+ return __privateGet(this, _permissions4) ?? DEFAULT_SCHEMA_PERMISSIONS;
5970
6024
  }
5971
6025
  create(init, options) {
5972
6026
  const optionsWithPermissions = withSchemaPermissions(
@@ -6034,10 +6088,11 @@ var CoFeedSchema = class {
6034
6088
  const coreSchema = createCoreCoFeedSchema(this.element);
6035
6089
  const copy = hydrateCoreCoValueSchema(coreSchema);
6036
6090
  copy.resolveQuery = resolveQuery ?? this.resolveQuery;
6037
- copy.permissions = permissions ?? this.permissions;
6091
+ __privateSet(copy, _permissions4, permissions ?? __privateGet(this, _permissions4));
6038
6092
  return copy;
6039
6093
  }
6040
6094
  };
6095
+ _permissions4 = new WeakMap();
6041
6096
  function createCoreCoFeedSchema(element) {
6042
6097
  return {
6043
6098
  collaborative: true,
@@ -6055,17 +6110,21 @@ function createCoreCoPlainTextSchema() {
6055
6110
  resolveQuery: true
6056
6111
  };
6057
6112
  }
6058
- var PlainTextSchema = class _PlainTextSchema {
6113
+ var _permissions5;
6114
+ var _PlainTextSchema = class _PlainTextSchema {
6059
6115
  constructor(coValueClass) {
6060
6116
  this.coValueClass = coValueClass;
6061
6117
  this.collaborative = true;
6062
6118
  this.builtin = "CoPlainText";
6063
6119
  this.resolveQuery = true;
6064
- /**
6065
- * Permissions to be used when creating or composing CoValues
6066
- * @internal
6067
- */
6068
- this.permissions = DEFAULT_SCHEMA_PERMISSIONS;
6120
+ __privateAdd(this, _permissions5, null);
6121
+ }
6122
+ /**
6123
+ * Permissions to be used when creating or composing CoValues
6124
+ * @internal
6125
+ */
6126
+ get permissions() {
6127
+ return __privateGet(this, _permissions5) ?? DEFAULT_SCHEMA_PERMISSIONS;
6069
6128
  }
6070
6129
  create(text, options) {
6071
6130
  const optionsWithPermissions = withSchemaPermissions(
@@ -6097,10 +6156,12 @@ var PlainTextSchema = class _PlainTextSchema {
6097
6156
  */
6098
6157
  withPermissions(permissions) {
6099
6158
  const copy = new _PlainTextSchema(this.coValueClass);
6100
- copy.permissions = permissions;
6159
+ __privateSet(copy, _permissions5, permissions);
6101
6160
  return copy;
6102
6161
  }
6103
6162
  };
6163
+ _permissions5 = new WeakMap();
6164
+ var PlainTextSchema = _PlainTextSchema;
6104
6165
 
6105
6166
  // src/tools/implementation/zodSchema/schemaTypes/FileStreamSchema.ts
6106
6167
  function createCoreFileStreamSchema() {
@@ -6110,16 +6171,21 @@ function createCoreFileStreamSchema() {
6110
6171
  resolveQuery: true
6111
6172
  };
6112
6173
  }
6113
- var FileStreamSchema = class _FileStreamSchema {
6174
+ var _permissions6;
6175
+ var _FileStreamSchema = class _FileStreamSchema {
6114
6176
  constructor(coValueClass) {
6115
6177
  this.coValueClass = coValueClass;
6116
6178
  this.collaborative = true;
6117
6179
  this.builtin = "FileStream";
6118
6180
  this.resolveQuery = true;
6119
- /**
6120
- * Permissions to be used when creating or composing CoValues
6121
- */
6122
- this.permissions = DEFAULT_SCHEMA_PERMISSIONS;
6181
+ __privateAdd(this, _permissions6, null);
6182
+ }
6183
+ /**
6184
+ * Permissions to be used when creating or composing CoValues
6185
+ * @internal
6186
+ */
6187
+ get permissions() {
6188
+ return __privateGet(this, _permissions6) ?? DEFAULT_SCHEMA_PERMISSIONS;
6123
6189
  }
6124
6190
  create(options) {
6125
6191
  const optionsWithPermissions = withSchemaPermissions(
@@ -6170,10 +6236,12 @@ var FileStreamSchema = class _FileStreamSchema {
6170
6236
  */
6171
6237
  withPermissions(permissions) {
6172
6238
  const copy = new _FileStreamSchema(this.coValueClass);
6173
- copy.permissions = permissions;
6239
+ __privateSet(copy, _permissions6, permissions);
6174
6240
  return copy;
6175
6241
  }
6176
6242
  };
6243
+ _permissions6 = new WeakMap();
6244
+ var FileStreamSchema = _FileStreamSchema;
6177
6245
 
6178
6246
  // src/tools/implementation/zodSchema/schemaTypes/CoVectorSchema.ts
6179
6247
  function createCoreCoVectorSchema(dimensions) {
@@ -6184,17 +6252,22 @@ function createCoreCoVectorSchema(dimensions) {
6184
6252
  resolveQuery: true
6185
6253
  };
6186
6254
  }
6187
- var CoVectorSchema = class _CoVectorSchema {
6255
+ var _permissions7;
6256
+ var _CoVectorSchema = class _CoVectorSchema {
6188
6257
  constructor(dimensions, coValueClass) {
6189
6258
  this.dimensions = dimensions;
6190
6259
  this.coValueClass = coValueClass;
6191
6260
  this.collaborative = true;
6192
6261
  this.builtin = "CoVector";
6193
6262
  this.resolveQuery = true;
6194
- /**
6195
- * Permissions to be used when creating or composing CoValues
6196
- */
6197
- this.permissions = DEFAULT_SCHEMA_PERMISSIONS;
6263
+ __privateAdd(this, _permissions7, null);
6264
+ }
6265
+ /**
6266
+ * Permissions to be used when creating or composing CoValues
6267
+ * @internal
6268
+ */
6269
+ get permissions() {
6270
+ return __privateGet(this, _permissions7) ?? DEFAULT_SCHEMA_PERMISSIONS;
6198
6271
  }
6199
6272
  create(vector, options) {
6200
6273
  const optionsWithPermissions = withSchemaPermissions(
@@ -6223,10 +6296,12 @@ var CoVectorSchema = class _CoVectorSchema {
6223
6296
  */
6224
6297
  withPermissions(permissions) {
6225
6298
  const copy = new _CoVectorSchema(this.dimensions, this.coValueClass);
6226
- copy.permissions = permissions;
6299
+ __privateSet(copy, _permissions7, permissions);
6227
6300
  return copy;
6228
6301
  }
6229
6302
  };
6303
+ _permissions7 = new WeakMap();
6304
+ var CoVectorSchema = _CoVectorSchema;
6230
6305
 
6231
6306
  // src/tools/implementation/zodSchema/schemaTypes/AccountSchema.ts
6232
6307
  var AccountSchema = class _AccountSchema {
@@ -8010,4 +8085,4 @@ export {
8010
8085
  JazzContextManager
8011
8086
  };
8012
8087
  /* istanbul ignore file -- @preserve */
8013
- //# sourceMappingURL=chunk-3CAPPS2F.js.map
8088
+ //# sourceMappingURL=chunk-2OPP7KWV.js.map