@tracepass/dpp-schemas 0.1.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/LICENSE +202 -0
- package/README.md +193 -0
- package/index.json +184 -0
- package/instruments.json +322 -0
- package/package.json +46 -0
- package/schema.json +519 -0
- package/templates/battery.json +11506 -0
- package/templates/chemicals.json +12437 -0
- package/templates/construction.json +6405 -0
- package/templates/electronics.json +20057 -0
- package/templates/fmcg.json +6632 -0
- package/templates/furniture.json +9254 -0
- package/templates/jewelry.json +6859 -0
- package/templates/packaging.json +8993 -0
- package/templates/steel.json +12099 -0
- package/templates/textile.json +7425 -0
- package/templates/toys.json +3901 -0
- package/templates/tyres.json +11575 -0
- package/units.json +285 -0
package/schema.json
ADDED
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://tracepass.eu/schema/dpp-template/v1.json",
|
|
4
|
+
"title": "DPP Category Template",
|
|
5
|
+
"description": "A machine-readable field specification for one Digital Product Passport product category under EU law. Each field carries its regulatory citation, datatype, validation rules, access level, and localized labels.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"category",
|
|
9
|
+
"categoryLabel",
|
|
10
|
+
"version",
|
|
11
|
+
"isLatest",
|
|
12
|
+
"regulation",
|
|
13
|
+
"fields",
|
|
14
|
+
"fieldCount",
|
|
15
|
+
"requiredFieldCount",
|
|
16
|
+
"categories",
|
|
17
|
+
"createdBy"
|
|
18
|
+
],
|
|
19
|
+
"additionalProperties": false,
|
|
20
|
+
"properties": {
|
|
21
|
+
"category": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Stable machine key for the product category.",
|
|
24
|
+
"examples": [
|
|
25
|
+
"battery",
|
|
26
|
+
"textile",
|
|
27
|
+
"steel"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"categoryLabel": {
|
|
31
|
+
"$ref": "#/$defs/localizedString",
|
|
32
|
+
"description": "Human-readable category name, keyed by ISO 639-1 locale."
|
|
33
|
+
},
|
|
34
|
+
"version": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"minimum": 1,
|
|
37
|
+
"description": "Template version. Increments when fields are added, removed, or their validation changes."
|
|
38
|
+
},
|
|
39
|
+
"isLatest": {
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"description": "True for the current version of this category."
|
|
42
|
+
},
|
|
43
|
+
"regulation": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"description": "The EU instrument that mandates this category's passport.",
|
|
46
|
+
"required": [
|
|
47
|
+
"name",
|
|
48
|
+
"number",
|
|
49
|
+
"effectiveDate",
|
|
50
|
+
"mandatoryDate"
|
|
51
|
+
],
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"properties": {
|
|
54
|
+
"name": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"examples": [
|
|
57
|
+
"EU Battery Regulation"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"number": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"examples": [
|
|
63
|
+
"(EU) 2023/1542",
|
|
64
|
+
"(EU) 2024/1781"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"effectiveDate": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"format": "date",
|
|
70
|
+
"description": "ISO 8601 date (YYYY-MM-DD). A string, not a timestamp."
|
|
71
|
+
},
|
|
72
|
+
"mandatoryDate": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"format": "date",
|
|
75
|
+
"description": "ISO 8601 date (YYYY-MM-DD) from which the passport is legally required."
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"fields": {
|
|
80
|
+
"type": "array",
|
|
81
|
+
"minItems": 1,
|
|
82
|
+
"items": {
|
|
83
|
+
"$ref": "#/$defs/templateField"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"fieldCount": {
|
|
87
|
+
"type": "integer",
|
|
88
|
+
"minimum": 1,
|
|
89
|
+
"description": "Must equal fields.length."
|
|
90
|
+
},
|
|
91
|
+
"requiredFieldCount": {
|
|
92
|
+
"type": "integer",
|
|
93
|
+
"minimum": 0,
|
|
94
|
+
"description": "Must equal the count of fields whose validation.required is true."
|
|
95
|
+
},
|
|
96
|
+
"categories": {
|
|
97
|
+
"type": "array",
|
|
98
|
+
"description": "Field-group sections, in display order. Older templates store plain strings; newer ones store objects carrying localized headers.",
|
|
99
|
+
"items": {
|
|
100
|
+
"oneOf": [
|
|
101
|
+
{
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"type": "object",
|
|
106
|
+
"required": [
|
|
107
|
+
"key"
|
|
108
|
+
],
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"properties": {
|
|
111
|
+
"key": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
"label": {
|
|
115
|
+
"$ref": "#/$defs/localizedString"
|
|
116
|
+
},
|
|
117
|
+
"fieldCount": {
|
|
118
|
+
"type": "integer",
|
|
119
|
+
"minimum": 0
|
|
120
|
+
},
|
|
121
|
+
"sortOrder": {
|
|
122
|
+
"type": "integer"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"createdBy": {
|
|
130
|
+
"type": "string"
|
|
131
|
+
},
|
|
132
|
+
"changelog": {
|
|
133
|
+
"type": "string"
|
|
134
|
+
},
|
|
135
|
+
"_note": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"description": "Free-text annotation for maintainers. Not consumed by any code."
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"$defs": {
|
|
141
|
+
"localizedString": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"description": "Locale code to translated string, restricted to the 24 official EU languages. 'en' is always present; other locales are provided where translated.",
|
|
144
|
+
"required": [
|
|
145
|
+
"en"
|
|
146
|
+
],
|
|
147
|
+
"propertyNames": {
|
|
148
|
+
"enum": [
|
|
149
|
+
"bg",
|
|
150
|
+
"cs",
|
|
151
|
+
"da",
|
|
152
|
+
"de",
|
|
153
|
+
"el",
|
|
154
|
+
"en",
|
|
155
|
+
"es",
|
|
156
|
+
"et",
|
|
157
|
+
"fi",
|
|
158
|
+
"fr",
|
|
159
|
+
"ga",
|
|
160
|
+
"hr",
|
|
161
|
+
"hu",
|
|
162
|
+
"it",
|
|
163
|
+
"lt",
|
|
164
|
+
"lv",
|
|
165
|
+
"mt",
|
|
166
|
+
"nl",
|
|
167
|
+
"pl",
|
|
168
|
+
"pt",
|
|
169
|
+
"ro",
|
|
170
|
+
"sk",
|
|
171
|
+
"sl",
|
|
172
|
+
"sv"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"additionalProperties": {
|
|
176
|
+
"type": "string"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"templateField": {
|
|
180
|
+
"type": "object",
|
|
181
|
+
"required": [
|
|
182
|
+
"key",
|
|
183
|
+
"label",
|
|
184
|
+
"dataType",
|
|
185
|
+
"validation",
|
|
186
|
+
"category",
|
|
187
|
+
"categoryLabel",
|
|
188
|
+
"sortOrder",
|
|
189
|
+
"defaultAccessLevel"
|
|
190
|
+
],
|
|
191
|
+
"additionalProperties": false,
|
|
192
|
+
"properties": {
|
|
193
|
+
"key": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"description": "Stable machine key, unique within the template.",
|
|
196
|
+
"examples": [
|
|
197
|
+
"batteryCapacity",
|
|
198
|
+
"carbonFootprint"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"label": {
|
|
202
|
+
"$ref": "#/$defs/localizedString"
|
|
203
|
+
},
|
|
204
|
+
"description": {
|
|
205
|
+
"$ref": "#/$defs/localizedString"
|
|
206
|
+
},
|
|
207
|
+
"placeholder": {
|
|
208
|
+
"$ref": "#/$defs/localizedString"
|
|
209
|
+
},
|
|
210
|
+
"dataType": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"enum": [
|
|
213
|
+
"string",
|
|
214
|
+
"number",
|
|
215
|
+
"boolean",
|
|
216
|
+
"date",
|
|
217
|
+
"enum",
|
|
218
|
+
"multi_enum",
|
|
219
|
+
"array",
|
|
220
|
+
"object",
|
|
221
|
+
"url",
|
|
222
|
+
"file_reference"
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
"unit": {
|
|
226
|
+
"description": "Unit of measure. Must be a canonical key from units.json — the historical free-text spellings are no longer permitted. `null` when the field has no unit.",
|
|
227
|
+
"oneOf": [
|
|
228
|
+
{
|
|
229
|
+
"type": "null"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"type": "string",
|
|
233
|
+
"enum": [
|
|
234
|
+
"%",
|
|
235
|
+
"% P2O5",
|
|
236
|
+
"%/month",
|
|
237
|
+
"Ah",
|
|
238
|
+
"EUR/tCO2",
|
|
239
|
+
"GB",
|
|
240
|
+
"J",
|
|
241
|
+
"L",
|
|
242
|
+
"MJ",
|
|
243
|
+
"MPa",
|
|
244
|
+
"Mohs",
|
|
245
|
+
"N",
|
|
246
|
+
"N/kN",
|
|
247
|
+
"Ohm",
|
|
248
|
+
"TB",
|
|
249
|
+
"V",
|
|
250
|
+
"W",
|
|
251
|
+
"Wh/kg",
|
|
252
|
+
"ct",
|
|
253
|
+
"cycles",
|
|
254
|
+
"dB",
|
|
255
|
+
"dB(A)",
|
|
256
|
+
"g",
|
|
257
|
+
"g/L",
|
|
258
|
+
"g/cm³",
|
|
259
|
+
"gCO2/kWh",
|
|
260
|
+
"grade",
|
|
261
|
+
"hours",
|
|
262
|
+
"inches",
|
|
263
|
+
"kPa",
|
|
264
|
+
"kWh",
|
|
265
|
+
"kWh/t",
|
|
266
|
+
"kg",
|
|
267
|
+
"kg CFC-11 eq.",
|
|
268
|
+
"kg CO2e",
|
|
269
|
+
"kg CO2e/kWh",
|
|
270
|
+
"kg N eq.",
|
|
271
|
+
"kg NMVOC eq.",
|
|
272
|
+
"kg P eq.",
|
|
273
|
+
"kg Sb eq.",
|
|
274
|
+
"kg/24h",
|
|
275
|
+
"kg/m3",
|
|
276
|
+
"kgCO2e/kg",
|
|
277
|
+
"km",
|
|
278
|
+
"km/h",
|
|
279
|
+
"l eq",
|
|
280
|
+
"l/wash",
|
|
281
|
+
"m",
|
|
282
|
+
"m3 world eq.",
|
|
283
|
+
"mAh",
|
|
284
|
+
"mL",
|
|
285
|
+
"mPa·s",
|
|
286
|
+
"mPt",
|
|
287
|
+
"mg/kg",
|
|
288
|
+
"mg/kg per wash",
|
|
289
|
+
"mg/km",
|
|
290
|
+
"mg/m3",
|
|
291
|
+
"millesimal",
|
|
292
|
+
"minutes",
|
|
293
|
+
"mm",
|
|
294
|
+
"mol H+ eq.",
|
|
295
|
+
"mol N eq.",
|
|
296
|
+
"months",
|
|
297
|
+
"m²/L",
|
|
298
|
+
"points",
|
|
299
|
+
"ppm",
|
|
300
|
+
"rpm",
|
|
301
|
+
"tCO2/t",
|
|
302
|
+
"tCO2e/t",
|
|
303
|
+
"ug/cm2/week",
|
|
304
|
+
"ug/m3",
|
|
305
|
+
"weight_%",
|
|
306
|
+
"working days",
|
|
307
|
+
"years",
|
|
308
|
+
"°C"
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
"translatable": {
|
|
314
|
+
"type": "boolean",
|
|
315
|
+
"description": "Whether this field's value is free text that should be translated for multilingual passports."
|
|
316
|
+
},
|
|
317
|
+
"defaultValue": {
|
|
318
|
+
"description": "Any JSON value matching dataType, or null when the field has no default."
|
|
319
|
+
},
|
|
320
|
+
"enumOptions": {
|
|
321
|
+
"type": [
|
|
322
|
+
"array",
|
|
323
|
+
"null"
|
|
324
|
+
],
|
|
325
|
+
"description": "Permitted values when dataType is 'enum' or 'multi_enum'. Explicitly null otherwise.",
|
|
326
|
+
"items": {
|
|
327
|
+
"type": "object",
|
|
328
|
+
"required": [
|
|
329
|
+
"value",
|
|
330
|
+
"label"
|
|
331
|
+
],
|
|
332
|
+
"additionalProperties": false,
|
|
333
|
+
"properties": {
|
|
334
|
+
"value": {
|
|
335
|
+
"type": "string"
|
|
336
|
+
},
|
|
337
|
+
"label": {
|
|
338
|
+
"$ref": "#/$defs/localizedString"
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"validation": {
|
|
344
|
+
"type": "object",
|
|
345
|
+
"description": "Constraints on the field's value, and whether the law requires it. `required` means an instrument IN FORCE compels the data; `anticipated` means a named future instrument is expected to. They are mutually exclusive.",
|
|
346
|
+
"required": [
|
|
347
|
+
"required"
|
|
348
|
+
],
|
|
349
|
+
"additionalProperties": false,
|
|
350
|
+
"properties": {
|
|
351
|
+
"required": {
|
|
352
|
+
"type": "boolean"
|
|
353
|
+
},
|
|
354
|
+
"minLength": {
|
|
355
|
+
"type": [
|
|
356
|
+
"integer",
|
|
357
|
+
"null"
|
|
358
|
+
],
|
|
359
|
+
"minimum": 0
|
|
360
|
+
},
|
|
361
|
+
"maxLength": {
|
|
362
|
+
"type": [
|
|
363
|
+
"integer",
|
|
364
|
+
"null"
|
|
365
|
+
],
|
|
366
|
+
"minimum": 0
|
|
367
|
+
},
|
|
368
|
+
"min": {
|
|
369
|
+
"type": [
|
|
370
|
+
"number",
|
|
371
|
+
"null"
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
"max": {
|
|
375
|
+
"type": [
|
|
376
|
+
"number",
|
|
377
|
+
"null"
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
"pattern": {
|
|
381
|
+
"type": [
|
|
382
|
+
"string",
|
|
383
|
+
"null"
|
|
384
|
+
],
|
|
385
|
+
"description": "ECMAScript regular expression the value must match."
|
|
386
|
+
},
|
|
387
|
+
"anticipated": {
|
|
388
|
+
"type": "boolean",
|
|
389
|
+
"description": "A named future instrument is expected to require this data, and none in force does. Does not block publishing. Never set alongside `required: true`."
|
|
390
|
+
},
|
|
391
|
+
"anticipatedUnder": {
|
|
392
|
+
"type": "string",
|
|
393
|
+
"description": "CELEX id of the instrument expected to impose it, e.g. \"32024R1781\"."
|
|
394
|
+
},
|
|
395
|
+
"anticipatedNote": {
|
|
396
|
+
"type": "string",
|
|
397
|
+
"description": "Why it is expected — e.g. \"ESPR Annex I(p), pending a delegated act under Art. 4\"."
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
"category": {
|
|
402
|
+
"type": "string",
|
|
403
|
+
"description": "Field-group key this field belongs to. Matches an entry in the template's `categories`."
|
|
404
|
+
},
|
|
405
|
+
"categoryLabel": {
|
|
406
|
+
"$ref": "#/$defs/localizedString"
|
|
407
|
+
},
|
|
408
|
+
"sortOrder": {
|
|
409
|
+
"type": "integer"
|
|
410
|
+
},
|
|
411
|
+
"defaultAccessLevel": {
|
|
412
|
+
"type": "string",
|
|
413
|
+
"enum": [
|
|
414
|
+
"public",
|
|
415
|
+
"restricted",
|
|
416
|
+
"authority"
|
|
417
|
+
],
|
|
418
|
+
"description": "Who may read this field by default. 'public' is visible to anyone scanning the QR code; 'restricted' requires a granted token; 'authority' is for market-surveillance bodies."
|
|
419
|
+
},
|
|
420
|
+
"regulationRef": {
|
|
421
|
+
"type": [
|
|
422
|
+
"object",
|
|
423
|
+
"null"
|
|
424
|
+
],
|
|
425
|
+
"description": "Where this field's obligation comes from. `article` is the legacy unstructured form, retained until every template carries `instrument` + `provision` + `kind`.",
|
|
426
|
+
"additionalProperties": false,
|
|
427
|
+
"properties": {
|
|
428
|
+
"article": {
|
|
429
|
+
"type": [
|
|
430
|
+
"string",
|
|
431
|
+
"null"
|
|
432
|
+
],
|
|
433
|
+
"examples": [
|
|
434
|
+
"Art. 77"
|
|
435
|
+
]
|
|
436
|
+
},
|
|
437
|
+
"annex": {
|
|
438
|
+
"type": [
|
|
439
|
+
"string",
|
|
440
|
+
"null"
|
|
441
|
+
],
|
|
442
|
+
"examples": [
|
|
443
|
+
"Annex XIII"
|
|
444
|
+
]
|
|
445
|
+
},
|
|
446
|
+
"description": {
|
|
447
|
+
"type": [
|
|
448
|
+
"string",
|
|
449
|
+
"null"
|
|
450
|
+
]
|
|
451
|
+
},
|
|
452
|
+
"instrument": {
|
|
453
|
+
"type": [
|
|
454
|
+
"string",
|
|
455
|
+
"null"
|
|
456
|
+
],
|
|
457
|
+
"description": "CELEX id of the instrument, e.g. \"32023R1542\"."
|
|
458
|
+
},
|
|
459
|
+
"provision": {
|
|
460
|
+
"type": [
|
|
461
|
+
"string",
|
|
462
|
+
"null"
|
|
463
|
+
],
|
|
464
|
+
"description": "The provision within it, e.g. \"Art. 77(1)\"."
|
|
465
|
+
},
|
|
466
|
+
"kind": {
|
|
467
|
+
"type": [
|
|
468
|
+
"string",
|
|
469
|
+
"null"
|
|
470
|
+
],
|
|
471
|
+
"enum": [
|
|
472
|
+
"legislation",
|
|
473
|
+
"standard",
|
|
474
|
+
"scheme",
|
|
475
|
+
"national",
|
|
476
|
+
"international",
|
|
477
|
+
"specification",
|
|
478
|
+
null
|
|
479
|
+
],
|
|
480
|
+
"description": "What kind of claim this reference is. `legislation` binds; `standard` supports a presumption of conformity but binds nothing; `scheme` is voluntary; `national` is one member state's law; `international` is a convention outside EU law; `specification` is not a reference at all."
|
|
481
|
+
},
|
|
482
|
+
"source": {
|
|
483
|
+
"type": [
|
|
484
|
+
"string",
|
|
485
|
+
"null"
|
|
486
|
+
],
|
|
487
|
+
"description": "Free-text name when the reference is not EU legislation."
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
"aiHints": {
|
|
492
|
+
"type": "object",
|
|
493
|
+
"description": "Hints for automated extraction of this field from unstructured supplier documents.",
|
|
494
|
+
"required": [
|
|
495
|
+
"alternateNames",
|
|
496
|
+
"extractionPriority"
|
|
497
|
+
],
|
|
498
|
+
"additionalProperties": false,
|
|
499
|
+
"properties": {
|
|
500
|
+
"alternateNames": {
|
|
501
|
+
"type": "array",
|
|
502
|
+
"items": {
|
|
503
|
+
"type": "string"
|
|
504
|
+
},
|
|
505
|
+
"description": "Synonyms a datasheet might use for this field."
|
|
506
|
+
},
|
|
507
|
+
"expectedFormat": {
|
|
508
|
+
"type": "string"
|
|
509
|
+
},
|
|
510
|
+
"extractionPriority": {
|
|
511
|
+
"type": "integer",
|
|
512
|
+
"description": "Higher runs first when extraction budget is limited."
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|