@unified-product-graph/core 0.11.3 → 0.11.4
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/CHANGELOG.md +14 -0
- package/dist/index.cjs +18 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -19007,6 +19007,25 @@ interface UPGTreeChild {
|
|
|
19007
19007
|
* when present and are silent when absent.
|
|
19008
19008
|
*/
|
|
19009
19009
|
required?: boolean;
|
|
19010
|
+
/**
|
|
19011
|
+
* The node property `get_tree` sorts this slot's children by (ascending,
|
|
19012
|
+
* nodes lacking it last). Ordering is a property of the DATA, not the viewer,
|
|
19013
|
+
* so the server returns children pre-sorted rather than leaving every client
|
|
19014
|
+
* to re-sort (UPG-663 sequence scalars: `phase_order`, `step_order`,
|
|
19015
|
+
* `action_order`, `state_order`). Omitted -> children keep declared slot order.
|
|
19016
|
+
*/
|
|
19017
|
+
order_by?: string;
|
|
19018
|
+
/**
|
|
19019
|
+
* Spine resolution for a DAG. When this slot reaches the SAME node redundantly
|
|
19020
|
+
* with a path through a sibling type (e.g. `user_journey -> journey_step`
|
|
19021
|
+
* directly AND `user_journey -> journey_phase -> journey_step`), name that
|
|
19022
|
+
* sibling type here. A child also reachable as a grandchild through a
|
|
19023
|
+
* `prefer_via`-typed child renders under that spine, NOT here -- collapsing the
|
|
19024
|
+
* redundant path so the node is neither silently dropped (G5) nor
|
|
19025
|
+
* double-counted (J1). A child not on the spine still renders here, so the
|
|
19026
|
+
* direct path remains the fallback when the grouping layer is absent.
|
|
19027
|
+
*/
|
|
19028
|
+
prefer_via?: string;
|
|
19010
19029
|
}
|
|
19011
19030
|
/** How a pattern decides what counts as a structural gap. */
|
|
19012
19031
|
type UPGTreeGapPolicy = 'required-children-only' | 'all-optional';
|
|
@@ -19076,6 +19095,10 @@ interface UPGTreePatternEdge {
|
|
|
19076
19095
|
/** The edge's classification (hierarchy, semantic, cross-domain, ...), or null. */
|
|
19077
19096
|
kind: string | null;
|
|
19078
19097
|
required: boolean;
|
|
19098
|
+
/** Node scalar this slot's children are sorted by, when declared (J2). */
|
|
19099
|
+
order_by?: string;
|
|
19100
|
+
/** Sibling type whose path is the canonical spine for this child (J1), when declared. */
|
|
19101
|
+
prefer_via?: string;
|
|
19079
19102
|
}
|
|
19080
19103
|
/** A pattern with its child map resolved to concrete edges (for introspection). */
|
|
19081
19104
|
interface UPGTreePatternDetail extends UPGTreePattern {
|
|
@@ -21560,7 +21583,7 @@ declare function isCanonical(text: string): boolean;
|
|
|
21560
21583
|
* it stamps the `upg_version` field of every `.upg` file written by the SDK.
|
|
21561
21584
|
* The `check:version-lockstep` gate enforces this at release time.
|
|
21562
21585
|
*/
|
|
21563
|
-
declare const UPG_VERSION: "0.11.
|
|
21586
|
+
declare const UPG_VERSION: "0.11.4";
|
|
21564
21587
|
/**
|
|
21565
21588
|
* The `.upg` JSON document format version. Written to the `upg_version` field.
|
|
21566
21589
|
* Evolves independently from `UPG_VERSION` (the catalogue version).
|
package/dist/index.d.ts
CHANGED
|
@@ -19007,6 +19007,25 @@ interface UPGTreeChild {
|
|
|
19007
19007
|
* when present and are silent when absent.
|
|
19008
19008
|
*/
|
|
19009
19009
|
required?: boolean;
|
|
19010
|
+
/**
|
|
19011
|
+
* The node property `get_tree` sorts this slot's children by (ascending,
|
|
19012
|
+
* nodes lacking it last). Ordering is a property of the DATA, not the viewer,
|
|
19013
|
+
* so the server returns children pre-sorted rather than leaving every client
|
|
19014
|
+
* to re-sort (UPG-663 sequence scalars: `phase_order`, `step_order`,
|
|
19015
|
+
* `action_order`, `state_order`). Omitted -> children keep declared slot order.
|
|
19016
|
+
*/
|
|
19017
|
+
order_by?: string;
|
|
19018
|
+
/**
|
|
19019
|
+
* Spine resolution for a DAG. When this slot reaches the SAME node redundantly
|
|
19020
|
+
* with a path through a sibling type (e.g. `user_journey -> journey_step`
|
|
19021
|
+
* directly AND `user_journey -> journey_phase -> journey_step`), name that
|
|
19022
|
+
* sibling type here. A child also reachable as a grandchild through a
|
|
19023
|
+
* `prefer_via`-typed child renders under that spine, NOT here -- collapsing the
|
|
19024
|
+
* redundant path so the node is neither silently dropped (G5) nor
|
|
19025
|
+
* double-counted (J1). A child not on the spine still renders here, so the
|
|
19026
|
+
* direct path remains the fallback when the grouping layer is absent.
|
|
19027
|
+
*/
|
|
19028
|
+
prefer_via?: string;
|
|
19010
19029
|
}
|
|
19011
19030
|
/** How a pattern decides what counts as a structural gap. */
|
|
19012
19031
|
type UPGTreeGapPolicy = 'required-children-only' | 'all-optional';
|
|
@@ -19076,6 +19095,10 @@ interface UPGTreePatternEdge {
|
|
|
19076
19095
|
/** The edge's classification (hierarchy, semantic, cross-domain, ...), or null. */
|
|
19077
19096
|
kind: string | null;
|
|
19078
19097
|
required: boolean;
|
|
19098
|
+
/** Node scalar this slot's children are sorted by, when declared (J2). */
|
|
19099
|
+
order_by?: string;
|
|
19100
|
+
/** Sibling type whose path is the canonical spine for this child (J1), when declared. */
|
|
19101
|
+
prefer_via?: string;
|
|
19079
19102
|
}
|
|
19080
19103
|
/** A pattern with its child map resolved to concrete edges (for introspection). */
|
|
19081
19104
|
interface UPGTreePatternDetail extends UPGTreePattern {
|
|
@@ -21560,7 +21583,7 @@ declare function isCanonical(text: string): boolean;
|
|
|
21560
21583
|
* it stamps the `upg_version` field of every `.upg` file written by the SDK.
|
|
21561
21584
|
* The `check:version-lockstep` gate enforces this at release time.
|
|
21562
21585
|
*/
|
|
21563
|
-
declare const UPG_VERSION: "0.11.
|
|
21586
|
+
declare const UPG_VERSION: "0.11.4";
|
|
21564
21587
|
/**
|
|
21565
21588
|
* The `.upg` JSON document format version. Written to the `upg_version` field.
|
|
21566
21589
|
* Evolves independently from `UPG_VERSION` (the catalogue version).
|
package/dist/index.js
CHANGED
|
@@ -19940,8 +19940,8 @@ function buildTypeAliases() {
|
|
|
19940
19940
|
var UPG_TYPE_ALIASES = buildTypeAliases();
|
|
19941
19941
|
|
|
19942
19942
|
// src/presentation/tree-patterns.ts
|
|
19943
|
-
var req = (type) =>
|
|
19944
|
-
var opt = (type) =>
|
|
19943
|
+
var req = (type, order_by) => order_by ? { type, required: true, order_by } : { type, required: true };
|
|
19944
|
+
var opt = (type, order_by) => order_by ? { type, order_by } : { type };
|
|
19945
19945
|
var UPG_TREE_PATTERNS = [
|
|
19946
19946
|
{
|
|
19947
19947
|
id: "ost",
|
|
@@ -20127,11 +20127,18 @@ var UPG_TREE_PATTERNS = [
|
|
|
20127
20127
|
anchor_type: "user_journey",
|
|
20128
20128
|
fallback_anchors: ["user_flow"],
|
|
20129
20129
|
child_map: {
|
|
20130
|
-
|
|
20131
|
-
|
|
20132
|
-
|
|
20130
|
+
// The phase is the grouping layer: a step reachable through a phase
|
|
20131
|
+
// renders under the phase, not twice (J1). `prefer_via` collapses the
|
|
20132
|
+
// redundant direct path; a step in NO phase still renders here. Children
|
|
20133
|
+
// are returned in `*_order` sequence (J2), not storage order.
|
|
20134
|
+
user_journey: [
|
|
20135
|
+
opt("journey_phase", "phase_order"),
|
|
20136
|
+
{ type: "journey_step", prefer_via: "journey_phase", order_by: "step_order" }
|
|
20137
|
+
],
|
|
20138
|
+
journey_phase: [opt("journey_step", "step_order")],
|
|
20139
|
+
journey_step: [opt("journey_action", "action_order"), opt("screen")],
|
|
20133
20140
|
user_flow: [opt("screen")],
|
|
20134
|
-
screen: [opt("screen_state")]
|
|
20141
|
+
screen: [opt("screen_state", "state_order")]
|
|
20135
20142
|
},
|
|
20136
20143
|
natural_depth: 3
|
|
20137
20144
|
},
|
|
@@ -20169,7 +20176,10 @@ function resolveTreePatternEdges(pattern) {
|
|
|
20169
20176
|
for (const [parent, children] of Object.entries(pattern.child_map)) {
|
|
20170
20177
|
for (const c of children) {
|
|
20171
20178
|
const e = resolvePatternEdge(parent, c.type);
|
|
20172
|
-
|
|
20179
|
+
const row = { parent, child: c.type, via: e?.via ?? null, kind: e?.kind ?? null, required: !!c.required };
|
|
20180
|
+
if (c.order_by) row.order_by = c.order_by;
|
|
20181
|
+
if (c.prefer_via) row.prefer_via = c.prefer_via;
|
|
20182
|
+
out.push(row);
|
|
20173
20183
|
}
|
|
20174
20184
|
}
|
|
20175
20185
|
return out;
|
|
@@ -28556,7 +28566,7 @@ function isCanonical(text) {
|
|
|
28556
28566
|
}
|
|
28557
28567
|
|
|
28558
28568
|
// src/index.ts
|
|
28559
|
-
var UPG_VERSION = "0.11.
|
|
28569
|
+
var UPG_VERSION = "0.11.4";
|
|
28560
28570
|
var UPG_FORMAT_VERSION = "0.4.0";
|
|
28561
28571
|
var MARKDOWN_FORMAT_VERSION = "0.1";
|
|
28562
28572
|
var UPG_TYPES = getTypes();
|