jazz-tools 0.18.0 → 0.18.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 (46) hide show
  1. package/.turbo/turbo-build.log +54 -40
  2. package/CHANGELOG.md +10 -0
  3. package/dist/better-auth/auth/client.d.ts +29 -0
  4. package/dist/better-auth/auth/client.d.ts.map +1 -0
  5. package/dist/better-auth/auth/client.js +127 -0
  6. package/dist/better-auth/auth/client.js.map +1 -0
  7. package/dist/better-auth/auth/react.d.ts +2170 -0
  8. package/dist/better-auth/auth/react.d.ts.map +1 -0
  9. package/dist/better-auth/auth/react.js +40 -0
  10. package/dist/better-auth/auth/react.js.map +1 -0
  11. package/dist/better-auth/auth/server.d.ts +14 -0
  12. package/dist/better-auth/auth/server.d.ts.map +1 -0
  13. package/dist/better-auth/auth/server.js +198 -0
  14. package/dist/better-auth/auth/server.js.map +1 -0
  15. package/dist/better-auth/auth/tests/client.test.d.ts +2 -0
  16. package/dist/better-auth/auth/tests/client.test.d.ts.map +1 -0
  17. package/dist/better-auth/auth/tests/server.test.d.ts +2 -0
  18. package/dist/better-auth/auth/tests/server.test.d.ts.map +1 -0
  19. package/dist/{chunk-HJ3GTGY7.js → chunk-IERUTUXB.js} +18 -1
  20. package/dist/chunk-IERUTUXB.js.map +1 -0
  21. package/dist/index.js +1 -1
  22. package/dist/react-core/index.js +17 -0
  23. package/dist/react-core/index.js.map +1 -1
  24. package/dist/testing.js +1 -1
  25. package/dist/tools/coValues/account.d.ts +1 -0
  26. package/dist/tools/coValues/account.d.ts.map +1 -1
  27. package/dist/tools/coValues/coMap.d.ts +10 -0
  28. package/dist/tools/coValues/coMap.d.ts.map +1 -1
  29. package/dist/tools/implementation/zodSchema/zodCo.d.ts +1 -1
  30. package/dist/tools/testing.d.ts.map +1 -1
  31. package/package.json +23 -4
  32. package/src/better-auth/auth/client.ts +169 -0
  33. package/src/better-auth/auth/react.tsx +105 -0
  34. package/src/better-auth/auth/server.ts +250 -0
  35. package/src/better-auth/auth/tests/client.test.ts +249 -0
  36. package/src/better-auth/auth/tests/server.test.ts +226 -0
  37. package/src/tools/coValues/account.ts +5 -0
  38. package/src/tools/coValues/coMap.ts +14 -0
  39. package/src/tools/implementation/zodSchema/zodCo.ts +1 -1
  40. package/src/tools/tests/ContextManager.test.ts +2 -2
  41. package/src/tools/tests/account.test.ts +51 -0
  42. package/src/tools/tests/coMap.test.ts +99 -0
  43. package/src/tools/tests/patterns/notifications.test.ts +1 -1
  44. package/src/tools/tests/testing.test.ts +2 -2
  45. package/tsup.config.ts +9 -0
  46. package/dist/chunk-HJ3GTGY7.js.map +0 -1
package/dist/index.js CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  randomSessionProvider,
38
38
  subscribeToCoValue,
39
39
  zodReExport_exports
40
- } from "./chunk-HJ3GTGY7.js";
40
+ } from "./chunk-IERUTUXB.js";
41
41
 
42
42
  // src/tools/auth/clerk/index.ts
43
43
  import {
@@ -562,6 +562,19 @@ var CoMapJazzApi = class extends CoValueJazzApi {
562
562
  get owner() {
563
563
  return getCoValueOwner(this.coMap);
564
564
  }
565
+ /**
566
+ * Check if a key is defined in the CoMap.
567
+ *
568
+ * This check does not load the referenced value or validate permissions.
569
+ *
570
+ * @param key The key to check
571
+ * @returns True if the key is defined, false otherwise
572
+ * @category Content
573
+ */
574
+ has(key) {
575
+ const entry = this.raw.getRaw(key);
576
+ return entry?.change !== void 0 && entry.change.op !== "del";
577
+ }
565
578
  /**
566
579
  * Set a value on the CoMap
567
580
  *
@@ -2385,6 +2398,10 @@ var AccountJazzApi = class extends CoValueJazzApi {
2385
2398
  this.raw.set(key, refId, "trusting");
2386
2399
  }
2387
2400
  }
2401
+ has(key) {
2402
+ const entry = this.raw.getRaw(key);
2403
+ return entry?.change !== void 0 && entry.change.op !== "del";
2404
+ }
2388
2405
  /**
2389
2406
  * Get the descriptor for a given key
2390
2407
  * @internal