@marianmeres/collection-types 2.2.0 → 2.3.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/adapter.d.ts CHANGED
@@ -18,7 +18,7 @@ export interface DbQueryResult<T = Record<string, unknown>> {
18
18
  */
19
19
  export interface QueryProvider {
20
20
  /** Query provider type */
21
- type: "pg" | "sqlite";
21
+ type: "pg";
22
22
  /** Execute a query and return results */
23
23
  query(sql: string, params?: unknown[]): Promise<DbQueryResult>;
24
24
  /** Execute a query with cursor-style row iteration */
@@ -48,6 +48,15 @@ export interface NavConfig {
48
48
  label?: MaybeLocalized<string>;
49
49
  order?: number;
50
50
  icon?: string;
51
+ /**
52
+ * Stable, non-localized key that buckets this domain/entity into a
53
+ * nav group. Defaults to the domain. Set the SAME `groupKey` (and a
54
+ * matching `group` label) on several entries to merge multiple
55
+ * domains under one group — e.g. `order` + `invoice` → "Sales".
56
+ * Must be a plain string (it is used as a Map key), never a
57
+ * localized object.
58
+ */
59
+ groupKey?: string;
51
60
  group?: MaybeLocalized<string>;
52
61
  groupIcon?: string;
53
62
  folder?: string;
@@ -94,8 +103,12 @@ export interface NavItemDef {
94
103
  * Area identifiers for the admin SPA.
95
104
  * Each area represents a distinct section of the application with its own
96
105
  * routing pattern and navigation structure.
106
+ *
107
+ * `todo` is a bespoke direct-route area (the `me`/`extra` precedent — NOT in the
108
+ * client AreaRegistry); it ships as a prebuilt passthrough from
109
+ * `__joy_nav__.areas.todo`, gated to root only via `requiredPermissions`.
97
110
  */
98
- export type AreaId = "cms" | "custom" | "user" | "extra" | "me";
111
+ export type AreaId = "cms" | "custom" | "user" | "extra" | "me" | "todo";
99
112
  /**
100
113
  * Base nav item structure shared across all areas.
101
114
  * Designed to support hierarchical navigation (groups, pages, tabs).
package/dist/order.d.ts CHANGED
@@ -53,6 +53,16 @@ export interface DeliveryOptionSnapshot {
53
53
  }
54
54
  /** Order data field schema */
55
55
  export interface OrderData {
56
+ /**
57
+ * Public, customer-facing order identifier shown in place of the model UUID
58
+ * everywhere the customer is involved (checkout confirmation, emails, the
59
+ * printed order document, account order history). Non-sequential Crockford
60
+ * base32 (uppercase, length 6), generated and uniqueness-checked at creation,
61
+ * then FROZEN — never changed on any subsequent update. Mirrors
62
+ * `InvoiceData.code`. Optional so legacy/admin-created rows that predate the
63
+ * field still type-check; read paths fall back to `shortOrderRef(model_id)`.
64
+ */
65
+ code?: string;
56
66
  /** Current order status */
57
67
  status: OrderStatus;
58
68
  /** Line items (snapshots) */
package/dist/schema.d.ts CHANGED
@@ -15,6 +15,12 @@ export interface RelationTypeConfig {
15
15
  type?: string;
16
16
  /** Allow unknown relations */
17
17
  allow_unknown?: boolean;
18
+ /**
19
+ * When true (and the relation is multi-value, i.e. `cardinality !== 1`), the
20
+ * admin UI exposes a manual reorder control. The chosen order is persisted as
21
+ * the relation `sort_order`. No-op for single-cardinality relations.
22
+ */
23
+ ordered?: boolean;
18
24
  }
19
25
  /** Configuration for asset-type fields in schema */
20
26
  export interface AssetTypeConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/collection-types",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "main": "dist/mod.js",
6
6
  "types": "dist/mod.d.ts",