@marianmeres/collection-types 2.4.0 → 2.6.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.
- package/dist/collection.d.ts +41 -0
- package/dist/model.d.ts +7 -0
- package/dist/schema.d.ts +7 -1
- package/package.json +1 -1
package/dist/collection.d.ts
CHANGED
|
@@ -62,6 +62,37 @@ export interface CollectionDTOIn {
|
|
|
62
62
|
tags?: Record<string, Record<string, TagDefinition>>;
|
|
63
63
|
/** Ownership mode for models in this collection */
|
|
64
64
|
owner_id_mode?: OwnerIdMode;
|
|
65
|
+
/**
|
|
66
|
+
* Lightweight-mode kill switch — when `false`, this collection cannot
|
|
67
|
+
* participate in relations. Defaults to `true`. **Immutable after creation.**
|
|
68
|
+
*/
|
|
69
|
+
__is_relations_enabled?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Lightweight-mode kill switch — when `false`, hierarchy machinery
|
|
72
|
+
* (`parent_id`, `__hierarchy_path`, `depth`, cycle detection) is skipped.
|
|
73
|
+
* `parent_id` in write payloads is rejected. Defaults to `true`.
|
|
74
|
+
* **Immutable after creation.**
|
|
75
|
+
*/
|
|
76
|
+
__is_hierarchy_enabled?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Lightweight-mode kill switch — when `false`, the fulltext indexing path
|
|
79
|
+
* (`__searchable`, `__searchable2`, generated tsvectors) is skipped. The
|
|
80
|
+
* `data` GIN index remains active, so `data @>` / `data ?` queries still
|
|
81
|
+
* work. Defaults to `true`. **Immutable after creation.**
|
|
82
|
+
*/
|
|
83
|
+
__is_fulltext_enabled?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* When `true`, every model created in this collection gets an auto-generated,
|
|
86
|
+
* unique-per-collection, readonly short `code` (uppercase Crockford base32).
|
|
87
|
+
* Defaults to `false`. **Immutable after creation** — retrofit an existing
|
|
88
|
+
* collection via the collection package's `ServiceMaintenance.enableCode`.
|
|
89
|
+
*/
|
|
90
|
+
__is_code_enabled?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Length of generated `code`s (uppercase Crockford base32). Defaults to 6
|
|
93
|
+
* when unset; longer values lower collision probability at scale.
|
|
94
|
+
*/
|
|
95
|
+
__code_length?: number | null;
|
|
65
96
|
}
|
|
66
97
|
/**
|
|
67
98
|
* Output DTO for collection responses.
|
|
@@ -88,6 +119,16 @@ export interface CollectionDTOOut extends CollectionDTOIn {
|
|
|
88
119
|
_updated_at: ISODateString;
|
|
89
120
|
/** Ownership mode for models in this collection (default null = not owner-scoped) */
|
|
90
121
|
owner_id_mode: OwnerIdMode;
|
|
122
|
+
/** Lightweight-mode kill switch — relations subsystem. Immutable. */
|
|
123
|
+
__is_relations_enabled: boolean;
|
|
124
|
+
/** Lightweight-mode kill switch — hierarchy subsystem. Immutable. */
|
|
125
|
+
__is_hierarchy_enabled: boolean;
|
|
126
|
+
/** Lightweight-mode kill switch — fulltext subsystem. Immutable. */
|
|
127
|
+
__is_fulltext_enabled: boolean;
|
|
128
|
+
/** Human-friendly `code` feature flag. Immutable after creation. */
|
|
129
|
+
__is_code_enabled: boolean;
|
|
130
|
+
/** Generated `code` length (null = default of 6). */
|
|
131
|
+
__code_length: number | null;
|
|
91
132
|
}
|
|
92
133
|
/**
|
|
93
134
|
* Full database row representation of a collection.
|
package/dist/model.d.ts
CHANGED
|
@@ -66,6 +66,13 @@ export interface ModelDTOOut extends ModelDTOIn {
|
|
|
66
66
|
_updated_at: ISODateString;
|
|
67
67
|
/** Owner identifier (account model_id), null if not owner-scoped */
|
|
68
68
|
owner_id: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Auto-generated human-friendly short code (uppercase Crockford base32),
|
|
71
|
+
* unique per collection and readonly. `null` unless the collection has the
|
|
72
|
+
* code feature enabled (`__is_code_enabled`). Not a client-settable input —
|
|
73
|
+
* it is generated at insert time, hence on the output DTO only.
|
|
74
|
+
*/
|
|
75
|
+
code?: string | null;
|
|
69
76
|
}
|
|
70
77
|
/**
|
|
71
78
|
* Full database row representation of a model.
|
package/dist/schema.d.ts
CHANGED
|
@@ -63,12 +63,18 @@ export interface MoneyConfig {
|
|
|
63
63
|
/** Optional ISO currency code, for surfaces that render a symbol (e.g. "USD"). */
|
|
64
64
|
currency?: string;
|
|
65
65
|
}
|
|
66
|
+
/** Configuration for `textarea` fields (`_html.type: "textarea"`). */
|
|
67
|
+
export interface TextareaConfig {
|
|
68
|
+
/** Visible row count. Absent → the compact, input-like default (1 row). A
|
|
69
|
+
* higher value makes the field read as a textarea (e.g. a description). */
|
|
70
|
+
rows?: number;
|
|
71
|
+
}
|
|
66
72
|
/** Configuration for _html schema keyword */
|
|
67
73
|
export interface SchemaHtmlConfig {
|
|
68
74
|
/** Field type for UI rendering */
|
|
69
75
|
type?: SchemaHtmlType;
|
|
70
76
|
/** Type-specific configuration */
|
|
71
|
-
_type_config?: RelationTypeConfig | AssetTypeConfig | SelectConfig | KeyValuesConfig | MoneyConfig;
|
|
77
|
+
_type_config?: RelationTypeConfig | AssetTypeConfig | SelectConfig | KeyValuesConfig | MoneyConfig | TextareaConfig;
|
|
72
78
|
/** Display label (can be localized) */
|
|
73
79
|
label?: MaybeLocalized<string>;
|
|
74
80
|
/** Display description (can be localized) */
|