@bsv/create-dpp-app 0.1.0-beta.1 → 0.1.0-beta.2
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/NOTICE +2 -0
- package/PATENTS +12 -0
- package/README.md +26 -6
- package/dist/index.js +36 -8
- package/package.json +9 -5
- package/template/Dockerfile +4 -2
- package/template/README.md +297 -42
- package/template/_env.example +82 -13
- package/template/_github/workflows/ci.yml +3 -3
- package/template/apps/api/API.md +86 -16
- package/template/apps/api/package.json +9 -4
- package/template/apps/api/src/bound-profiles.ts +590 -0
- package/template/apps/api/src/claims.ts +175 -56
- package/template/apps/api/src/cli.ts +64 -7
- package/template/apps/api/src/config.ts +124 -10
- package/template/apps/api/src/custody.ts +241 -69
- package/template/apps/api/src/dev-index.ts +58 -9
- package/template/apps/api/src/env-file.ts +55 -0
- package/template/apps/api/src/epcis/exchange.ts +434 -0
- package/template/apps/api/src/epcis/mongo-storage.ts +381 -0
- package/template/apps/api/src/epcis/routes.ts +364 -0
- package/template/apps/api/src/epcis/sources.ts +142 -0
- package/template/apps/api/src/go-live.ts +226 -0
- package/template/apps/api/src/http-error.ts +15 -0
- package/template/apps/api/src/identifiers.ts +1 -1
- package/template/apps/api/src/index-client.ts +131 -6
- package/template/apps/api/src/index-projects.ts +53 -0
- package/template/apps/api/src/lifecycle-authority.ts +49 -0
- package/template/apps/api/src/lifecycle.ts +485 -0
- package/template/apps/api/src/main.ts +10 -2
- package/template/apps/api/src/parties.ts +2 -2
- package/template/apps/api/src/platform.ts +72 -17
- package/template/apps/api/src/portability/commands.ts +224 -0
- package/template/apps/api/src/portability/export.ts +708 -0
- package/template/apps/api/src/portability/package.ts +270 -0
- package/template/apps/api/src/portability/restore.ts +863 -0
- package/template/apps/api/src/profiles.ts +38 -13
- package/template/apps/api/src/reader.ts +172 -3
- package/template/apps/api/src/resolver.ts +159 -0
- package/template/apps/api/src/sector-examples.ts +390 -0
- package/template/apps/api/src/server.ts +253 -60
- package/template/apps/api/src/store.ts +198 -21
- package/template/apps/api/src/validation-engine.ts +172 -0
- package/template/apps/api/src/wallet.ts +30 -17
- package/template/apps/api/src/worker.ts +20 -13
- package/template/apps/api/src/writer.ts +383 -131
- package/template/apps/api/test/bound-http.test.ts +496 -0
- package/template/apps/api/test/bound-profiles.test.ts +547 -0
- package/template/apps/api/test/config.test.ts +148 -3
- package/template/apps/api/test/custody-journal.test.ts +415 -0
- package/template/apps/api/test/custody-recovery-profile.test.ts +224 -0
- package/template/apps/api/test/custom-profile.test.ts +167 -0
- package/template/apps/api/test/env-file.test.ts +53 -0
- package/template/apps/api/test/epcis-fixtures.ts +270 -0
- package/template/apps/api/test/epcis-http.test.ts +1179 -0
- package/template/apps/api/test/epcis-mongo-storage.test.ts +313 -0
- package/template/apps/api/test/epcis-separation.test.ts +253 -0
- package/template/apps/api/test/epcis-web.test.ts +230 -0
- package/template/apps/api/test/exit-exercise.test.ts +1038 -0
- package/template/apps/api/test/external-index.test.ts +3 -2
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/background.ttl +33 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/binding.json +141 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/context.jsonld +36 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/product.schema.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/shapes.ttl +112 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/conflicting-gtin.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/conflicting-serial.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/granularity-mismatch.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/item-gtin-13.json +43 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/item.json +42 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/missing-required-property.json +43 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/model-as-subject.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/no-passport-identifier.json +43 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/other-product.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/part-not-dishwasher-safe.json +45 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/altered-artefact.json +19 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/altered-background.ttl +33 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/conflicting-binding.json +141 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/conflicting-second-registration.json +19 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/untrusted-binding.json +13 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/unlisted-context.json +47 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/wrong-binding-digest.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/binding.json +88 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/product.schema.json +25 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/item.json +26 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/missing-required-property.json +27 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/no-passport-identifier.json +27 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/other-product.json +28 -0
- package/template/apps/api/test/go-live.test.ts +179 -0
- package/template/apps/api/test/gs1-global-setup.ts +33 -0
- package/template/apps/api/test/gs1-test-env.ts +5 -0
- package/template/apps/api/test/identifier-host.test.ts +256 -0
- package/template/apps/api/test/index-projects.test.ts +81 -0
- package/template/apps/api/test/lifecycle-claims.test.ts +546 -0
- package/template/apps/api/test/lifecycle-fixtures.ts +167 -0
- package/template/apps/api/test/lifecycle.test.ts +17 -6
- package/template/apps/api/test/manifest-notice.test.ts +36 -0
- package/template/apps/api/test/network-guard.ts +113 -0
- package/template/apps/api/test/portability.test.ts +655 -0
- package/template/apps/api/test/profile-bundle-resolver.test.ts +198 -0
- package/template/apps/api/test/retired-profiles.test.ts +216 -0
- package/template/apps/api/test/sector-cutover.test.ts +95 -0
- package/template/apps/api/test/sector-forms.test.ts +420 -0
- package/template/apps/api/test/unjoined-index.test.ts +62 -0
- package/template/apps/api/test/validation-engine.test.ts +328 -0
- package/template/apps/api/test/wallet-monitor.test.ts +38 -0
- package/template/apps/api/test/writer-journal.test.ts +327 -0
- package/template/apps/api/vitest.config.ts +3 -0
- package/template/apps/web/src/app.tsx +8 -4
- package/template/apps/web/src/components/bound/bound-passport-form.tsx +368 -0
- package/template/apps/web/src/components/bound/field-view.tsx +237 -0
- package/template/apps/web/src/components/bound/pieces.tsx +169 -0
- package/template/apps/web/src/components/bound/readings.tsx +152 -0
- package/template/apps/web/src/components/bound/structured-value.tsx +114 -0
- package/template/apps/web/src/components/claim-dialog.tsx +344 -0
- package/template/apps/web/src/components/epcis-events.tsx +119 -0
- package/template/apps/web/src/components/layout.tsx +17 -0
- package/template/apps/web/src/components/lifecycle-claims.tsx +199 -0
- package/template/apps/web/src/components/passport-form.tsx +2 -2
- package/template/apps/web/src/components/read-passport.tsx +4 -3
- package/template/apps/web/src/components/reading.tsx +32 -39
- package/template/apps/web/src/lib/api.ts +136 -26
- package/template/apps/web/src/lib/bound/battery-form.ts +269 -0
- package/template/apps/web/src/lib/bound/display.ts +122 -0
- package/template/apps/web/src/lib/bound/fields.ts +128 -0
- package/template/apps/web/src/lib/bound/form-model.ts +521 -0
- package/template/apps/web/src/lib/bound/forms.ts +15 -0
- package/template/apps/web/src/lib/bound/identity.ts +48 -0
- package/template/apps/web/src/lib/bound/textile-form.ts +236 -0
- package/template/apps/web/src/lib/bound/units.ts +37 -0
- package/template/apps/web/src/lib/epcis.ts +345 -0
- package/template/apps/web/src/lib/format.ts +27 -4
- package/template/apps/web/src/lib/lifecycle.ts +350 -0
- package/template/apps/web/src/pages/accept.tsx +8 -3
- package/template/apps/web/src/pages/events.tsx +388 -0
- package/template/apps/web/src/pages/new-passport.tsx +25 -2
- package/template/apps/web/src/pages/operations.tsx +22 -3
- package/template/apps/web/src/pages/passport.tsx +226 -162
- package/template/apps/web/src/pages/public-passport.tsx +50 -10
- package/template/apps/web/src/pages/wallet.tsx +1 -1
- package/template/apps/web/vite.config.ts +12 -4
- package/template/deploy/compose.yml +14 -2
- package/template/package.json +9 -3
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The document identifies the model, with no serial, inside an item passport.",
|
|
3
|
+
"kind": "payload",
|
|
4
|
+
"passportId": "https://passports.example/01/09521234543213/21/BTL-0001",
|
|
5
|
+
"payload": {
|
|
6
|
+
"notice": "Demonstration record: this passport describes no real product.",
|
|
7
|
+
"profile": "example-bottle",
|
|
8
|
+
"profile_version": 1,
|
|
9
|
+
"profile_binding_sha256": "5c63b1ad50c8c6fc299199fa80fccf47029d76db616213cd671d86844e204456",
|
|
10
|
+
"product": {
|
|
11
|
+
"@context": "https://profiles.example/bottle/v1/context.jsonld",
|
|
12
|
+
"id": "https://id.example/01/09521234543213",
|
|
13
|
+
"type": "Bottle",
|
|
14
|
+
"name": "Trail bottle 750",
|
|
15
|
+
"gtin": "09521234543213",
|
|
16
|
+
"serialNumber": "BTL-0001",
|
|
17
|
+
"granularity": "item",
|
|
18
|
+
"model": "https://id.example/01/09521234543213",
|
|
19
|
+
"batch": "LOT-2026-07",
|
|
20
|
+
"capacityMillilitres": 750,
|
|
21
|
+
"recycledContentPercent": 60,
|
|
22
|
+
"dishwasherSafe": true,
|
|
23
|
+
"parts": [
|
|
24
|
+
{
|
|
25
|
+
"type": "Part",
|
|
26
|
+
"name": "Body",
|
|
27
|
+
"material": "stainless-steel",
|
|
28
|
+
"massGrams": 240
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "Part",
|
|
32
|
+
"name": "Cap",
|
|
33
|
+
"material": "polypropylene",
|
|
34
|
+
"massGrams": 35
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"expected": {
|
|
40
|
+
"status": "fail",
|
|
41
|
+
"cause": "product-identity-mismatch",
|
|
42
|
+
"step": "passport-identity"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "A valid document checked without saying which passport carries it. The identity check cannot run, so the answer is unknown and never pass.",
|
|
3
|
+
"kind": "payload",
|
|
4
|
+
"payload": {
|
|
5
|
+
"notice": "Demonstration record: this passport describes no real product.",
|
|
6
|
+
"profile": "example-bottle",
|
|
7
|
+
"profile_version": 1,
|
|
8
|
+
"profile_binding_sha256": "5c63b1ad50c8c6fc299199fa80fccf47029d76db616213cd671d86844e204456",
|
|
9
|
+
"product": {
|
|
10
|
+
"@context": "https://profiles.example/bottle/v1/context.jsonld",
|
|
11
|
+
"id": "https://id.example/01/09521234543213/21/BTL-0001",
|
|
12
|
+
"type": "Bottle",
|
|
13
|
+
"name": "Trail bottle 750",
|
|
14
|
+
"gtin": "09521234543213",
|
|
15
|
+
"serialNumber": "BTL-0001",
|
|
16
|
+
"granularity": "item",
|
|
17
|
+
"model": "https://id.example/01/09521234543213",
|
|
18
|
+
"batch": "LOT-2026-07",
|
|
19
|
+
"capacityMillilitres": 750,
|
|
20
|
+
"recycledContentPercent": 60,
|
|
21
|
+
"dishwasherSafe": true,
|
|
22
|
+
"parts": [
|
|
23
|
+
{
|
|
24
|
+
"type": "Part",
|
|
25
|
+
"name": "Body",
|
|
26
|
+
"material": "stainless-steel",
|
|
27
|
+
"massGrams": 240
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "Part",
|
|
31
|
+
"name": "Cap",
|
|
32
|
+
"material": "polypropylene",
|
|
33
|
+
"massGrams": 35
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"expected": {
|
|
39
|
+
"status": "unknown",
|
|
40
|
+
"cause": "product-identity-unavailable",
|
|
41
|
+
"step": "passport-identity"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/other-product.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Another bottle's valid document inside this passport. Every profile rule holds, and the document is about serial BTL-0002.",
|
|
3
|
+
"kind": "payload",
|
|
4
|
+
"passportId": "https://passports.example/01/09521234543213/21/BTL-0001",
|
|
5
|
+
"payload": {
|
|
6
|
+
"notice": "Demonstration record: this passport describes no real product.",
|
|
7
|
+
"profile": "example-bottle",
|
|
8
|
+
"profile_version": 1,
|
|
9
|
+
"profile_binding_sha256": "5c63b1ad50c8c6fc299199fa80fccf47029d76db616213cd671d86844e204456",
|
|
10
|
+
"product": {
|
|
11
|
+
"@context": "https://profiles.example/bottle/v1/context.jsonld",
|
|
12
|
+
"id": "https://id.example/01/09521234543213/21/BTL-0002",
|
|
13
|
+
"type": "Bottle",
|
|
14
|
+
"name": "Trail bottle 750",
|
|
15
|
+
"gtin": "09521234543213",
|
|
16
|
+
"serialNumber": "BTL-0002",
|
|
17
|
+
"granularity": "item",
|
|
18
|
+
"model": "https://id.example/01/09521234543213",
|
|
19
|
+
"batch": "LOT-2026-07",
|
|
20
|
+
"capacityMillilitres": 750,
|
|
21
|
+
"recycledContentPercent": 60,
|
|
22
|
+
"dishwasherSafe": true,
|
|
23
|
+
"parts": [
|
|
24
|
+
{
|
|
25
|
+
"type": "Part",
|
|
26
|
+
"name": "Body",
|
|
27
|
+
"material": "stainless-steel",
|
|
28
|
+
"massGrams": 240
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "Part",
|
|
32
|
+
"name": "Cap",
|
|
33
|
+
"material": "polypropylene",
|
|
34
|
+
"massGrams": 35
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"expected": {
|
|
40
|
+
"status": "fail",
|
|
41
|
+
"cause": "product-identity-mismatch",
|
|
42
|
+
"step": "passport-identity"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "A bottle declared dishwasher safe with a bamboo cap. The schema and every core constraint hold. Only the SPARQL constraint, which reads the background file, finds it.",
|
|
3
|
+
"kind": "payload",
|
|
4
|
+
"passportId": "https://passports.example/01/09521234543213/21/BTL-0001",
|
|
5
|
+
"payload": {
|
|
6
|
+
"notice": "Demonstration record: this passport describes no real product.",
|
|
7
|
+
"profile": "example-bottle",
|
|
8
|
+
"profile_version": 1,
|
|
9
|
+
"profile_binding_sha256": "5c63b1ad50c8c6fc299199fa80fccf47029d76db616213cd671d86844e204456",
|
|
10
|
+
"product": {
|
|
11
|
+
"@context": "https://profiles.example/bottle/v1/context.jsonld",
|
|
12
|
+
"id": "https://id.example/01/09521234543213/21/BTL-0001",
|
|
13
|
+
"type": "Bottle",
|
|
14
|
+
"name": "Trail bottle 750",
|
|
15
|
+
"gtin": "09521234543213",
|
|
16
|
+
"serialNumber": "BTL-0001",
|
|
17
|
+
"granularity": "item",
|
|
18
|
+
"model": "https://id.example/01/09521234543213",
|
|
19
|
+
"batch": "LOT-2026-07",
|
|
20
|
+
"capacityMillilitres": 750,
|
|
21
|
+
"recycledContentPercent": 60,
|
|
22
|
+
"dishwasherSafe": true,
|
|
23
|
+
"parts": [
|
|
24
|
+
{
|
|
25
|
+
"type": "Part",
|
|
26
|
+
"name": "Body",
|
|
27
|
+
"material": "stainless-steel",
|
|
28
|
+
"massGrams": 240
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "Part",
|
|
32
|
+
"name": "Cap",
|
|
33
|
+
"material": "bamboo",
|
|
34
|
+
"massGrams": 20
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"expected": {
|
|
40
|
+
"status": "fail",
|
|
41
|
+
"cause": "profile-rule-violation",
|
|
42
|
+
"step": "shacl",
|
|
43
|
+
"constraint": "SPARQLConstraintComponent"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The background file with one fact changed and its length kept: bamboo is said to withstand a dishwasher. Registration refuses it and names the file.",
|
|
3
|
+
"kind": "registration",
|
|
4
|
+
"trustedBindingDigests": [
|
|
5
|
+
"5c63b1ad50c8c6fc299199fa80fccf47029d76db616213cd671d86844e204456"
|
|
6
|
+
],
|
|
7
|
+
"register": [
|
|
8
|
+
{
|
|
9
|
+
"binding": "binding.json",
|
|
10
|
+
"substitute": {
|
|
11
|
+
"background.ttl": "vectors/registration/altered-background.ttl"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"expected": {
|
|
16
|
+
"refusal": "artefact-digest-mismatch",
|
|
17
|
+
"artefact": "background.ttl"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Background facts for the example bottle profile, version 1: the materials a
|
|
2
|
+
# part may be made of and whether each withstands a dishwasher. The shapes
|
|
3
|
+
# read these facts beside the product document.
|
|
4
|
+
|
|
5
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
6
|
+
@prefix bottle: <https://profiles.example/bottle/v1#> .
|
|
7
|
+
|
|
8
|
+
bottle:Material a rdfs:Class ;
|
|
9
|
+
rdfs:label "Material"@en .
|
|
10
|
+
|
|
11
|
+
bottle:stainless-steel a bottle:Material ;
|
|
12
|
+
rdfs:label "Stainless steel"@en ;
|
|
13
|
+
bottle:withstandsDishwasher true .
|
|
14
|
+
|
|
15
|
+
bottle:glass a bottle:Material ;
|
|
16
|
+
rdfs:label "Glass"@en ;
|
|
17
|
+
bottle:withstandsDishwasher true .
|
|
18
|
+
|
|
19
|
+
bottle:polypropylene a bottle:Material ;
|
|
20
|
+
rdfs:label "Polypropylene"@en ;
|
|
21
|
+
bottle:withstandsDishwasher true .
|
|
22
|
+
|
|
23
|
+
bottle:silicone a bottle:Material ;
|
|
24
|
+
rdfs:label "Silicone"@en ;
|
|
25
|
+
bottle:withstandsDishwasher true .
|
|
26
|
+
|
|
27
|
+
bottle:bamboo a bottle:Material ;
|
|
28
|
+
rdfs:label "Bamboo"@en ;
|
|
29
|
+
bottle:withstandsDishwasher true .
|
|
30
|
+
|
|
31
|
+
bottle:cork a bottle:Material ;
|
|
32
|
+
rdfs:label "Cork"@en ;
|
|
33
|
+
bottle:withstandsDishwasher false .
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bindingVersion": "1",
|
|
3
|
+
"id": "example-bottle",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"profile": "example-bottle@1",
|
|
6
|
+
"title": "Example refillable bottle, serialised item, a second edition under the same version",
|
|
7
|
+
"scope": "An example written for this repository to show how a custom profile is bound. The name states which data model the product document uses. It makes no claim that a product or a passport complies with any law or standard.",
|
|
8
|
+
"publisher": {
|
|
9
|
+
"name": "Example publisher",
|
|
10
|
+
"registration": "local"
|
|
11
|
+
},
|
|
12
|
+
"source": {
|
|
13
|
+
"name": "Digital Product Passport standard, example profiles",
|
|
14
|
+
"repository": "https://github.com/bsv-blockchain/dpp",
|
|
15
|
+
"licence": "Apache-2.0",
|
|
16
|
+
"notices": []
|
|
17
|
+
},
|
|
18
|
+
"granularity": "item",
|
|
19
|
+
"payload": {
|
|
20
|
+
"root": "/product",
|
|
21
|
+
"mediaType": "application/ld+json",
|
|
22
|
+
"documents": "one-self-contained"
|
|
23
|
+
},
|
|
24
|
+
"artefacts": [
|
|
25
|
+
{
|
|
26
|
+
"role": "schema",
|
|
27
|
+
"path": "product.schema.json",
|
|
28
|
+
"mediaType": "application/schema+json",
|
|
29
|
+
"byteLength": 2072,
|
|
30
|
+
"sha256": "c0246d22d4bfcbb8a24d2c06e047234c313d026ca376f0a34504f3350a31659e",
|
|
31
|
+
"licence": "Apache-2.0"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"role": "context",
|
|
35
|
+
"path": "context.jsonld",
|
|
36
|
+
"uri": "https://profiles.example/bottle/v1/context.jsonld",
|
|
37
|
+
"mediaType": "application/ld+json",
|
|
38
|
+
"byteLength": 1137,
|
|
39
|
+
"sha256": "51c2663755c6c1d856a0ee2ba2fedc922a22e35b14eb1ef0894e670af119f699",
|
|
40
|
+
"licence": "Apache-2.0"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"role": "shapes",
|
|
44
|
+
"path": "shapes.ttl",
|
|
45
|
+
"mediaType": "text/turtle",
|
|
46
|
+
"byteLength": 2846,
|
|
47
|
+
"sha256": "d7d4cb7951e7c4e6269c41a0ed824ed4280b1d3ebc9d707c97f6f091d7ed592f",
|
|
48
|
+
"licence": "Apache-2.0"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"role": "background",
|
|
52
|
+
"path": "background.ttl",
|
|
53
|
+
"mediaType": "text/turtle",
|
|
54
|
+
"byteLength": 1001,
|
|
55
|
+
"sha256": "9ee7ed8eff1f11b075cf142ae309522f410337a54189b44569a6f60cd45c99b3",
|
|
56
|
+
"licence": "Apache-2.0"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"validation": {
|
|
60
|
+
"steps": [
|
|
61
|
+
"json-schema",
|
|
62
|
+
"json-ld-expand",
|
|
63
|
+
"shacl",
|
|
64
|
+
"passport-identity"
|
|
65
|
+
],
|
|
66
|
+
"engine": {
|
|
67
|
+
"requires": [
|
|
68
|
+
"json-schema-2020-12",
|
|
69
|
+
"shacl-core",
|
|
70
|
+
"shacl-sparql-constraints"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"blockingSeverities": [
|
|
74
|
+
"Violation"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"identity": {
|
|
78
|
+
"scheme": "gs1-digital-link",
|
|
79
|
+
"comparison": "gs1-key-tuple",
|
|
80
|
+
"subject": {
|
|
81
|
+
"pointers": [
|
|
82
|
+
"/product/id"
|
|
83
|
+
],
|
|
84
|
+
"keys": [
|
|
85
|
+
"01",
|
|
86
|
+
"21"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"mustEqual": [
|
|
90
|
+
{
|
|
91
|
+
"pointer": "/product/gtin",
|
|
92
|
+
"part": "gtin"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"pointer": "/product/serialNumber",
|
|
96
|
+
"part": "serial"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"mustNotContradict": [
|
|
100
|
+
{
|
|
101
|
+
"pointer": "/product/model"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"granularityMember": {
|
|
105
|
+
"pointer": "/product/granularity",
|
|
106
|
+
"whenPresent": "item"
|
|
107
|
+
},
|
|
108
|
+
"related": [
|
|
109
|
+
{
|
|
110
|
+
"pointer": "/product/batch",
|
|
111
|
+
"relation": "batch"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"vectors": {
|
|
116
|
+
"positive": [
|
|
117
|
+
"vectors/item.json",
|
|
118
|
+
"vectors/item-gtin-13.json"
|
|
119
|
+
],
|
|
120
|
+
"negative": [
|
|
121
|
+
"vectors/other-product.json",
|
|
122
|
+
"vectors/conflicting-serial.json",
|
|
123
|
+
"vectors/conflicting-gtin.json",
|
|
124
|
+
"vectors/model-as-subject.json",
|
|
125
|
+
"vectors/granularity-mismatch.json",
|
|
126
|
+
"vectors/missing-required-property.json",
|
|
127
|
+
"vectors/unlisted-context.json",
|
|
128
|
+
"vectors/no-passport-identifier.json",
|
|
129
|
+
"vectors/wrong-binding-digest.json",
|
|
130
|
+
"vectors/part-not-dishwasher-safe.json",
|
|
131
|
+
"vectors/registration/altered-artefact.json",
|
|
132
|
+
"vectors/registration/untrusted-binding.json",
|
|
133
|
+
"vectors/registration/conflicting-second-registration.json"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"baseline": "native-baseline@2",
|
|
137
|
+
"roles": [
|
|
138
|
+
"passport-writer",
|
|
139
|
+
"passport-reader"
|
|
140
|
+
]
|
|
141
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "A second binding for example-bottle@1 with other bytes, registered after the first. Both digests are trusted, and the version is already taken.",
|
|
3
|
+
"kind": "registration",
|
|
4
|
+
"trustedBindingDigests": [
|
|
5
|
+
"5c63b1ad50c8c6fc299199fa80fccf47029d76db616213cd671d86844e204456",
|
|
6
|
+
"4017a5a8b08d1a227671effa6c930f24f07d3c1ddf6e28ebe63053435fcc3dee"
|
|
7
|
+
],
|
|
8
|
+
"register": [
|
|
9
|
+
{
|
|
10
|
+
"binding": "binding.json"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"binding": "vectors/registration/conflicting-binding.json"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"expected": {
|
|
17
|
+
"refusal": "binding-conflict"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The binding registered with a registry whose trusted list does not hold its digest.",
|
|
3
|
+
"kind": "registration",
|
|
4
|
+
"trustedBindingDigests": [],
|
|
5
|
+
"register": [
|
|
6
|
+
{
|
|
7
|
+
"binding": "binding.json"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"expected": {
|
|
11
|
+
"refusal": "binding-untrusted"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The document names a second context the binding does not list. It is refused and nothing is fetched.",
|
|
3
|
+
"kind": "payload",
|
|
4
|
+
"passportId": "https://passports.example/01/09521234543213/21/BTL-0001",
|
|
5
|
+
"payload": {
|
|
6
|
+
"notice": "Demonstration record: this passport describes no real product.",
|
|
7
|
+
"profile": "example-bottle",
|
|
8
|
+
"profile_version": 1,
|
|
9
|
+
"profile_binding_sha256": "5c63b1ad50c8c6fc299199fa80fccf47029d76db616213cd671d86844e204456",
|
|
10
|
+
"product": {
|
|
11
|
+
"@context": [
|
|
12
|
+
"https://profiles.example/bottle/v1/context.jsonld",
|
|
13
|
+
"https://profiles.example/extras/v1/context.jsonld"
|
|
14
|
+
],
|
|
15
|
+
"id": "https://id.example/01/09521234543213/21/BTL-0001",
|
|
16
|
+
"type": "Bottle",
|
|
17
|
+
"name": "Trail bottle 750",
|
|
18
|
+
"gtin": "09521234543213",
|
|
19
|
+
"serialNumber": "BTL-0001",
|
|
20
|
+
"granularity": "item",
|
|
21
|
+
"model": "https://id.example/01/09521234543213",
|
|
22
|
+
"batch": "LOT-2026-07",
|
|
23
|
+
"capacityMillilitres": 750,
|
|
24
|
+
"recycledContentPercent": 60,
|
|
25
|
+
"dishwasherSafe": true,
|
|
26
|
+
"parts": [
|
|
27
|
+
{
|
|
28
|
+
"type": "Part",
|
|
29
|
+
"name": "Body",
|
|
30
|
+
"material": "stainless-steel",
|
|
31
|
+
"massGrams": 240
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "Part",
|
|
35
|
+
"name": "Cap",
|
|
36
|
+
"material": "polypropylene",
|
|
37
|
+
"massGrams": 35
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"expected": {
|
|
43
|
+
"status": "fail",
|
|
44
|
+
"cause": "profile-rule-violation",
|
|
45
|
+
"step": "json-ld-expand"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "A valid document that declares the digest of another binding. It was written to other rules, so nothing after the digest is checked.",
|
|
3
|
+
"kind": "payload",
|
|
4
|
+
"passportId": "https://passports.example/01/09521234543213/21/BTL-0001",
|
|
5
|
+
"payload": {
|
|
6
|
+
"notice": "Demonstration record: this passport describes no real product.",
|
|
7
|
+
"profile": "example-bottle",
|
|
8
|
+
"profile_version": 1,
|
|
9
|
+
"profile_binding_sha256": "4017a5a8b08d1a227671effa6c930f24f07d3c1ddf6e28ebe63053435fcc3dee",
|
|
10
|
+
"product": {
|
|
11
|
+
"@context": "https://profiles.example/bottle/v1/context.jsonld",
|
|
12
|
+
"id": "https://id.example/01/09521234543213/21/BTL-0001",
|
|
13
|
+
"type": "Bottle",
|
|
14
|
+
"name": "Trail bottle 750",
|
|
15
|
+
"gtin": "09521234543213",
|
|
16
|
+
"serialNumber": "BTL-0001",
|
|
17
|
+
"granularity": "item",
|
|
18
|
+
"model": "https://id.example/01/09521234543213",
|
|
19
|
+
"batch": "LOT-2026-07",
|
|
20
|
+
"capacityMillilitres": 750,
|
|
21
|
+
"recycledContentPercent": 60,
|
|
22
|
+
"dishwasherSafe": true,
|
|
23
|
+
"parts": [
|
|
24
|
+
{
|
|
25
|
+
"type": "Part",
|
|
26
|
+
"name": "Body",
|
|
27
|
+
"material": "stainless-steel",
|
|
28
|
+
"massGrams": 240
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "Part",
|
|
32
|
+
"name": "Cap",
|
|
33
|
+
"material": "polypropylene",
|
|
34
|
+
"massGrams": 35
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"expected": {
|
|
40
|
+
"status": "fail",
|
|
41
|
+
"cause": "profile-binding-mismatch",
|
|
42
|
+
"step": "binding"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bindingVersion": "1",
|
|
3
|
+
"id": "example-notebook",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"profile": "example-notebook@1",
|
|
6
|
+
"title": "Example notebook, serialised item",
|
|
7
|
+
"scope": "An example written for this repository to show how a custom profile is bound. The name states which data model the product document uses. It makes no claim that a product or a passport complies with any law or standard.",
|
|
8
|
+
"publisher": {
|
|
9
|
+
"name": "Example publisher",
|
|
10
|
+
"registration": "local"
|
|
11
|
+
},
|
|
12
|
+
"source": {
|
|
13
|
+
"name": "Digital Product Passport standard, example profiles",
|
|
14
|
+
"repository": "https://github.com/bsv-blockchain/dpp",
|
|
15
|
+
"licence": "Apache-2.0",
|
|
16
|
+
"notices": []
|
|
17
|
+
},
|
|
18
|
+
"granularity": "item",
|
|
19
|
+
"payload": {
|
|
20
|
+
"root": "/product",
|
|
21
|
+
"mediaType": "application/json",
|
|
22
|
+
"documents": "one-self-contained"
|
|
23
|
+
},
|
|
24
|
+
"artefacts": [
|
|
25
|
+
{
|
|
26
|
+
"role": "schema",
|
|
27
|
+
"path": "product.schema.json",
|
|
28
|
+
"mediaType": "application/schema+json",
|
|
29
|
+
"byteLength": 1134,
|
|
30
|
+
"sha256": "0f0e6064346769e6995777e27680e1baf1debc607f16612aaa78bd17e2d36110",
|
|
31
|
+
"licence": "Apache-2.0"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"validation": {
|
|
35
|
+
"steps": [
|
|
36
|
+
"json-schema",
|
|
37
|
+
"passport-identity"
|
|
38
|
+
],
|
|
39
|
+
"engine": {
|
|
40
|
+
"requires": [
|
|
41
|
+
"json-schema-2020-12"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"blockingSeverities": [
|
|
45
|
+
"Violation"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"identity": {
|
|
49
|
+
"scheme": "gs1-digital-link",
|
|
50
|
+
"comparison": "gs1-key-tuple",
|
|
51
|
+
"subject": {
|
|
52
|
+
"pointers": [
|
|
53
|
+
"/product/id"
|
|
54
|
+
],
|
|
55
|
+
"keys": [
|
|
56
|
+
"01",
|
|
57
|
+
"21"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"mustEqual": [
|
|
61
|
+
{
|
|
62
|
+
"pointer": "/product/gtin",
|
|
63
|
+
"part": "gtin"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"pointer": "/product/serialNumber",
|
|
67
|
+
"part": "serial"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"mustNotContradict": [],
|
|
71
|
+
"related": []
|
|
72
|
+
},
|
|
73
|
+
"vectors": {
|
|
74
|
+
"positive": [
|
|
75
|
+
"vectors/item.json"
|
|
76
|
+
],
|
|
77
|
+
"negative": [
|
|
78
|
+
"vectors/other-product.json",
|
|
79
|
+
"vectors/missing-required-property.json",
|
|
80
|
+
"vectors/no-passport-identifier.json"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"baseline": "native-baseline@2",
|
|
84
|
+
"roles": [
|
|
85
|
+
"passport-writer",
|
|
86
|
+
"passport-reader"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://profiles.example/notebook/v1/product.schema.json",
|
|
4
|
+
"title": "Example notebook, version 1: the product document",
|
|
5
|
+
"description": "The product document a passport carries under example-notebook@1. This profile is plain JSON: it has a schema and no context or shapes.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["id", "title", "gtin", "serialNumber", "pages", "ruling"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"id": { "type": "string", "minLength": 1 },
|
|
11
|
+
"title": { "type": "string", "minLength": 1 },
|
|
12
|
+
"gtin": { "type": "string", "pattern": "^([0-9]{8}|[0-9]{12,14})$" },
|
|
13
|
+
"serialNumber": { "type": "string", "minLength": 1, "maxLength": 20 },
|
|
14
|
+
"pages": { "type": "integer", "minimum": 1 },
|
|
15
|
+
"ruling": { "enum": ["plain", "lined", "squared", "dotted"] },
|
|
16
|
+
"paper": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"recycledPercent": { "type": "number", "minimum": 0, "maximum": 100 },
|
|
21
|
+
"gramsPerSquareMetre": { "type": "number", "exclusiveMinimum": 0 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "A notebook that satisfies the schema, under its own passport.",
|
|
3
|
+
"kind": "payload",
|
|
4
|
+
"passportId": "https://passports.example/01/09529876000101/21/NB-0001",
|
|
5
|
+
"payload": {
|
|
6
|
+
"notice": "Demonstration record: this passport describes no real product.",
|
|
7
|
+
"profile": "example-notebook",
|
|
8
|
+
"profile_version": 1,
|
|
9
|
+
"profile_binding_sha256": "5261083e202d8a1acc6f4d45ba13fcbaa0e268511410fafde2e48251c9f4e7b4",
|
|
10
|
+
"product": {
|
|
11
|
+
"id": "https://id.example/01/09529876000101/21/NB-0001",
|
|
12
|
+
"title": "Field notebook A5",
|
|
13
|
+
"gtin": "09529876000101",
|
|
14
|
+
"serialNumber": "NB-0001",
|
|
15
|
+
"pages": 96,
|
|
16
|
+
"ruling": "dotted",
|
|
17
|
+
"paper": {
|
|
18
|
+
"recycledPercent": 100,
|
|
19
|
+
"gramsPerSquareMetre": 90
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"expected": {
|
|
24
|
+
"status": "pass"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "The page count is missing.",
|
|
3
|
+
"kind": "payload",
|
|
4
|
+
"passportId": "https://passports.example/01/09529876000101/21/NB-0001",
|
|
5
|
+
"payload": {
|
|
6
|
+
"notice": "Demonstration record: this passport describes no real product.",
|
|
7
|
+
"profile": "example-notebook",
|
|
8
|
+
"profile_version": 1,
|
|
9
|
+
"profile_binding_sha256": "5261083e202d8a1acc6f4d45ba13fcbaa0e268511410fafde2e48251c9f4e7b4",
|
|
10
|
+
"product": {
|
|
11
|
+
"id": "https://id.example/01/09529876000101/21/NB-0001",
|
|
12
|
+
"title": "Field notebook A5",
|
|
13
|
+
"gtin": "09529876000101",
|
|
14
|
+
"serialNumber": "NB-0001",
|
|
15
|
+
"ruling": "dotted",
|
|
16
|
+
"paper": {
|
|
17
|
+
"recycledPercent": 100,
|
|
18
|
+
"gramsPerSquareMetre": 90
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"expected": {
|
|
23
|
+
"status": "fail",
|
|
24
|
+
"cause": "schema-invalid",
|
|
25
|
+
"step": "json-schema"
|
|
26
|
+
}
|
|
27
|
+
}
|