@rebasepro/common 0.0.1-canary.0 → 0.0.1-canary.0e2f892

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 +3 -3
  2. package/dist/collections/CollectionRegistry.d.ts +10 -2
  3. package/dist/data/buildRebaseData.d.ts +14 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.es.js +635 -853
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/index.umd.js +653 -871
  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 +38 -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 +10 -0
  18. package/dist/util/resolutions.d.ts +11 -13
  19. package/dist/util/storage.d.ts +4 -4
  20. package/package.json +106 -113
  21. package/src/collections/CollectionRegistry.ts +220 -48
  22. package/src/data/buildRebaseData.ts +285 -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 +9 -19
  26. package/src/util/callbacks.ts +6 -6
  27. package/src/util/collections.ts +11 -8
  28. package/src/util/conditions.ts +6 -6
  29. package/src/util/entities.ts +74 -15
  30. package/src/util/index.ts +1 -11
  31. package/src/util/navigation_from_path.ts +9 -8
  32. package/src/util/navigation_utils.ts +4 -56
  33. package/src/util/parent_references_from_path.ts +4 -3
  34. package/src/util/permissions.test.ts +233 -115
  35. package/src/util/permissions.ts +26 -26
  36. package/src/util/references.ts +16 -2
  37. package/src/util/relations.ts +109 -29
  38. package/src/util/resolutions.ts +83 -83
  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
@@ -69,9 +69,9 @@ Rebase has been meticulously crafted to make it incredibly easy for developers
69
69
  to build a CMS/admin tool while offering an excellent data editing experience
70
70
  and a user-friendly interface for marketers and content managers.
71
71
 
72
- ### 🏓 Exceptional Spreadsheet View
72
+ ### 🏓 Exceptional Table View
73
73
 
74
- We've developed a highly efficient windowed **spreadsheet view** for
74
+ We've developed a highly efficient windowed **table view** for
75
75
  collections, allowing inline editing for most common fields, as well as popup
76
76
  views for other cases and your custom field implementations.
77
77
 
@@ -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,11 +1,13 @@
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 cachedCollectionsList;
7
+ private rawCollectionsByTableName;
7
8
  private rawCollectionsBySlug;
8
9
  private rawRootCollections;
10
+ private cachedRawCollectionsList;
9
11
  private lastRawInputSnapshot;
10
12
  constructor(collections?: EntityCollection[]);
11
13
  reset(): void;
@@ -21,6 +23,12 @@ export declare class CollectionRegistry {
21
23
  register(collection: EntityCollection, rawCollection?: EntityCollection): void;
22
24
  private _registerRecursively;
23
25
  normalizeCollection(collection: EntityCollection): EntityCollection;
26
+ /**
27
+ * Extract Relation[] from properties that have inline relation config (i.e. `target` is set).
28
+ * This allows developers to define relations directly on properties without a separate
29
+ * `relations[]` entry on the collection.
30
+ */
31
+ private extractRelationsFromProperties;
24
32
  private normalizeProperties;
25
33
  private normalizeProperty;
26
34
  get(path: string): EntityCollection | undefined;
@@ -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";