@authorizedretailers/spec 0.1.1 → 0.2.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 (208) hide show
  1. package/README.md +66 -47
  2. package/dist/constants.d.ts +25 -6
  3. package/dist/constants.js +41 -7
  4. package/dist/identity.d.ts +29 -14
  5. package/dist/identity.js +79 -39
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +2 -0
  8. package/dist/jws.d.ts +36 -5
  9. package/dist/jws.js +48 -14
  10. package/dist/match.d.ts +21 -0
  11. package/dist/match.js +89 -0
  12. package/dist/product.d.ts +34 -0
  13. package/dist/product.js +75 -0
  14. package/dist/published.d.ts +14 -8
  15. package/dist/published.js +32 -10
  16. package/dist/schemas.d.ts +366 -91
  17. package/dist/schemas.js +802 -181
  18. package/dist/types.d.ts +121 -47
  19. package/dist/types.js +2 -2
  20. package/dist/validate.d.ts +24 -10
  21. package/dist/validate.js +300 -107
  22. package/fixtures/list/invalid/list-all-mixed.json +53 -0
  23. package/fixtures/list/invalid/list-amazon-missing-seller-id.json +51 -0
  24. package/fixtures/list/invalid/list-amazon-on-walmart-domain.json +52 -0
  25. package/fixtures/{file/invalid/full-attached-jws.json → list/invalid/list-attached-jws.json} +14 -12
  26. package/fixtures/list/invalid/list-bad-asin.json +102 -0
  27. package/fixtures/list/invalid/list-bad-gtin.json +102 -0
  28. package/fixtures/list/invalid/list-brand-exclusion-no-catalog.json +57 -0
  29. package/fixtures/list/invalid/list-duplicate-asin.json +102 -0
  30. package/fixtures/{file/invalid/full-duplicate-authorization-id.json → list/invalid/list-duplicate-authorization-id.json} +23 -18
  31. package/fixtures/list/invalid/list-duplicate-gtin.json +102 -0
  32. package/fixtures/list/invalid/list-duplicate-product-id.json +102 -0
  33. package/fixtures/{file/invalid/full-empty-territories.json → list/invalid/list-empty-territories.json} +17 -10
  34. package/fixtures/list/invalid/list-exclude-unknown-product.json +105 -0
  35. package/fixtures/list/invalid/list-expires-field.json +53 -0
  36. package/fixtures/list/invalid/list-extra-property.json +53 -0
  37. package/fixtures/list/invalid/list-generic-web-no-territories.json +39 -0
  38. package/fixtures/list/invalid/list-gtin-11-digits.json +102 -0
  39. package/fixtures/list/invalid/list-impossible-date.json +53 -0
  40. package/fixtures/list/invalid/list-lowercase-territory.json +52 -0
  41. package/fixtures/{file/invalid/full-signature-missing-kid.json → list/invalid/list-marketplace-field.json} +14 -11
  42. package/fixtures/list/invalid/list-marketplace-territory-mismatch.json +52 -0
  43. package/fixtures/list/invalid/list-missing-revocation-id.json +51 -0
  44. package/fixtures/list/invalid/list-missing-scope.json +44 -0
  45. package/fixtures/list/invalid/list-missing-stale-until.json +51 -0
  46. package/fixtures/list/invalid/list-name-only-retailer.json +36 -0
  47. package/fixtures/list/invalid/list-no-channels.json +37 -0
  48. package/fixtures/list/invalid/list-non-utc-timestamp.json +52 -0
  49. package/fixtures/list/invalid/list-not-public-with-authorizations.json +18 -0
  50. package/fixtures/list/invalid/list-not-public-with-catalog.json +18 -0
  51. package/fixtures/{file/invalid/full-physical-only.json → list/invalid/list-physical.json} +16 -10
  52. package/fixtures/list/invalid/list-product-no-identifier.json +98 -0
  53. package/fixtures/list/invalid/list-scope-no-products.json +49 -0
  54. package/fixtures/{file/valid/full-signed.json → list/invalid/list-single-domain.json} +12 -12
  55. package/fixtures/list/invalid/list-stale-over-24-hours.json +52 -0
  56. package/fixtures/list/invalid/list-territory-uk.json +52 -0
  57. package/fixtures/{file/invalid/full-unknown-channel-type.json → list/invalid/list-unknown-channel-type.json} +18 -12
  58. package/fixtures/list/invalid/list-unknown-line.json +102 -0
  59. package/fixtures/list/invalid/list-unknown-product.json +105 -0
  60. package/fixtures/{file/invalid/full-missing-authorization-expires.json → list/invalid/list-unsigned.json} +12 -9
  61. package/fixtures/list/invalid/list-valid-over-15-minutes.json +52 -0
  62. package/fixtures/{file/invalid/full-web-domain-is-url.json → list/invalid/list-web-domain-is-url.json} +18 -12
  63. package/fixtures/list/invalid/list-web-on-marketplace-domain.json +52 -0
  64. package/fixtures/{file/invalid/full-wildcard-mixed.json → list/invalid/list-wildcard-mixed.json} +17 -10
  65. package/fixtures/list/valid/list-catalog-line-scope.json +102 -0
  66. package/fixtures/list/valid/list-cctld-web.json +39 -0
  67. package/fixtures/list/valid/list-fractional-seconds.json +52 -0
  68. package/fixtures/{file/invalid/full-amazon-missing-seller-id.json → list/valid/list-generic-web-territories.json} +15 -17
  69. package/fixtures/list/valid/list-marketplace-no-territories.json +40 -0
  70. package/fixtures/list/valid/list-no-authorizations.json +18 -0
  71. package/fixtures/list/valid/list-no-catalog.json +52 -0
  72. package/fixtures/list/valid/list-no-expires.json +52 -0
  73. package/fixtures/list/valid/list-not-public.json +17 -0
  74. package/fixtures/list/valid/list-product-scope.json +103 -0
  75. package/fixtures/list/valid/list-proposed-by.json +55 -0
  76. package/fixtures/list/valid/list-with-expires.json +53 -0
  77. package/fixtures/list/valid/list-worldwide.json +52 -0
  78. package/fixtures/manifest.json +606 -158
  79. package/fixtures/match/all-scope-excluded-line.json +194 -0
  80. package/fixtures/match/all-scope-not-in-catalog.json +194 -0
  81. package/fixtures/match/as-of-before-end-date.json +194 -0
  82. package/fixtures/match/brand-exclusion-beats-named-product.json +194 -0
  83. package/fixtures/match/duplicate-asin-authorized-seller.json +192 -0
  84. package/fixtures/match/duplicate-asin-unauthorized-seller.json +191 -0
  85. package/fixtures/match/expired-end-date.json +193 -0
  86. package/fixtures/match/marketplace-territory-default.json +186 -0
  87. package/fixtures/match/marketplace-territory-mismatch.json +187 -0
  88. package/fixtures/match/match-by-channel-key.json +186 -0
  89. package/fixtures/match/product-excluded-by-authorization.json +194 -0
  90. package/fixtures/match/product-line-request.json +186 -0
  91. package/fixtures/match/product-not-in-scope.json +194 -0
  92. package/fixtures/match/seller-authorized-by-gtin.json +194 -0
  93. package/fixtures/match/seller-authorized-for-line.json +194 -0
  94. package/fixtures/match/worldwide-web.json +186 -0
  95. package/fixtures/pointer/invalid/full-form.json +11 -0
  96. package/fixtures/pointer/invalid/pointer-domain-mismatch.json +10 -0
  97. package/fixtures/{file → pointer}/invalid/pointer-http-url.json +2 -1
  98. package/fixtures/pointer/invalid/pointer-missing-verify-token.json +9 -0
  99. package/fixtures/pointer/invalid/pointer-other-host.json +10 -0
  100. package/fixtures/{file/valid/pointer.json → pointer/invalid/pointer-wrong-spec.json} +1 -0
  101. package/fixtures/pointer/invalid/private-form.json +10 -0
  102. package/fixtures/pointer/invalid/unknown-form.json +10 -0
  103. package/fixtures/pointer/valid/pointer-fetched-via-www.json +10 -0
  104. package/fixtures/pointer/valid/pointer.json +10 -0
  105. package/fixtures/revocation-feed/invalid/feed-hashed-entry.json +17 -0
  106. package/fixtures/revocation-feed/invalid/feed-valid-over-15-minutes.json +17 -0
  107. package/fixtures/revocation-feed/valid/feed-empty.json +12 -0
  108. package/fixtures/revocation-feed/valid/feed.json +17 -0
  109. package/fixtures/verify-request/invalid/bad-as-of.json +9 -0
  110. package/fixtures/verify-request/invalid/bad-gtin.json +11 -0
  111. package/fixtures/verify-request/invalid/domain-with-scheme.json +2 -4
  112. package/fixtures/verify-request/{valid/web-no-product-line.json → invalid/generic-web-no-territory.json} +1 -2
  113. package/fixtures/verify-request/invalid/gtin-and-asin.json +12 -0
  114. package/fixtures/verify-request/{valid/amazon.json → invalid/marketplace-field.json} +1 -3
  115. package/fixtures/verify-request/invalid/missing-channel.json +1 -3
  116. package/fixtures/verify-request/invalid/physical-channel.json +1 -3
  117. package/fixtures/verify-request/invalid/retailer-name-only.json +0 -2
  118. package/fixtures/verify-request/invalid/territory-uk.json +9 -0
  119. package/fixtures/verify-request/invalid/wildcard-territory.json +2 -3
  120. package/fixtures/verify-request/valid/as-of-datetime.json +9 -0
  121. package/fixtures/verify-request/valid/full.json +13 -0
  122. package/fixtures/verify-request/valid/gtin.json +11 -0
  123. package/fixtures/verify-request/valid/minimal-marketplace.json +8 -0
  124. package/fixtures/verify-request/valid/web-cctld-no-territory.json +7 -0
  125. package/fixtures/verify-request/valid/web-generic-with-territory.json +9 -0
  126. package/fixtures/verify-response/invalid/authorized-missing-revocation-id.json +18 -0
  127. package/fixtures/verify-response/invalid/authorized-with-reason.json +20 -0
  128. package/fixtures/verify-response/invalid/brand-unverified.json +13 -0
  129. package/fixtures/verify-response/invalid/expired-without-expires.json +18 -0
  130. package/fixtures/verify-response/invalid/missing-observed.json +11 -5
  131. package/fixtures/verify-response/invalid/missing-signature.json +9 -3
  132. package/fixtures/verify-response/invalid/missing-stale-until.json +18 -0
  133. package/fixtures/verify-response/invalid/not-in-catalog-with-id.json +17 -0
  134. package/fixtures/verify-response/invalid/not-registered-with-unlisted-reason.json +13 -0
  135. package/fixtures/verify-response/invalid/stale-until-over-24-hours.json +19 -0
  136. package/fixtures/verify-response/invalid/unlisted-observed.json +5 -4
  137. package/fixtures/verify-response/invalid/unlisted-with-authorization-id.json +5 -4
  138. package/fixtures/verify-response/invalid/unlisted-with-not-registered-reason.json +13 -0
  139. package/fixtures/verify-response/invalid/unlisted-with-revocation-id.json +13 -0
  140. package/fixtures/verify-response/invalid/valid-until-before-checked.json +11 -5
  141. package/fixtures/verify-response/invalid/valid-until-over-15-minutes.json +19 -0
  142. package/fixtures/verify-response/invalid/with-stale-flag.json +20 -0
  143. package/fixtures/verify-response/invalid/with-tier.json +11 -5
  144. package/fixtures/verify-response/valid/authorized-no-product.json +14 -0
  145. package/fixtures/verify-response/valid/authorized-not-in-catalog.json +22 -0
  146. package/fixtures/verify-response/valid/authorized-observed.json +11 -5
  147. package/fixtures/verify-response/valid/authorized-private-product.json +17 -0
  148. package/fixtures/verify-response/valid/authorized-with-end-date.json +20 -0
  149. package/fixtures/verify-response/valid/authorized.json +11 -5
  150. package/fixtures/verify-response/valid/disputed.json +10 -5
  151. package/fixtures/verify-response/valid/expired.json +12 -6
  152. package/fixtures/verify-response/valid/not-registered-no-reason.json +12 -0
  153. package/fixtures/verify-response/valid/not-registered-reason.json +13 -0
  154. package/fixtures/verify-response/valid/unlisted-product-excluded.json +18 -0
  155. package/fixtures/verify-response/valid/unlisted-product-not-in-catalog.json +16 -0
  156. package/fixtures/verify-response/valid/unlisted-territory-mismatch.json +13 -0
  157. package/fixtures/verify-response/valid/unlisted.json +5 -4
  158. package/fixtures/verify-response/valid/with-as-of.json +20 -0
  159. package/fixtures/verify-response/valid/with-signal.json +11 -5
  160. package/package.json +5 -4
  161. package/schemas/0.2/common.json +761 -0
  162. package/schemas/0.2/list.json +87 -0
  163. package/schemas/0.2/pointer.json +33 -0
  164. package/schemas/0.2/revocation-feed.json +55 -0
  165. package/schemas/0.2/verify-request.json +65 -0
  166. package/schemas/0.2/verify-response.json +284 -0
  167. package/spec/spec-v0.2.md +531 -0
  168. package/fixtures/file/invalid/full-all-mixed.json +0 -47
  169. package/fixtures/file/invalid/full-authorization-expires-after-file.json +0 -46
  170. package/fixtures/file/invalid/full-expires-before-issued.json +0 -46
  171. package/fixtures/file/invalid/full-expiry-over-180-days.json +0 -46
  172. package/fixtures/file/invalid/full-extra-property.json +0 -47
  173. package/fixtures/file/invalid/full-impossible-date.json +0 -46
  174. package/fixtures/file/invalid/full-lowercase-territory.json +0 -45
  175. package/fixtures/file/invalid/full-missing-file-expires.json +0 -45
  176. package/fixtures/file/invalid/full-missing-product-lines.json +0 -43
  177. package/fixtures/file/invalid/full-missing-scope.json +0 -37
  178. package/fixtures/file/invalid/full-missing-territories.json +0 -42
  179. package/fixtures/file/invalid/full-name-only-retailer.json +0 -30
  180. package/fixtures/file/invalid/full-no-channels.json +0 -31
  181. package/fixtures/file/invalid/full-non-utc-timestamp.json +0 -46
  182. package/fixtures/file/invalid/full-physical-missing-country.json +0 -50
  183. package/fixtures/file/invalid/full-web-missing-domain.json +0 -45
  184. package/fixtures/file/invalid/full-wrong-spec.json +0 -46
  185. package/fixtures/file/invalid/private-missing-verify.json +0 -8
  186. package/fixtures/file/invalid/private-with-authorizations.json +0 -45
  187. package/fixtures/file/invalid/unknown-form.json +0 -9
  188. package/fixtures/file/valid/full-fractional-seconds.json +0 -46
  189. package/fixtures/file/valid/full-max-expiry.json +0 -46
  190. package/fixtures/file/valid/full-no-authorizations.json +0 -11
  191. package/fixtures/file/valid/full-unsigned-handwritten.json +0 -46
  192. package/fixtures/file/valid/full-worldwide-physical-proposed.json +0 -82
  193. package/fixtures/file/valid/private.json +0 -9
  194. package/fixtures/verify-response/invalid/authorized-missing-authorization-id.json +0 -12
  195. package/fixtures/verify-response/invalid/missing-valid-until.json +0 -12
  196. package/fixtures/verify-response/invalid/observed-without-last-seen.json +0 -13
  197. package/fixtures/verify-response/invalid/unknown-status.json +0 -13
  198. package/fixtures/verify-response/invalid/unlisted-with-reason.json +0 -12
  199. package/fixtures/verify-response/invalid/valid-until-over-24h.json +0 -13
  200. package/fixtures/verify-response/valid/brand-unverified-no-reason.json +0 -11
  201. package/fixtures/verify-response/valid/brand-unverified-reason.json +0 -12
  202. /package/schemas/{common.json → 0.1/common.json} +0 -0
  203. /package/schemas/{file-full.json → 0.1/file-full.json} +0 -0
  204. /package/schemas/{file-pointer.json → 0.1/file-pointer.json} +0 -0
  205. /package/schemas/{file-private.json → 0.1/file-private.json} +0 -0
  206. /package/schemas/{file.json → 0.1/file.json} +0 -0
  207. /package/schemas/{verify-request.json → 0.1/verify-request.json} +0 -0
  208. /package/schemas/{verify-response.json → 0.1/verify-response.json} +0 -0
package/dist/schemas.js CHANGED
@@ -1,11 +1,11 @@
1
1
  // Generated from schemas/*.json by scripts/embed-schemas.mjs. Do not edit by hand.
2
2
  export const common = {
3
3
  "$schema": "https://json-schema.org/draft/2020-12/schema",
4
- "$id": "https://authorizedretailers.ai/schemas/0.1/common.json",
5
- "title": "Authorized Retailers v0.1 shared definitions",
4
+ "$id": "https://authorizedretailers.ai/schemas/0.2/common.json",
5
+ "title": "Authorized Retailers v0.2 shared definitions",
6
6
  "$defs": {
7
7
  "specVersion": {
8
- "const": "authorized-retailers/0.1"
8
+ "const": "authorized-retailers/0.2"
9
9
  },
10
10
  "timestamp": {
11
11
  "description": "RFC 3339 timestamp in UTC with a Z suffix.",
@@ -13,16 +13,271 @@ export const common = {
13
13
  "format": "date-time",
14
14
  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?Z$"
15
15
  },
16
+ "date": {
17
+ "description": "ISO 8601 calendar date.",
18
+ "type": "string",
19
+ "format": "date",
20
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
21
+ },
16
22
  "domain": {
17
- "description": "A bare hostname: no scheme, port, path or trailing dot. Compared case-insensitively.",
23
+ "description": "A bare hostname, lowercase: no scheme, port, path, trailing dot or leading www. (section 6).",
18
24
  "type": "string",
19
25
  "maxLength": 253,
20
- "pattern": "^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+(?:[A-Za-z]{2,63}|xn--[A-Za-z0-9-]{1,59})$"
26
+ "pattern": "^(?!www\\.)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+(?:[a-z]{2,63}|xn--[a-z0-9-]{1,59})$"
21
27
  },
22
28
  "countryCode": {
23
- "description": "ISO 3166-1 alpha-2, uppercase.",
24
- "type": "string",
25
- "pattern": "^[A-Z]{2}$"
29
+ "description": "ISO 3166-1 alpha-2, uppercase. The United Kingdom is GB.",
30
+ "enum": [
31
+ "AD",
32
+ "AE",
33
+ "AF",
34
+ "AG",
35
+ "AI",
36
+ "AL",
37
+ "AM",
38
+ "AO",
39
+ "AQ",
40
+ "AR",
41
+ "AS",
42
+ "AT",
43
+ "AU",
44
+ "AW",
45
+ "AX",
46
+ "AZ",
47
+ "BA",
48
+ "BB",
49
+ "BD",
50
+ "BE",
51
+ "BF",
52
+ "BG",
53
+ "BH",
54
+ "BI",
55
+ "BJ",
56
+ "BL",
57
+ "BM",
58
+ "BN",
59
+ "BO",
60
+ "BQ",
61
+ "BR",
62
+ "BS",
63
+ "BT",
64
+ "BV",
65
+ "BW",
66
+ "BY",
67
+ "BZ",
68
+ "CA",
69
+ "CC",
70
+ "CD",
71
+ "CF",
72
+ "CG",
73
+ "CH",
74
+ "CI",
75
+ "CK",
76
+ "CL",
77
+ "CM",
78
+ "CN",
79
+ "CO",
80
+ "CR",
81
+ "CU",
82
+ "CV",
83
+ "CW",
84
+ "CX",
85
+ "CY",
86
+ "CZ",
87
+ "DE",
88
+ "DJ",
89
+ "DK",
90
+ "DM",
91
+ "DO",
92
+ "DZ",
93
+ "EC",
94
+ "EE",
95
+ "EG",
96
+ "EH",
97
+ "ER",
98
+ "ES",
99
+ "ET",
100
+ "FI",
101
+ "FJ",
102
+ "FK",
103
+ "FM",
104
+ "FO",
105
+ "FR",
106
+ "GA",
107
+ "GB",
108
+ "GD",
109
+ "GE",
110
+ "GF",
111
+ "GG",
112
+ "GH",
113
+ "GI",
114
+ "GL",
115
+ "GM",
116
+ "GN",
117
+ "GP",
118
+ "GQ",
119
+ "GR",
120
+ "GS",
121
+ "GT",
122
+ "GU",
123
+ "GW",
124
+ "GY",
125
+ "HK",
126
+ "HM",
127
+ "HN",
128
+ "HR",
129
+ "HT",
130
+ "HU",
131
+ "ID",
132
+ "IE",
133
+ "IL",
134
+ "IM",
135
+ "IN",
136
+ "IO",
137
+ "IQ",
138
+ "IR",
139
+ "IS",
140
+ "IT",
141
+ "JE",
142
+ "JM",
143
+ "JO",
144
+ "JP",
145
+ "KE",
146
+ "KG",
147
+ "KH",
148
+ "KI",
149
+ "KM",
150
+ "KN",
151
+ "KP",
152
+ "KR",
153
+ "KW",
154
+ "KY",
155
+ "KZ",
156
+ "LA",
157
+ "LB",
158
+ "LC",
159
+ "LI",
160
+ "LK",
161
+ "LR",
162
+ "LS",
163
+ "LT",
164
+ "LU",
165
+ "LV",
166
+ "LY",
167
+ "MA",
168
+ "MC",
169
+ "MD",
170
+ "ME",
171
+ "MF",
172
+ "MG",
173
+ "MH",
174
+ "MK",
175
+ "ML",
176
+ "MM",
177
+ "MN",
178
+ "MO",
179
+ "MP",
180
+ "MQ",
181
+ "MR",
182
+ "MS",
183
+ "MT",
184
+ "MU",
185
+ "MV",
186
+ "MW",
187
+ "MX",
188
+ "MY",
189
+ "MZ",
190
+ "NA",
191
+ "NC",
192
+ "NE",
193
+ "NF",
194
+ "NG",
195
+ "NI",
196
+ "NL",
197
+ "NO",
198
+ "NP",
199
+ "NR",
200
+ "NU",
201
+ "NZ",
202
+ "OM",
203
+ "PA",
204
+ "PE",
205
+ "PF",
206
+ "PG",
207
+ "PH",
208
+ "PK",
209
+ "PL",
210
+ "PM",
211
+ "PN",
212
+ "PR",
213
+ "PS",
214
+ "PT",
215
+ "PW",
216
+ "PY",
217
+ "QA",
218
+ "RE",
219
+ "RO",
220
+ "RS",
221
+ "RU",
222
+ "RW",
223
+ "SA",
224
+ "SB",
225
+ "SC",
226
+ "SD",
227
+ "SE",
228
+ "SG",
229
+ "SH",
230
+ "SI",
231
+ "SJ",
232
+ "SK",
233
+ "SL",
234
+ "SM",
235
+ "SN",
236
+ "SO",
237
+ "SR",
238
+ "SS",
239
+ "ST",
240
+ "SV",
241
+ "SX",
242
+ "SY",
243
+ "SZ",
244
+ "TC",
245
+ "TD",
246
+ "TF",
247
+ "TG",
248
+ "TH",
249
+ "TJ",
250
+ "TK",
251
+ "TL",
252
+ "TM",
253
+ "TN",
254
+ "TO",
255
+ "TR",
256
+ "TT",
257
+ "TV",
258
+ "TW",
259
+ "TZ",
260
+ "UA",
261
+ "UG",
262
+ "UM",
263
+ "US",
264
+ "UY",
265
+ "UZ",
266
+ "VA",
267
+ "VC",
268
+ "VE",
269
+ "VG",
270
+ "VI",
271
+ "VN",
272
+ "VU",
273
+ "WF",
274
+ "WS",
275
+ "YE",
276
+ "YT",
277
+ "ZA",
278
+ "ZM",
279
+ "ZW"
280
+ ]
26
281
  },
27
282
  "httpsUrl": {
28
283
  "type": "string",
@@ -30,118 +285,164 @@ export const common = {
30
285
  "pattern": "^https://",
31
286
  "maxLength": 2048
32
287
  },
288
+ "registryUrl": {
289
+ "description": "Section 5.1: a list URL MUST be on authorizedretailers.ai.",
290
+ "type": "string",
291
+ "format": "uri",
292
+ "pattern": "^https://authorizedretailers\\.ai/",
293
+ "maxLength": 2048
294
+ },
33
295
  "id": {
34
296
  "type": "string",
35
297
  "pattern": "^[A-Za-z0-9_-]{1,64}$"
36
298
  },
299
+ "revocationId": {
300
+ "description": "Section 10.3: a random value, rv_ followed by at least 16 base64url characters.",
301
+ "type": "string",
302
+ "pattern": "^rv_[A-Za-z0-9_-]{16,64}$"
303
+ },
37
304
  "nonEmptyString": {
38
305
  "type": "string",
39
306
  "minLength": 1,
40
307
  "maxLength": 256
41
308
  },
42
- "brand": {
309
+ "sellerId": {
310
+ "type": "string",
311
+ "pattern": "^\\S{1,128}$"
312
+ },
313
+ "amazonChannel": {
43
314
  "type": "object",
44
315
  "required": [
45
- "name",
46
- "domain"
316
+ "type",
317
+ "domain",
318
+ "seller_id"
47
319
  ],
48
320
  "additionalProperties": false,
49
321
  "properties": {
50
- "name": {
51
- "$ref": "#/$defs/nonEmptyString"
322
+ "type": {
323
+ "const": "amazon"
52
324
  },
53
325
  "domain": {
54
- "$ref": "#/$defs/domain"
326
+ "enum": [
327
+ "amazon.com",
328
+ "amazon.ca",
329
+ "amazon.co.uk",
330
+ "amazon.de",
331
+ "amazon.fr",
332
+ "amazon.it",
333
+ "amazon.es",
334
+ "amazon.com.au"
335
+ ]
336
+ },
337
+ "seller_id": {
338
+ "$ref": "#/$defs/sellerId"
55
339
  }
56
340
  }
57
341
  },
58
- "sellerId": {
59
- "type": "string",
60
- "pattern": "^\\S{1,128}$"
61
- },
62
- "marketplaceChannel": {
342
+ "walmartChannel": {
63
343
  "type": "object",
64
344
  "required": [
65
345
  "type",
66
- "marketplace",
346
+ "domain",
67
347
  "seller_id"
68
348
  ],
69
349
  "additionalProperties": false,
70
350
  "properties": {
71
351
  "type": {
352
+ "const": "walmart"
353
+ },
354
+ "domain": {
72
355
  "enum": [
73
- "amazon",
74
- "walmart",
75
- "ebay"
356
+ "walmart.com",
357
+ "walmart.ca"
76
358
  ]
77
359
  },
78
- "marketplace": {
79
- "$ref": "#/$defs/countryCode"
80
- },
81
360
  "seller_id": {
82
361
  "$ref": "#/$defs/sellerId"
83
362
  }
84
363
  }
85
364
  },
86
- "webChannel": {
365
+ "ebayChannel": {
87
366
  "type": "object",
88
367
  "required": [
89
368
  "type",
90
- "domain"
369
+ "domain",
370
+ "seller_id"
91
371
  ],
92
372
  "additionalProperties": false,
93
373
  "properties": {
94
374
  "type": {
95
- "const": "web"
375
+ "const": "ebay"
96
376
  },
97
377
  "domain": {
98
- "$ref": "#/$defs/domain"
378
+ "enum": [
379
+ "ebay.com",
380
+ "ebay.co.uk",
381
+ "ebay.ca",
382
+ "ebay.de",
383
+ "ebay.com.au"
384
+ ]
385
+ },
386
+ "seller_id": {
387
+ "$ref": "#/$defs/sellerId"
99
388
  }
100
389
  }
101
390
  },
102
- "physicalChannel": {
391
+ "webChannel": {
103
392
  "type": "object",
104
393
  "required": [
105
394
  "type",
106
- "address",
107
- "country"
395
+ "domain"
108
396
  ],
109
397
  "additionalProperties": false,
110
398
  "properties": {
111
399
  "type": {
112
- "const": "physical"
113
- },
114
- "address": {
115
- "type": "string",
116
- "minLength": 1,
117
- "maxLength": 512
400
+ "const": "web"
118
401
  },
119
- "country": {
120
- "$ref": "#/$defs/countryCode"
402
+ "domain": {
403
+ "allOf": [
404
+ {
405
+ "$ref": "#/$defs/domain"
406
+ },
407
+ {
408
+ "not": {
409
+ "enum": [
410
+ "amazon.com",
411
+ "amazon.ca",
412
+ "amazon.co.uk",
413
+ "amazon.de",
414
+ "amazon.fr",
415
+ "amazon.it",
416
+ "amazon.es",
417
+ "amazon.com.au",
418
+ "walmart.com",
419
+ "walmart.ca",
420
+ "ebay.com",
421
+ "ebay.co.uk",
422
+ "ebay.ca",
423
+ "ebay.de",
424
+ "ebay.com.au"
425
+ ]
426
+ }
427
+ }
428
+ ]
121
429
  }
122
430
  }
123
431
  },
124
- "verifiableChannel": {
125
- "description": "A channel an agent can see and match on (section 6). Excludes physical.",
432
+ "channel": {
433
+ "description": "Section 6. Every channel is identified by a domain.",
126
434
  "oneOf": [
127
435
  {
128
- "$ref": "#/$defs/marketplaceChannel"
436
+ "$ref": "#/$defs/amazonChannel"
129
437
  },
130
438
  {
131
- "$ref": "#/$defs/webChannel"
132
- }
133
- ]
134
- },
135
- "channel": {
136
- "oneOf": [
137
- {
138
- "$ref": "#/$defs/marketplaceChannel"
439
+ "$ref": "#/$defs/walmartChannel"
139
440
  },
140
441
  {
141
- "$ref": "#/$defs/webChannel"
442
+ "$ref": "#/$defs/ebayChannel"
142
443
  },
143
444
  {
144
- "$ref": "#/$defs/physicalChannel"
445
+ "$ref": "#/$defs/webChannel"
145
446
  }
146
447
  ]
147
448
  },
@@ -211,19 +512,144 @@ export const common = {
211
512
  }
212
513
  ]
213
514
  },
214
- "scope": {
515
+ "namedProductLines": {
516
+ "type": "array",
517
+ "uniqueItems": true,
518
+ "items": {
519
+ "allOf": [
520
+ {
521
+ "$ref": "#/$defs/productLine"
522
+ },
523
+ {
524
+ "not": {
525
+ "const": "all"
526
+ }
527
+ }
528
+ ]
529
+ }
530
+ },
531
+ "productIds": {
532
+ "type": "array",
533
+ "uniqueItems": true,
534
+ "items": {
535
+ "$ref": "#/$defs/id"
536
+ }
537
+ },
538
+ "gtin": {
539
+ "description": "8, 12, 13 or 14 digits with a valid GS1 check digit (checked by the validator).",
540
+ "type": "string",
541
+ "pattern": "^([0-9]{8}|[0-9]{12,14})$"
542
+ },
543
+ "asin": {
544
+ "description": "10 uppercase letters or digits.",
545
+ "type": "string",
546
+ "pattern": "^[A-Z0-9]{10}$"
547
+ },
548
+ "product": {
549
+ "description": "Section 3.1. At least one of gtin or asins.",
215
550
  "type": "object",
216
551
  "required": [
217
- "territories",
218
- "product_lines"
552
+ "id",
553
+ "name"
219
554
  ],
220
555
  "additionalProperties": false,
556
+ "properties": {
557
+ "id": {
558
+ "$ref": "#/$defs/id"
559
+ },
560
+ "name": {
561
+ "$ref": "#/$defs/nonEmptyString"
562
+ },
563
+ "product_line": {
564
+ "$ref": "#/$defs/productLine"
565
+ },
566
+ "attributes": {
567
+ "type": "object",
568
+ "maxProperties": 32,
569
+ "propertyNames": {
570
+ "minLength": 1,
571
+ "maxLength": 64
572
+ },
573
+ "additionalProperties": {
574
+ "type": "string",
575
+ "maxLength": 256
576
+ }
577
+ },
578
+ "gtin": {
579
+ "$ref": "#/$defs/gtin"
580
+ },
581
+ "asins": {
582
+ "type": "array",
583
+ "minItems": 1,
584
+ "uniqueItems": true,
585
+ "items": {
586
+ "$ref": "#/$defs/asin"
587
+ }
588
+ }
589
+ },
590
+ "anyOf": [
591
+ {
592
+ "required": [
593
+ "gtin"
594
+ ]
595
+ },
596
+ {
597
+ "required": [
598
+ "asins"
599
+ ]
600
+ }
601
+ ]
602
+ },
603
+ "scope": {
604
+ "description": "Section 3. product_lines, products or both; territories optional (section 6.2).",
605
+ "type": "object",
606
+ "additionalProperties": false,
221
607
  "properties": {
222
608
  "territories": {
223
609
  "$ref": "#/$defs/territories"
224
610
  },
225
611
  "product_lines": {
226
612
  "$ref": "#/$defs/productLines"
613
+ },
614
+ "products": {
615
+ "allOf": [
616
+ {
617
+ "$ref": "#/$defs/productIds"
618
+ },
619
+ {
620
+ "minItems": 1
621
+ }
622
+ ]
623
+ },
624
+ "exclude_product_lines": {
625
+ "$ref": "#/$defs/namedProductLines"
626
+ },
627
+ "exclude_products": {
628
+ "$ref": "#/$defs/productIds"
629
+ }
630
+ },
631
+ "anyOf": [
632
+ {
633
+ "required": [
634
+ "product_lines"
635
+ ]
636
+ },
637
+ {
638
+ "required": [
639
+ "products"
640
+ ]
641
+ }
642
+ ]
643
+ },
644
+ "exclusions": {
645
+ "type": "object",
646
+ "additionalProperties": false,
647
+ "properties": {
648
+ "product_lines": {
649
+ "$ref": "#/$defs/namedProductLines"
650
+ },
651
+ "products": {
652
+ "$ref": "#/$defs/productIds"
227
653
  }
228
654
  }
229
655
  },
@@ -231,28 +657,27 @@ export const common = {
231
657
  "type": "object",
232
658
  "required": [
233
659
  "id",
660
+ "revocation_id",
234
661
  "retailer",
235
662
  "channels",
236
- "scope",
237
- "expires"
663
+ "scope"
238
664
  ],
239
665
  "additionalProperties": false,
240
666
  "properties": {
241
667
  "id": {
242
668
  "$ref": "#/$defs/id"
243
669
  },
670
+ "revocation_id": {
671
+ "$ref": "#/$defs/revocationId"
672
+ },
244
673
  "retailer": {
245
674
  "$ref": "#/$defs/party"
246
675
  },
247
676
  "channels": {
248
- "description": "Section 6: every authorization MUST name at least one online channel identifier (amazon, walmart, ebay or web). A physical identifier alone does not authorize anything.",
249
677
  "type": "array",
250
678
  "minItems": 1,
251
679
  "items": {
252
680
  "$ref": "#/$defs/channel"
253
- },
254
- "contains": {
255
- "$ref": "#/$defs/verifiableChannel"
256
681
  }
257
682
  },
258
683
  "scope": {
@@ -270,10 +695,50 @@ export const common = {
270
695
  ]
271
696
  },
272
697
  "expires": {
698
+ "description": "Optional end date set by the brand (section 10).",
273
699
  "$ref": "#/$defs/timestamp"
274
700
  }
275
701
  }
276
702
  },
703
+ "brand": {
704
+ "description": "Pointer form: one domain.",
705
+ "type": "object",
706
+ "required": [
707
+ "name",
708
+ "domain"
709
+ ],
710
+ "additionalProperties": false,
711
+ "properties": {
712
+ "name": {
713
+ "$ref": "#/$defs/nonEmptyString"
714
+ },
715
+ "domain": {
716
+ "$ref": "#/$defs/domain"
717
+ }
718
+ }
719
+ },
720
+ "listBrand": {
721
+ "description": "Every domain the list applies to (section 5.2).",
722
+ "type": "object",
723
+ "required": [
724
+ "name",
725
+ "domains"
726
+ ],
727
+ "additionalProperties": false,
728
+ "properties": {
729
+ "name": {
730
+ "$ref": "#/$defs/nonEmptyString"
731
+ },
732
+ "domains": {
733
+ "type": "array",
734
+ "minItems": 1,
735
+ "uniqueItems": true,
736
+ "items": {
737
+ "$ref": "#/$defs/domain"
738
+ }
739
+ }
740
+ }
741
+ },
277
742
  "signature": {
278
743
  "type": "object",
279
744
  "required": [
@@ -295,36 +760,49 @@ export const common = {
295
760
  }
296
761
  }
297
762
  };
298
- export const fileFull = {
763
+ export const list = {
299
764
  "$schema": "https://json-schema.org/draft/2020-12/schema",
300
- "$id": "https://authorizedretailers.ai/schemas/0.1/file-full.json",
301
- "title": "authorized-retailers.json, full form",
765
+ "$id": "https://authorizedretailers.ai/schemas/0.2/list.json",
766
+ "title": "Signed list (section 5.2)",
302
767
  "type": "object",
303
768
  "required": [
304
769
  "spec",
305
- "form",
306
770
  "brand",
771
+ "public",
307
772
  "issued",
308
- "expires",
309
- "authorizations"
773
+ "valid_until",
774
+ "stale_until",
775
+ "signature"
310
776
  ],
311
777
  "additionalProperties": false,
312
778
  "properties": {
313
779
  "spec": {
314
780
  "$ref": "common.json#/$defs/specVersion"
315
781
  },
316
- "form": {
317
- "const": "full"
318
- },
319
782
  "brand": {
320
- "$ref": "common.json#/$defs/brand"
783
+ "$ref": "common.json#/$defs/listBrand"
784
+ },
785
+ "public": {
786
+ "type": "boolean"
321
787
  },
322
788
  "issued": {
323
789
  "$ref": "common.json#/$defs/timestamp"
324
790
  },
325
- "expires": {
791
+ "valid_until": {
792
+ "$ref": "common.json#/$defs/timestamp"
793
+ },
794
+ "stale_until": {
326
795
  "$ref": "common.json#/$defs/timestamp"
327
796
  },
797
+ "catalog": {
798
+ "type": "array",
799
+ "items": {
800
+ "$ref": "common.json#/$defs/product"
801
+ }
802
+ },
803
+ "exclusions": {
804
+ "$ref": "common.json#/$defs/exclusions"
805
+ },
328
806
  "authorizations": {
329
807
  "type": "array",
330
808
  "items": {
@@ -332,20 +810,53 @@ export const fileFull = {
332
810
  }
333
811
  },
334
812
  "signature": {
335
- "description": "Optional in the schema: an unsigned file is well-formed but does not count (section 5).",
336
813
  "$ref": "common.json#/$defs/signature"
337
814
  }
815
+ },
816
+ "if": {
817
+ "properties": {
818
+ "public": {
819
+ "const": true
820
+ }
821
+ }
822
+ },
823
+ "then": {
824
+ "required": [
825
+ "authorizations"
826
+ ]
827
+ },
828
+ "else": {
829
+ "not": {
830
+ "anyOf": [
831
+ {
832
+ "required": [
833
+ "authorizations"
834
+ ]
835
+ },
836
+ {
837
+ "required": [
838
+ "catalog"
839
+ ]
840
+ },
841
+ {
842
+ "required": [
843
+ "exclusions"
844
+ ]
845
+ }
846
+ ]
847
+ }
338
848
  }
339
849
  };
340
- export const filePointer = {
850
+ export const pointer = {
341
851
  "$schema": "https://json-schema.org/draft/2020-12/schema",
342
- "$id": "https://authorizedretailers.ai/schemas/0.1/file-pointer.json",
343
- "title": "authorized-retailers.json, pointer form",
852
+ "$id": "https://authorizedretailers.ai/schemas/0.2/pointer.json",
853
+ "title": "authorized-retailers.json pointer (section 5.1)",
344
854
  "type": "object",
345
855
  "required": [
346
856
  "spec",
347
857
  "form",
348
858
  "brand",
859
+ "verify_token",
349
860
  "list"
350
861
  ],
351
862
  "additionalProperties": false,
@@ -359,104 +870,80 @@ export const filePointer = {
359
870
  "brand": {
360
871
  "$ref": "common.json#/$defs/brand"
361
872
  },
873
+ "verify_token": {
874
+ "description": "The domain's public verification token (section 4).",
875
+ "type": "string",
876
+ "pattern": "^[A-Za-z0-9_-]{16,128}$"
877
+ },
362
878
  "list": {
363
- "$ref": "common.json#/$defs/httpsUrl"
879
+ "$ref": "common.json#/$defs/registryUrl"
364
880
  }
365
881
  }
366
882
  };
367
- export const filePrivate = {
883
+ export const revocationFeed = {
368
884
  "$schema": "https://json-schema.org/draft/2020-12/schema",
369
- "$id": "https://authorizedretailers.ai/schemas/0.1/file-private.json",
370
- "title": "authorized-retailers.json, private form",
885
+ "$id": "https://authorizedretailers.ai/schemas/0.2/revocation-feed.json",
886
+ "title": "Revocation feed (section 10.3)",
371
887
  "type": "object",
372
888
  "required": [
373
889
  "spec",
374
- "form",
375
- "brand",
376
- "verify"
890
+ "feed",
891
+ "issued",
892
+ "valid_until",
893
+ "stale_until",
894
+ "entries",
895
+ "signature"
377
896
  ],
378
897
  "additionalProperties": false,
379
898
  "properties": {
380
899
  "spec": {
381
900
  "$ref": "common.json#/$defs/specVersion"
382
901
  },
383
- "form": {
384
- "const": "private"
902
+ "feed": {
903
+ "const": "revocations"
385
904
  },
386
- "brand": {
387
- "$ref": "common.json#/$defs/brand"
905
+ "issued": {
906
+ "$ref": "common.json#/$defs/timestamp"
388
907
  },
389
- "verify": {
390
- "$ref": "common.json#/$defs/httpsUrl"
391
- }
392
- }
393
- };
394
- export const file = {
395
- "$schema": "https://json-schema.org/draft/2020-12/schema",
396
- "$id": "https://authorizedretailers.ai/schemas/0.1/file.json",
397
- "title": "authorized-retailers.json, any form",
398
- "type": "object",
399
- "required": [
400
- "form"
401
- ],
402
- "properties": {
403
- "form": {
404
- "enum": [
405
- "full",
406
- "pointer",
407
- "private"
408
- ]
409
- }
410
- },
411
- "allOf": [
412
- {
413
- "if": {
414
- "properties": {
415
- "form": {
416
- "const": "full"
417
- }
418
- }
419
- },
420
- "then": {
421
- "$ref": "file-full.json"
422
- }
908
+ "valid_until": {
909
+ "$ref": "common.json#/$defs/timestamp"
423
910
  },
424
- {
425
- "if": {
426
- "properties": {
427
- "form": {
428
- "const": "pointer"
429
- }
430
- }
431
- },
432
- "then": {
433
- "$ref": "file-pointer.json"
434
- }
911
+ "stale_until": {
912
+ "$ref": "common.json#/$defs/timestamp"
435
913
  },
436
- {
437
- "if": {
914
+ "entries": {
915
+ "type": "array",
916
+ "items": {
917
+ "type": "object",
918
+ "required": [
919
+ "revocation_id",
920
+ "revoked"
921
+ ],
922
+ "additionalProperties": false,
438
923
  "properties": {
439
- "form": {
440
- "const": "private"
924
+ "revocation_id": {
925
+ "$ref": "common.json#/$defs/revocationId"
926
+ },
927
+ "revoked": {
928
+ "$ref": "common.json#/$defs/timestamp"
441
929
  }
442
930
  }
443
- },
444
- "then": {
445
- "$ref": "file-private.json"
446
931
  }
932
+ },
933
+ "signature": {
934
+ "$ref": "common.json#/$defs/signature"
447
935
  }
448
- ]
936
+ }
449
937
  };
450
938
  export const verifyRequest = {
451
939
  "$schema": "https://json-schema.org/draft/2020-12/schema",
452
- "$id": "https://authorizedretailers.ai/schemas/0.1/verify-request.json",
940
+ "$id": "https://authorizedretailers.ai/schemas/0.2/verify-request.json",
453
941
  "title": "POST /v0/verify request (section 9)",
454
- "description": "Canonical form. Registries normalize case and whitespace before validating (see normalizeVerifyRequest).",
942
+ "description": "Canonical form. Call normalizeVerifyRequest on raw input first.",
455
943
  "type": "object",
456
944
  "required": [
457
945
  "brand_domain",
458
- "channel",
459
- "territory"
946
+ "channel"
460
947
  ],
461
948
  "additionalProperties": false,
462
949
  "properties": {
@@ -464,26 +951,65 @@ export const verifyRequest = {
464
951
  "$ref": "common.json#/$defs/domain"
465
952
  },
466
953
  "channel": {
467
- "$ref": "common.json#/$defs/verifiableChannel"
954
+ "$ref": "common.json#/$defs/channel"
468
955
  },
469
956
  "territory": {
470
957
  "$ref": "common.json#/$defs/countryCode"
471
958
  },
472
959
  "product_line": {
473
- "description": "Defaults to \"all\" when omitted.",
474
960
  "$ref": "common.json#/$defs/productLine"
961
+ },
962
+ "product": {
963
+ "description": "Exactly one of gtin or asin.",
964
+ "oneOf": [
965
+ {
966
+ "type": "object",
967
+ "required": [
968
+ "gtin"
969
+ ],
970
+ "additionalProperties": false,
971
+ "properties": {
972
+ "gtin": {
973
+ "$ref": "common.json#/$defs/gtin"
974
+ }
975
+ }
976
+ },
977
+ {
978
+ "type": "object",
979
+ "required": [
980
+ "asin"
981
+ ],
982
+ "additionalProperties": false,
983
+ "properties": {
984
+ "asin": {
985
+ "$ref": "common.json#/$defs/asin"
986
+ }
987
+ }
988
+ }
989
+ ]
990
+ },
991
+ "as_of": {
992
+ "anyOf": [
993
+ {
994
+ "$ref": "common.json#/$defs/date"
995
+ },
996
+ {
997
+ "$ref": "common.json#/$defs/timestamp"
998
+ }
999
+ ]
475
1000
  }
476
1001
  }
477
1002
  };
478
1003
  export const verifyResponse = {
479
1004
  "$schema": "https://json-schema.org/draft/2020-12/schema",
480
- "$id": "https://authorizedretailers.ai/schemas/0.1/verify-response.json",
1005
+ "$id": "https://authorizedretailers.ai/schemas/0.2/verify-response.json",
481
1006
  "title": "POST /v0/verify response (section 9)",
482
1007
  "type": "object",
483
1008
  "required": [
484
1009
  "status",
485
1010
  "checked",
486
1011
  "valid_until",
1012
+ "stale_until",
487
1013
  "observed",
488
1014
  "signals",
489
1015
  "signature"
@@ -495,7 +1021,7 @@ export const verifyResponse = {
495
1021
  "authorized",
496
1022
  "unlisted",
497
1023
  "expired",
498
- "brand_unverified",
1024
+ "brand_not_registered",
499
1025
  "disputed"
500
1026
  ]
501
1027
  },
@@ -503,21 +1029,75 @@ export const verifyResponse = {
503
1029
  "enum": [
504
1030
  "not_registered",
505
1031
  "domain_unlinked",
506
- "verification_lapsed"
1032
+ "verification_lapsed",
1033
+ "territory_mismatch",
1034
+ "product_excluded",
1035
+ "product_not_in_scope",
1036
+ "product_not_in_catalog"
507
1037
  ]
508
1038
  },
509
1039
  "authorization_id": {
510
1040
  "$ref": "common.json#/$defs/id"
511
1041
  },
1042
+ "revocation_id": {
1043
+ "$ref": "common.json#/$defs/revocationId"
1044
+ },
512
1045
  "expires": {
513
1046
  "$ref": "common.json#/$defs/timestamp"
514
1047
  },
515
1048
  "checked": {
516
1049
  "$ref": "common.json#/$defs/timestamp"
517
1050
  },
1051
+ "as_of": {
1052
+ "$ref": "common.json#/$defs/timestamp"
1053
+ },
518
1054
  "valid_until": {
519
1055
  "$ref": "common.json#/$defs/timestamp"
520
1056
  },
1057
+ "stale_until": {
1058
+ "$ref": "common.json#/$defs/timestamp"
1059
+ },
1060
+ "product": {
1061
+ "type": "object",
1062
+ "required": [
1063
+ "in_catalog"
1064
+ ],
1065
+ "additionalProperties": false,
1066
+ "properties": {
1067
+ "in_catalog": {
1068
+ "type": "boolean"
1069
+ },
1070
+ "id": {
1071
+ "$ref": "common.json#/$defs/id"
1072
+ },
1073
+ "product_line": {
1074
+ "$ref": "common.json#/$defs/productLine"
1075
+ }
1076
+ },
1077
+ "if": {
1078
+ "properties": {
1079
+ "in_catalog": {
1080
+ "const": false
1081
+ }
1082
+ }
1083
+ },
1084
+ "then": {
1085
+ "not": {
1086
+ "anyOf": [
1087
+ {
1088
+ "required": [
1089
+ "id"
1090
+ ]
1091
+ },
1092
+ {
1093
+ "required": [
1094
+ "product_line"
1095
+ ]
1096
+ }
1097
+ ]
1098
+ }
1099
+ }
1100
+ },
521
1101
  "observed": {
522
1102
  "description": "Section 7: when the registry last saw this seller selling on the channel, within 30 days; otherwise null",
523
1103
  "oneOf": [
@@ -571,11 +1151,20 @@ export const verifyResponse = {
571
1151
  "if": {
572
1152
  "properties": {
573
1153
  "status": {
574
- "const": "brand_unverified"
1154
+ "enum": [
1155
+ "authorized",
1156
+ "expired",
1157
+ "disputed"
1158
+ ]
575
1159
  }
576
1160
  }
577
1161
  },
578
1162
  "then": {
1163
+ "required": [
1164
+ "authorization_id"
1165
+ ]
1166
+ },
1167
+ "else": {
579
1168
  "not": {
580
1169
  "anyOf": [
581
1170
  {
@@ -590,29 +1179,64 @@ export const verifyResponse = {
590
1179
  }
591
1180
  ]
592
1181
  }
1182
+ }
1183
+ },
1184
+ {
1185
+ "if": {
1186
+ "properties": {
1187
+ "status": {
1188
+ "const": "expired"
1189
+ }
1190
+ }
1191
+ },
1192
+ "then": {
1193
+ "required": [
1194
+ "expires"
1195
+ ]
1196
+ }
1197
+ },
1198
+ {
1199
+ "if": {
1200
+ "properties": {
1201
+ "status": {
1202
+ "const": "authorized"
1203
+ }
1204
+ }
1205
+ },
1206
+ "then": {
1207
+ "required": [
1208
+ "revocation_id"
1209
+ ]
593
1210
  },
594
1211
  "else": {
1212
+ "properties": {
1213
+ "observed": {
1214
+ "const": null
1215
+ }
1216
+ },
595
1217
  "not": {
596
1218
  "required": [
597
- "reason"
1219
+ "revocation_id"
598
1220
  ]
599
1221
  }
600
1222
  }
601
1223
  },
602
1224
  {
603
1225
  "if": {
604
- "not": {
605
- "properties": {
606
- "status": {
607
- "const": "authorized"
608
- }
1226
+ "properties": {
1227
+ "status": {
1228
+ "const": "brand_not_registered"
609
1229
  }
610
1230
  }
611
1231
  },
612
1232
  "then": {
613
1233
  "properties": {
614
- "observed": {
615
- "const": null
1234
+ "reason": {
1235
+ "enum": [
1236
+ "not_registered",
1237
+ "domain_unlinked",
1238
+ "verification_lapsed"
1239
+ ]
616
1240
  }
617
1241
  }
618
1242
  }
@@ -621,42 +1245,39 @@ export const verifyResponse = {
621
1245
  "if": {
622
1246
  "properties": {
623
1247
  "status": {
624
- "enum": [
625
- "authorized",
626
- "expired",
627
- "disputed"
628
- ]
1248
+ "const": "unlisted"
629
1249
  }
630
1250
  }
631
1251
  },
632
1252
  "then": {
633
- "required": [
634
- "authorization_id",
635
- "expires"
636
- ]
1253
+ "properties": {
1254
+ "reason": {
1255
+ "enum": [
1256
+ "territory_mismatch",
1257
+ "product_excluded",
1258
+ "product_not_in_scope",
1259
+ "product_not_in_catalog"
1260
+ ]
1261
+ }
1262
+ }
637
1263
  }
638
1264
  },
639
1265
  {
640
1266
  "if": {
641
1267
  "properties": {
642
1268
  "status": {
643
- "const": "unlisted"
1269
+ "enum": [
1270
+ "authorized",
1271
+ "expired",
1272
+ "disputed"
1273
+ ]
644
1274
  }
645
1275
  }
646
1276
  },
647
1277
  "then": {
648
1278
  "not": {
649
- "anyOf": [
650
- {
651
- "required": [
652
- "authorization_id"
653
- ]
654
- },
655
- {
656
- "required": [
657
- "expires"
658
- ]
659
- }
1279
+ "required": [
1280
+ "reason"
660
1281
  ]
661
1282
  }
662
1283
  }