@tracepass/dpp-validate 0.3.0 → 0.3.1
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.
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* v1 design calls (per Malin's confirmation):
|
|
19
19
|
* - Chemicals "downstream user" (REACH-specific role) → folded into
|
|
20
|
-
* `distributor` for now; revisit when a
|
|
20
|
+
* `distributor` for now; revisit when a detergents or paints customer pulls.
|
|
21
21
|
* - Tyre "retreader" → ignored for v1; retreaded tyres treated as a
|
|
22
22
|
* separate passport whose `manufacturer` is the retreader.
|
|
23
23
|
*
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import type { PartyRole } from "@tracepass/dpp-types";
|
|
29
29
|
/**
|
|
30
|
-
* The
|
|
30
|
+
* The 13 categories the platform models. Mirrors the filenames in
|
|
31
31
|
* `templates/*.json`. We re-declare the union here rather than import
|
|
32
32
|
* a CategoryKey from elsewhere so this module stays the canonical
|
|
33
|
-
* place a future contributor looks when adding a
|
|
33
|
+
* place a future contributor looks when adding a 14th category.
|
|
34
34
|
*/
|
|
35
|
-
export type CategoryKey = "battery" | "
|
|
35
|
+
export type CategoryKey = "battery" | "detergents" | "paints-coatings" | "construction" | "electronics" | "fmcg" | "furniture" | "jewelry" | "packaging" | "steel" | "textile" | "toys" | "tyres";
|
|
36
36
|
export interface CategoryPartyRoles {
|
|
37
37
|
/** Roles that MUST be set before the passport is considered complete.
|
|
38
38
|
* The publish flow warns (not blocks) when these are missing — a
|
|
@@ -51,7 +51,7 @@ export interface CategoryPartyRoles {
|
|
|
51
51
|
export declare const CATEGORY_PARTY_ROLES: Record<CategoryKey, CategoryPartyRoles>;
|
|
52
52
|
/**
|
|
53
53
|
* Get the required + optional role lists for a category. Returns
|
|
54
|
-
* `null` when the category isn't one of the
|
|
54
|
+
* `null` when the category isn't one of the 13 modeled categories,
|
|
55
55
|
* so callers can early-return rather than crash on legacy / unknown
|
|
56
56
|
* category strings.
|
|
57
57
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required-roles.d.ts","sourceRoot":"","sources":["../../src/vendor/required-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,
|
|
1
|
+
{"version":3,"file":"required-roles.d.ts","sourceRoot":"","sources":["../../src/vendor/required-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,MAAM,GACN,WAAW,GACX,SAAS,GACT,WAAW,GACX,OAAO,GACP,SAAS,GACT,MAAM,GACN,OAAO,CAAC;AAEZ,MAAM,WAAW,kBAAkB;IACjC;;;uDAGmD;IACnD,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IAC/B;sEACkE;IAClE,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;CAChC;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,WAAW,EAAE,kBAAkB,CAoG/D,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,GACf,kBAAkB,GAAG,IAAI,CAE3B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAGzE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,SAAS,EAAE,CAI1E"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* v1 design calls (per Malin's confirmation):
|
|
19
19
|
* - Chemicals "downstream user" (REACH-specific role) → folded into
|
|
20
|
-
* `distributor` for now; revisit when a
|
|
20
|
+
* `distributor` for now; revisit when a detergents or paints customer pulls.
|
|
21
21
|
* - Tyre "retreader" → ignored for v1; retreaded tyres treated as a
|
|
22
22
|
* separate passport whose `manufacturer` is the retreader.
|
|
23
23
|
*
|
|
@@ -81,8 +81,16 @@ export const CATEGORY_PARTY_ROLES = {
|
|
|
81
81
|
},
|
|
82
82
|
// REACH places obligations on manufacturer + importer + downstream
|
|
83
83
|
// user. v1 maps "downstream user" to `distributor` per design call;
|
|
84
|
-
// revisit when a
|
|
85
|
-
|
|
84
|
+
// revisit when a detergents or paints customer pulls.
|
|
85
|
+
detergents: {
|
|
86
|
+
required: ["manufacturer"],
|
|
87
|
+
optional: ["importer", "distributor", "authorisedRepresentative"],
|
|
88
|
+
},
|
|
89
|
+
// Same REACH shape as detergents — both are chemical mixtures. Split from
|
|
90
|
+
// the former combined `chemicals` entry when the category was divided;
|
|
91
|
+
// Reg (EU) 2026/405 gives detergents a passport, paints have none, but the
|
|
92
|
+
// economic-operator duties under REACH are identical.
|
|
93
|
+
"paints-coatings": {
|
|
86
94
|
required: ["manufacturer"],
|
|
87
95
|
optional: ["importer", "distributor", "authorisedRepresentative"],
|
|
88
96
|
},
|
|
@@ -113,7 +121,7 @@ export const CATEGORY_PARTY_ROLES = {
|
|
|
113
121
|
};
|
|
114
122
|
/**
|
|
115
123
|
* Get the required + optional role lists for a category. Returns
|
|
116
|
-
* `null` when the category isn't one of the
|
|
124
|
+
* `null` when the category isn't one of the 13 modeled categories,
|
|
117
125
|
* so callers can early-return rather than crash on legacy / unknown
|
|
118
126
|
* category strings.
|
|
119
127
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required-roles.js","sourceRoot":"","sources":["../../src/vendor/required-roles.ts"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EhB,OAAO,oBAAoB,CAAC,QAAuB,CAAC,IAAI,IAAI,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,IAAe;IAC9D,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtC,OAAO,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB;IAClD,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tracepass/dpp-validate",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Evaluate an EU Digital Product Passport against its category field-spec — a three-tier compliance verdict with regulation-cited findings. Pure functions, no third-party runtime dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"digital-product-passport",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"clean": "rm -rf dist"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@tracepass/dpp-types": "^0.3.
|
|
48
|
+
"@tracepass/dpp-types": "^0.3.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"typescript": "^5.6.3"
|