@marianmeres/collection-types 1.1.0 → 1.2.0

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.
@@ -59,6 +59,16 @@ export interface CollectionDTOOut extends CollectionDTOIn {
59
59
  collection_id: UUID;
60
60
  /** Project this collection belongs to */
61
61
  project_id: UUID;
62
+ /** Unique path identifier (ltree format) */
63
+ path: LtreePath;
64
+ /** Maximum number of models allowed (-1 for unlimited, default -1) */
65
+ cardinality: number;
66
+ /** Model types allowed in this collection (default ["default"]) */
67
+ types: string[];
68
+ /** JSON Schema definitions per model type */
69
+ schemas: Record<string, Record<string, PropertyDefinition>>;
70
+ /** Default values per model type */
71
+ defaults: Record<string, UserData>;
62
72
  /** Creation timestamp */
63
73
  _created_at: ISODateString;
64
74
  /** Last update timestamp */
package/dist/model.d.ts CHANGED
@@ -50,6 +50,8 @@ export interface ModelDTOOut extends ModelDTOIn {
50
50
  model_id: UUID;
51
51
  /** Collection this model belongs to */
52
52
  collection_id: UUID;
53
+ /** Model type within collection (default "default") */
54
+ type: string;
53
55
  /** Auto-generated label from schema _label_source fields */
54
56
  _label?: MaybeLocalized<string> | null;
55
57
  /** Computed label for hierarchy display */
@@ -64,6 +66,8 @@ export interface ModelDTOOut extends ModelDTOIn {
64
66
  * Includes internal fields for search indexing and REST control.
65
67
  */
66
68
  export interface ModelDbRow extends ModelDTOOut {
69
+ /** Hierarchy depth (0 = root) */
70
+ depth: number;
67
71
  /** @internal Disables REST API access */
68
72
  __is_rest_disabled: boolean;
69
73
  /** @internal Structured search index data */
@@ -48,6 +48,12 @@ export interface RelationTypeDTOIn {
48
48
  export interface RelationTypeDTOOut extends RelationTypeDTOIn {
49
49
  /** Unique relation type identifier */
50
50
  _relation_type_id: UUID;
51
+ /** Maximum number of relations allowed (-1 for unlimited, default -1) */
52
+ cardinality: number;
53
+ /** Cardinality on the model side (1 = one-to-many, -1 = many-to-many, default -1) */
54
+ model_cardinality: number;
55
+ /** Cardinality on the related side (default -1) */
56
+ related_cardinality: number;
51
57
  /** Creation timestamp */
52
58
  _created_at: ISODateString;
53
59
  /** Last update timestamp */
package/dist/utils.d.ts CHANGED
@@ -2,18 +2,12 @@
2
2
  * Utility types for the collection system.
3
3
  * Includes branded types for compile-time safety and common helper types.
4
4
  */
5
- /** Branded type for UUID strings */
6
- export type UUID = string & {
7
- readonly __brand: "UUID";
8
- };
9
- /** Branded type for ISO 8601 date strings */
10
- export type ISODateString = string & {
11
- readonly __brand: "ISODateString";
12
- };
13
- /** Branded type for PostgreSQL ltree paths */
14
- export type LtreePath = string & {
15
- readonly __brand: "LtreePath";
16
- };
5
+ /** UUID string type */
6
+ export type UUID = string;
7
+ /** ISO 8601 date string type */
8
+ export type ISODateString = string;
9
+ /** PostgreSQL ltree path type */
10
+ export type LtreePath = string;
17
11
  /** Value that may be localized with language keys */
18
12
  export type MaybeLocalized<T> = T | Record<string, T>;
19
13
  /** JSON-compatible primitive */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/collection-types",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "main": "dist/mod.js",
6
6
  "types": "dist/mod.d.ts",