@authorizedretailers/spec 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.
Files changed (98) hide show
  1. package/LICENSE +202 -0
  2. package/LICENSE-SPEC +396 -0
  3. package/README.md +130 -0
  4. package/dist/constants.d.ts +6 -0
  5. package/dist/constants.js +7 -0
  6. package/dist/identity.d.ts +27 -0
  7. package/dist/identity.js +92 -0
  8. package/dist/index.d.ts +8 -0
  9. package/dist/index.js +8 -0
  10. package/dist/jcs.d.ts +5 -0
  11. package/dist/jcs.js +47 -0
  12. package/dist/jws.d.ts +42 -0
  13. package/dist/jws.js +90 -0
  14. package/dist/published.d.ts +15 -0
  15. package/dist/published.js +15 -0
  16. package/dist/schemas.d.ts +519 -0
  17. package/dist/schemas.js +662 -0
  18. package/dist/timestamp.d.ts +6 -0
  19. package/dist/timestamp.js +26 -0
  20. package/dist/types.d.ts +116 -0
  21. package/dist/types.js +2 -0
  22. package/dist/validate.d.ts +28 -0
  23. package/dist/validate.js +147 -0
  24. package/fixtures/file/invalid/full-all-mixed.json +47 -0
  25. package/fixtures/file/invalid/full-amazon-missing-seller-id.json +45 -0
  26. package/fixtures/file/invalid/full-attached-jws.json +50 -0
  27. package/fixtures/file/invalid/full-authorization-expires-after-file.json +46 -0
  28. package/fixtures/file/invalid/full-duplicate-authorization-id.json +80 -0
  29. package/fixtures/file/invalid/full-empty-territories.json +43 -0
  30. package/fixtures/file/invalid/full-expires-before-issued.json +46 -0
  31. package/fixtures/file/invalid/full-expiry-over-180-days.json +46 -0
  32. package/fixtures/file/invalid/full-extra-property.json +47 -0
  33. package/fixtures/file/invalid/full-impossible-date.json +46 -0
  34. package/fixtures/file/invalid/full-lowercase-territory.json +45 -0
  35. package/fixtures/file/invalid/full-missing-authorization-expires.json +45 -0
  36. package/fixtures/file/invalid/full-missing-file-expires.json +45 -0
  37. package/fixtures/file/invalid/full-missing-product-lines.json +43 -0
  38. package/fixtures/file/invalid/full-missing-scope.json +37 -0
  39. package/fixtures/file/invalid/full-missing-territories.json +42 -0
  40. package/fixtures/file/invalid/full-name-only-retailer.json +30 -0
  41. package/fixtures/file/invalid/full-no-channels.json +31 -0
  42. package/fixtures/file/invalid/full-non-utc-timestamp.json +46 -0
  43. package/fixtures/file/invalid/full-physical-missing-country.json +50 -0
  44. package/fixtures/file/invalid/full-signature-missing-kid.json +49 -0
  45. package/fixtures/file/invalid/full-unknown-channel-type.json +50 -0
  46. package/fixtures/file/invalid/full-web-domain-is-url.json +46 -0
  47. package/fixtures/file/invalid/full-web-missing-domain.json +45 -0
  48. package/fixtures/file/invalid/full-wildcard-mixed.json +46 -0
  49. package/fixtures/file/invalid/full-wrong-spec.json +46 -0
  50. package/fixtures/file/invalid/pointer-http-url.json +9 -0
  51. package/fixtures/file/invalid/private-missing-verify.json +8 -0
  52. package/fixtures/file/invalid/private-with-authorizations.json +45 -0
  53. package/fixtures/file/invalid/unknown-form.json +9 -0
  54. package/fixtures/file/valid/full-fractional-seconds.json +46 -0
  55. package/fixtures/file/valid/full-max-expiry.json +46 -0
  56. package/fixtures/file/valid/full-no-authorizations.json +11 -0
  57. package/fixtures/file/valid/full-signed.json +50 -0
  58. package/fixtures/file/valid/full-unsigned-handwritten.json +46 -0
  59. package/fixtures/file/valid/full-worldwide-physical-proposed.json +82 -0
  60. package/fixtures/file/valid/pointer.json +9 -0
  61. package/fixtures/file/valid/private.json +9 -0
  62. package/fixtures/manifest.json +434 -0
  63. package/fixtures/verify-request/invalid/domain-with-scheme.json +10 -0
  64. package/fixtures/verify-request/invalid/missing-channel.json +5 -0
  65. package/fixtures/verify-request/invalid/physical-channel.json +10 -0
  66. package/fixtures/verify-request/invalid/retailer-name-only.json +6 -0
  67. package/fixtures/verify-request/invalid/wildcard-territory.json +10 -0
  68. package/fixtures/verify-request/valid/amazon.json +10 -0
  69. package/fixtures/verify-request/valid/web-no-product-line.json +8 -0
  70. package/fixtures/verify-response/invalid/authorized-missing-authorization-id.json +12 -0
  71. package/fixtures/verify-response/invalid/missing-observed.json +12 -0
  72. package/fixtures/verify-response/invalid/missing-signature.json +9 -0
  73. package/fixtures/verify-response/invalid/missing-valid-until.json +12 -0
  74. package/fixtures/verify-response/invalid/observed-without-last-seen.json +13 -0
  75. package/fixtures/verify-response/invalid/unknown-status.json +13 -0
  76. package/fixtures/verify-response/invalid/unlisted-observed.json +13 -0
  77. package/fixtures/verify-response/invalid/unlisted-with-authorization-id.json +12 -0
  78. package/fixtures/verify-response/invalid/unlisted-with-reason.json +12 -0
  79. package/fixtures/verify-response/invalid/valid-until-before-checked.json +13 -0
  80. package/fixtures/verify-response/invalid/valid-until-over-24h.json +13 -0
  81. package/fixtures/verify-response/invalid/with-tier.json +14 -0
  82. package/fixtures/verify-response/valid/authorized-observed.json +15 -0
  83. package/fixtures/verify-response/valid/authorized.json +13 -0
  84. package/fixtures/verify-response/valid/brand-unverified-no-reason.json +11 -0
  85. package/fixtures/verify-response/valid/brand-unverified-reason.json +12 -0
  86. package/fixtures/verify-response/valid/disputed.json +13 -0
  87. package/fixtures/verify-response/valid/expired.json +13 -0
  88. package/fixtures/verify-response/valid/unlisted.json +11 -0
  89. package/fixtures/verify-response/valid/with-signal.json +19 -0
  90. package/package.json +76 -0
  91. package/schemas/common.json +170 -0
  92. package/schemas/file-full.json +23 -0
  93. package/schemas/file-pointer.json +14 -0
  94. package/schemas/file-private.json +14 -0
  95. package/schemas/file.json +13 -0
  96. package/schemas/verify-request.json +18 -0
  97. package/schemas/verify-response.json +61 -0
  98. package/spec/spec-v0.1.md +282 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web",
30
+ "domain": "https://retailer.example/"
31
+ }
32
+ ],
33
+ "scope": {
34
+ "territories": [
35
+ "US",
36
+ "CA"
37
+ ],
38
+ "product_lines": [
39
+ "all"
40
+ ]
41
+ },
42
+ "proposed_by": null,
43
+ "expires": "2026-12-22T00:00:00Z"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web"
30
+ }
31
+ ],
32
+ "scope": {
33
+ "territories": [
34
+ "US",
35
+ "CA"
36
+ ],
37
+ "product_lines": [
38
+ "all"
39
+ ]
40
+ },
41
+ "proposed_by": null,
42
+ "expires": "2026-12-22T00:00:00Z"
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web",
30
+ "domain": "retailer.example"
31
+ }
32
+ ],
33
+ "scope": {
34
+ "territories": [
35
+ "*",
36
+ "US"
37
+ ],
38
+ "product_lines": [
39
+ "all"
40
+ ]
41
+ },
42
+ "proposed_by": null,
43
+ "expires": "2026-12-22T00:00:00Z"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "spec": "authorized-retailers/1.0",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web",
30
+ "domain": "retailer.example"
31
+ }
32
+ ],
33
+ "scope": {
34
+ "territories": [
35
+ "US",
36
+ "CA"
37
+ ],
38
+ "product_lines": [
39
+ "all"
40
+ ]
41
+ },
42
+ "proposed_by": null,
43
+ "expires": "2026-12-22T00:00:00Z"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "pointer",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "list": "http://authorizedretailers.ai/v0/brands/brand.example/list"
9
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "private",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ }
8
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "private",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "verify": "https://authorizedretailers.ai/v0/verify",
9
+ "authorizations": [
10
+ {
11
+ "id": "auth_01J9X2",
12
+ "retailer": {
13
+ "name": "Example Retail LLC",
14
+ "entity_id": "ent_7Q4M"
15
+ },
16
+ "channels": [
17
+ {
18
+ "type": "amazon",
19
+ "marketplace": "US",
20
+ "seller_id": "A1B2C3D4E5F6G7"
21
+ },
22
+ {
23
+ "type": "walmart",
24
+ "marketplace": "US",
25
+ "seller_id": "101234567"
26
+ },
27
+ {
28
+ "type": "web",
29
+ "domain": "retailer.example"
30
+ }
31
+ ],
32
+ "scope": {
33
+ "territories": [
34
+ "US",
35
+ "CA"
36
+ ],
37
+ "product_lines": [
38
+ "all"
39
+ ]
40
+ },
41
+ "proposed_by": null,
42
+ "expires": "2026-12-22T00:00:00Z"
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "partial",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "verify": "https://authorizedretailers.ai/v0/verify"
9
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00.123Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web",
30
+ "domain": "retailer.example"
31
+ }
32
+ ],
33
+ "scope": {
34
+ "territories": [
35
+ "US",
36
+ "CA"
37
+ ],
38
+ "product_lines": [
39
+ "all"
40
+ ]
41
+ },
42
+ "proposed_by": null,
43
+ "expires": "2026-12-22T00:00:00Z"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2027-03-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web",
30
+ "domain": "retailer.example"
31
+ }
32
+ ],
33
+ "scope": {
34
+ "territories": [
35
+ "US",
36
+ "CA"
37
+ ],
38
+ "product_lines": [
39
+ "all"
40
+ ]
41
+ },
42
+ "proposed_by": null,
43
+ "expires": "2026-12-22T00:00:00Z"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": []
11
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web",
30
+ "domain": "retailer.example"
31
+ }
32
+ ],
33
+ "scope": {
34
+ "territories": [
35
+ "US",
36
+ "CA"
37
+ ],
38
+ "product_lines": [
39
+ "all"
40
+ ]
41
+ },
42
+ "proposed_by": null,
43
+ "expires": "2026-12-22T00:00:00Z"
44
+ }
45
+ ],
46
+ "signature": {
47
+ "kid": "ar-2026-09",
48
+ "jws": "eyJhbGciOiJFZERTQSIsImtpZCI6ImFyLTIwMjYtMDkifQ..c2lnbmF0dXJlLXBsYWNlaG9sZGVy"
49
+ }
50
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web",
30
+ "domain": "retailer.example"
31
+ }
32
+ ],
33
+ "scope": {
34
+ "territories": [
35
+ "US",
36
+ "CA"
37
+ ],
38
+ "product_lines": [
39
+ "all"
40
+ ]
41
+ },
42
+ "proposed_by": null,
43
+ "expires": "2026-12-22T00:00:00Z"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "full",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "issued": "2026-09-23T00:00:00Z",
9
+ "expires": "2026-12-22T00:00:00Z",
10
+ "authorizations": [
11
+ {
12
+ "id": "auth_01J9X2",
13
+ "retailer": {
14
+ "name": "Example Retail LLC",
15
+ "entity_id": "ent_7Q4M"
16
+ },
17
+ "channels": [
18
+ {
19
+ "type": "amazon",
20
+ "marketplace": "US",
21
+ "seller_id": "A1B2C3D4E5F6G7"
22
+ },
23
+ {
24
+ "type": "walmart",
25
+ "marketplace": "US",
26
+ "seller_id": "101234567"
27
+ },
28
+ {
29
+ "type": "web",
30
+ "domain": "retailer.example"
31
+ }
32
+ ],
33
+ "scope": {
34
+ "territories": [
35
+ "US",
36
+ "CA"
37
+ ],
38
+ "product_lines": [
39
+ "all"
40
+ ]
41
+ },
42
+ "proposed_by": null,
43
+ "expires": "2026-12-22T00:00:00Z"
44
+ },
45
+ {
46
+ "id": "auth_02",
47
+ "retailer": {
48
+ "name": "Corner Shoes"
49
+ },
50
+ "channels": [
51
+ {
52
+ "type": "ebay",
53
+ "marketplace": "GB",
54
+ "seller_id": "cornershoes"
55
+ },
56
+ {
57
+ "type": "physical",
58
+ "address": "1 High St, London",
59
+ "country": "GB"
60
+ }
61
+ ],
62
+ "scope": {
63
+ "territories": [
64
+ "*"
65
+ ],
66
+ "product_lines": [
67
+ "running",
68
+ "trail"
69
+ ]
70
+ },
71
+ "proposed_by": {
72
+ "name": "Example Distribution Ltd",
73
+ "entity_id": "ent_DIST1"
74
+ },
75
+ "expires": "2026-11-01T00:00:00Z"
76
+ }
77
+ ],
78
+ "signature": {
79
+ "kid": "ar-2026-09",
80
+ "jws": "eyJhbGciOiJFZERTQSIsImtpZCI6ImFyLTIwMjYtMDkifQ..c2lnbmF0dXJlLXBsYWNlaG9sZGVy"
81
+ }
82
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "pointer",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "list": "https://authorizedretailers.ai/v0/brands/brand.example/list"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "spec": "authorized-retailers/0.1",
3
+ "form": "private",
4
+ "brand": {
5
+ "name": "Example Brand",
6
+ "domain": "brand.example"
7
+ },
8
+ "verify": "https://authorizedretailers.ai/v0/verify"
9
+ }