@marianmeres/collection-types 2.1.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 +1 -1
- package/dist/navigation.d.ts +14 -1
- package/dist/order.d.ts +14 -1
- package/dist/payment.d.ts +4 -0
- package/dist/schema-builder.d.ts +7 -0
- package/dist/schema.d.ts +10 -2
- package/package.json +1 -1
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"
|
|
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 */
|
package/dist/navigation.d.ts
CHANGED
|
@@ -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
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
import type { AddressData } from "./customer.js";
|
|
13
13
|
import type { UUID } from "./utils.js";
|
|
14
14
|
/** Order status progression */
|
|
15
|
-
export type OrderStatus = "pending" | "paid" | "processing" | "shipped" | "delivered" | "cancelled"
|
|
15
|
+
export type OrderStatus = "pending" | "paid" | "processing" | "shipped" | "delivered" | "cancelled"
|
|
16
|
+
/** System-set by the abandoned-checkout maintenance sweep (never via the
|
|
17
|
+
* customer/admin transition API); a terminal, off-sequence state. */
|
|
18
|
+
| "abandoned";
|
|
16
19
|
/** Checkout stages for tracking progress */
|
|
17
20
|
export type CheckoutStage = "cart" | "addresses" | "delivery" | "confirm" | "payment" | "complete";
|
|
18
21
|
/** Single order line item (snapshot at purchase time) */
|
|
@@ -50,6 +53,16 @@ export interface DeliveryOptionSnapshot {
|
|
|
50
53
|
}
|
|
51
54
|
/** Order data field schema */
|
|
52
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;
|
|
53
66
|
/** Current order status */
|
|
54
67
|
status: OrderStatus;
|
|
55
68
|
/** Line items (snapshots) */
|
package/dist/payment.d.ts
CHANGED
|
@@ -59,6 +59,10 @@ export interface PaymentIntent {
|
|
|
59
59
|
export interface PaymentResult {
|
|
60
60
|
/** Provider reference ID */
|
|
61
61
|
provider_reference: string;
|
|
62
|
+
/** Optional provider verification summary (e.g. PayPal payer email/id,
|
|
63
|
+
* capture status, seller-protection eligibility) surfaced for admin review.
|
|
64
|
+
* Provider-specific keys; undefined when the provider supplies none. */
|
|
65
|
+
verification?: Record<string, unknown>;
|
|
62
66
|
}
|
|
63
67
|
/**
|
|
64
68
|
* Result of a refund operation.
|
package/dist/schema-builder.d.ts
CHANGED
|
@@ -29,6 +29,13 @@ export type ObjectSchema<T> = {
|
|
|
29
29
|
_searchable?: boolean;
|
|
30
30
|
/** Virtual form-only fields (not persisted, excluded from DB validation) */
|
|
31
31
|
_extra_form_fields?: Record<string, PropertyDefinition>;
|
|
32
|
+
/**
|
|
33
|
+
* Admin list-view hint: append these top-level model timestamp columns to the
|
|
34
|
+
* DataTable (rendered from the model row, not `data.*`). Operational
|
|
35
|
+
* collections (orders, invoices, …) typically want "when was this placed /
|
|
36
|
+
* last touched" in the list.
|
|
37
|
+
*/
|
|
38
|
+
_data_table_dates?: ("_created_at" | "_updated_at")[];
|
|
32
39
|
};
|
|
33
40
|
/** Extended schema (loose typing for __extends patterns) */
|
|
34
41
|
export type ExtendedSchema = {
|
package/dist/schema.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { MaybeLocalized } from "./utils.js";
|
|
6
6
|
/** HTML field type for UI rendering */
|
|
7
|
-
export type SchemaHtmlType = "text" | "textarea" | "wysiwyg" | "markdown" | "number" | "money" | "boolean" | "checkbox" | "parent" | "object" | "select" | "multiselect" | "date" | "datetime" | "time" | "color" | "relation" | "asset" | "json" | "code" | "keyvalues" | "password";
|
|
7
|
+
export type SchemaHtmlType = "text" | "textarea" | "wysiwyg" | "markdown" | "number" | "money" | "boolean" | "checkbox" | "parent" | "object" | "select" | "status" | "multiselect" | "date" | "datetime" | "time" | "color" | "relation" | "asset" | "json" | "code" | "keyvalues" | "password";
|
|
8
8
|
/** Configuration for relation-type fields in schema */
|
|
9
9
|
export interface RelationTypeConfig {
|
|
10
10
|
relation_type: string;
|
|
@@ -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 {
|
|
@@ -22,11 +28,13 @@ export interface AssetTypeConfig {
|
|
|
22
28
|
maxSize?: number;
|
|
23
29
|
variants?: string[];
|
|
24
30
|
}
|
|
25
|
-
/** Configuration for select/multiselect fields */
|
|
31
|
+
/** Configuration for select/multiselect/status fields */
|
|
26
32
|
export interface SelectConfig {
|
|
33
|
+
/** `intent` (status fields) carries the per-value badge color. */
|
|
27
34
|
options: Array<{
|
|
28
35
|
value: string;
|
|
29
36
|
label: string;
|
|
37
|
+
intent?: string;
|
|
30
38
|
}>;
|
|
31
39
|
multiple?: boolean;
|
|
32
40
|
}
|