@rebasepro/common 0.0.1-canary.2 → 0.0.1-canary.4d4fb3e

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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/collections/CollectionRegistry.d.ts +2 -2
  3. package/dist/data/buildRebaseData.d.ts +14 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.es.js +398 -815
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/index.umd.js +418 -835
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/util/builders.d.ts +6 -13
  10. package/dist/util/collections.d.ts +2 -2
  11. package/dist/util/entities.d.ts +16 -8
  12. package/dist/util/index.d.ts +1 -11
  13. package/dist/util/navigation_from_path.d.ts +10 -5
  14. package/dist/util/navigation_utils.d.ts +1 -12
  15. package/dist/util/permissions.d.ts +4 -4
  16. package/dist/util/references.d.ts +1 -1
  17. package/dist/util/relations.d.ts +4 -4
  18. package/dist/util/resolutions.d.ts +10 -12
  19. package/dist/util/storage.d.ts +4 -4
  20. package/package.json +11 -16
  21. package/src/collections/CollectionRegistry.ts +96 -33
  22. package/src/data/buildRebaseData.ts +221 -0
  23. package/src/index.ts +1 -0
  24. package/src/types/json-logic-js.d.ts +8 -0
  25. package/src/util/builders.ts +8 -18
  26. package/src/util/callbacks.ts +3 -4
  27. package/src/util/collections.ts +4 -4
  28. package/src/util/conditions.ts +4 -4
  29. package/src/util/entities.ts +37 -12
  30. package/src/util/index.ts +1 -11
  31. package/src/util/navigation_from_path.ts +8 -7
  32. package/src/util/navigation_utils.ts +4 -56
  33. package/src/util/parent_references_from_path.ts +1 -1
  34. package/src/util/permissions.test.ts +24 -28
  35. package/src/util/permissions.ts +14 -14
  36. package/src/util/references.ts +16 -2
  37. package/src/util/relations.ts +23 -19
  38. package/src/util/resolutions.ts +31 -62
  39. package/src/util/storage.ts +5 -5
  40. package/dist/util/arrays.d.ts +0 -1
  41. package/dist/util/dates.d.ts +0 -1
  42. package/dist/util/entity_actions.d.ts +0 -2
  43. package/dist/util/fields.d.ts +0 -2
  44. package/dist/util/flatten_object.d.ts +0 -5
  45. package/dist/util/hash.d.ts +0 -1
  46. package/dist/util/names.d.ts +0 -22
  47. package/dist/util/objects.d.ts +0 -26
  48. package/dist/util/os.d.ts +0 -2
  49. package/dist/util/plurals.d.ts +0 -16
  50. package/dist/util/regexp.d.ts +0 -7
  51. package/dist/util/strings.d.ts +0 -7
  52. package/src/util/arrays.ts +0 -3
  53. package/src/util/dates.ts +0 -1
  54. package/src/util/entity_actions.ts +0 -28
  55. package/src/util/fields.ts +0 -28
  56. package/src/util/flatten_object.ts +0 -45
  57. package/src/util/hash.ts +0 -11
  58. package/src/util/names.ts +0 -30
  59. package/src/util/objects.ts +0 -376
  60. package/src/util/os.ts +0 -13
  61. package/src/util/plurals.ts +0 -188
  62. package/src/util/regexp.ts +0 -32
  63. package/src/util/strings.ts +0 -84
package/README.md CHANGED
@@ -138,7 +138,7 @@ You can replace the Firebase Storage implementation with your own.
138
138
  ## Included example
139
139
 
140
140
  You can access the code for the demo project under
141
- [`example`](https://github.com/Rebaseco/rebase/tree/master/example). It includes
141
+ [`example`](https://github.com/rebasepro/rebase/tree/master/example). It includes
142
142
  every feature provided by this CMS.
143
143
 
144
144
  Keep in mind you need to update the dependencies in that project if you want to
@@ -1,9 +1,9 @@
1
1
  import { EntityCollection } from "@rebasepro/types";
2
2
  export declare class CollectionRegistry {
3
- private collectionsByDbPath;
3
+ private collectionsByTableName;
4
4
  private collectionsBySlug;
5
5
  private rootCollections;
6
- private rawCollectionsByDbPath;
6
+ private rawCollectionsByTableName;
7
7
  private rawCollectionsBySlug;
8
8
  private rawRootCollections;
9
9
  private lastRawInputSnapshot;
@@ -0,0 +1,14 @@
1
+ import { DataDriver, RebaseData } from "@rebasepro/types";
2
+ /**
3
+ * Build a `RebaseData` object from a `DataDriver` using JavaScript Proxy.
4
+ *
5
+ * This is the key bridge: any property access like `data.products` returns
6
+ * a `CollectionAccessor` backed by the underlying DataDriver, without
7
+ * needing per-collection code generation.
8
+ *
9
+ * @example
10
+ * const data = buildRebaseData(driver);
11
+ * await data.products.create({ name: "Camera", price: 299 });
12
+ * const { data: items } = await data.products.find({ where: { status: "eq.published" } });
13
+ */
14
+ export declare function buildRebaseData(driver: DataDriver): RebaseData;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./util";
2
2
  export * from "./collections";
3
+ export * from "./data/buildRebaseData";