@authorizedretailers/spec 0.1.0 → 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 (209) 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 -88
  17. package/dist/schemas.js +802 -178
  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 +302 -82
  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/list/invalid/list-physical.json +43 -0
  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 +609 -154
  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/{common.json → 0.1/common.json} +3 -2
  162. package/schemas/0.2/common.json +761 -0
  163. package/schemas/0.2/list.json +87 -0
  164. package/schemas/0.2/pointer.json +33 -0
  165. package/schemas/0.2/revocation-feed.json +55 -0
  166. package/schemas/0.2/verify-request.json +65 -0
  167. package/schemas/0.2/verify-response.json +284 -0
  168. package/spec/spec-v0.1.md +11 -3
  169. package/spec/spec-v0.2.md +531 -0
  170. package/fixtures/file/invalid/full-all-mixed.json +0 -47
  171. package/fixtures/file/invalid/full-authorization-expires-after-file.json +0 -46
  172. package/fixtures/file/invalid/full-expires-before-issued.json +0 -46
  173. package/fixtures/file/invalid/full-expiry-over-180-days.json +0 -46
  174. package/fixtures/file/invalid/full-extra-property.json +0 -47
  175. package/fixtures/file/invalid/full-impossible-date.json +0 -46
  176. package/fixtures/file/invalid/full-lowercase-territory.json +0 -45
  177. package/fixtures/file/invalid/full-missing-file-expires.json +0 -45
  178. package/fixtures/file/invalid/full-missing-product-lines.json +0 -43
  179. package/fixtures/file/invalid/full-missing-scope.json +0 -37
  180. package/fixtures/file/invalid/full-missing-territories.json +0 -42
  181. package/fixtures/file/invalid/full-name-only-retailer.json +0 -30
  182. package/fixtures/file/invalid/full-no-channels.json +0 -31
  183. package/fixtures/file/invalid/full-non-utc-timestamp.json +0 -46
  184. package/fixtures/file/invalid/full-physical-missing-country.json +0 -50
  185. package/fixtures/file/invalid/full-web-missing-domain.json +0 -45
  186. package/fixtures/file/invalid/full-wrong-spec.json +0 -46
  187. package/fixtures/file/invalid/private-missing-verify.json +0 -8
  188. package/fixtures/file/invalid/private-with-authorizations.json +0 -45
  189. package/fixtures/file/invalid/unknown-form.json +0 -9
  190. package/fixtures/file/valid/full-fractional-seconds.json +0 -46
  191. package/fixtures/file/valid/full-max-expiry.json +0 -46
  192. package/fixtures/file/valid/full-no-authorizations.json +0 -11
  193. package/fixtures/file/valid/full-unsigned-handwritten.json +0 -46
  194. package/fixtures/file/valid/full-worldwide-physical-proposed.json +0 -82
  195. package/fixtures/file/valid/private.json +0 -9
  196. package/fixtures/verify-response/invalid/authorized-missing-authorization-id.json +0 -12
  197. package/fixtures/verify-response/invalid/missing-valid-until.json +0 -12
  198. package/fixtures/verify-response/invalid/observed-without-last-seen.json +0 -13
  199. package/fixtures/verify-response/invalid/unknown-status.json +0 -13
  200. package/fixtures/verify-response/invalid/unlisted-with-reason.json +0 -12
  201. package/fixtures/verify-response/invalid/valid-until-over-24h.json +0 -13
  202. package/fixtures/verify-response/valid/brand-unverified-no-reason.json +0 -11
  203. package/fixtures/verify-response/valid/brand-unverified-reason.json +0 -12
  204. /package/schemas/{file-full.json → 0.1/file-full.json} +0 -0
  205. /package/schemas/{file-pointer.json → 0.1/file-pointer.json} +0 -0
  206. /package/schemas/{file-private.json → 0.1/file-private.json} +0 -0
  207. /package/schemas/{file.json → 0.1/file.json} +0 -0
  208. /package/schemas/{verify-request.json → 0.1/verify-request.json} +0 -0
  209. /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,21 +657,23 @@ 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 channel identifier.",
249
677
  "type": "array",
250
678
  "minItems": 1,
251
679
  "items": {
@@ -267,10 +695,50 @@ export const common = {
267
695
  ]
268
696
  },
269
697
  "expires": {
698
+ "description": "Optional end date set by the brand (section 10).",
270
699
  "$ref": "#/$defs/timestamp"
271
700
  }
272
701
  }
273
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
+ },
274
742
  "signature": {
275
743
  "type": "object",
276
744
  "required": [
@@ -292,36 +760,49 @@ export const common = {
292
760
  }
293
761
  }
294
762
  };
295
- export const fileFull = {
763
+ export const list = {
296
764
  "$schema": "https://json-schema.org/draft/2020-12/schema",
297
- "$id": "https://authorizedretailers.ai/schemas/0.1/file-full.json",
298
- "title": "authorized-retailers.json, full form",
765
+ "$id": "https://authorizedretailers.ai/schemas/0.2/list.json",
766
+ "title": "Signed list (section 5.2)",
299
767
  "type": "object",
300
768
  "required": [
301
769
  "spec",
302
- "form",
303
770
  "brand",
771
+ "public",
304
772
  "issued",
305
- "expires",
306
- "authorizations"
773
+ "valid_until",
774
+ "stale_until",
775
+ "signature"
307
776
  ],
308
777
  "additionalProperties": false,
309
778
  "properties": {
310
779
  "spec": {
311
780
  "$ref": "common.json#/$defs/specVersion"
312
781
  },
313
- "form": {
314
- "const": "full"
315
- },
316
782
  "brand": {
317
- "$ref": "common.json#/$defs/brand"
783
+ "$ref": "common.json#/$defs/listBrand"
784
+ },
785
+ "public": {
786
+ "type": "boolean"
318
787
  },
319
788
  "issued": {
320
789
  "$ref": "common.json#/$defs/timestamp"
321
790
  },
322
- "expires": {
791
+ "valid_until": {
323
792
  "$ref": "common.json#/$defs/timestamp"
324
793
  },
794
+ "stale_until": {
795
+ "$ref": "common.json#/$defs/timestamp"
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
+ },
325
806
  "authorizations": {
326
807
  "type": "array",
327
808
  "items": {
@@ -329,20 +810,53 @@ export const fileFull = {
329
810
  }
330
811
  },
331
812
  "signature": {
332
- "description": "Optional in the schema: an unsigned file is well-formed but does not count (section 5).",
333
813
  "$ref": "common.json#/$defs/signature"
334
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
+ }
335
848
  }
336
849
  };
337
- export const filePointer = {
850
+ export const pointer = {
338
851
  "$schema": "https://json-schema.org/draft/2020-12/schema",
339
- "$id": "https://authorizedretailers.ai/schemas/0.1/file-pointer.json",
340
- "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)",
341
854
  "type": "object",
342
855
  "required": [
343
856
  "spec",
344
857
  "form",
345
858
  "brand",
859
+ "verify_token",
346
860
  "list"
347
861
  ],
348
862
  "additionalProperties": false,
@@ -356,104 +870,80 @@ export const filePointer = {
356
870
  "brand": {
357
871
  "$ref": "common.json#/$defs/brand"
358
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
+ },
359
878
  "list": {
360
- "$ref": "common.json#/$defs/httpsUrl"
879
+ "$ref": "common.json#/$defs/registryUrl"
361
880
  }
362
881
  }
363
882
  };
364
- export const filePrivate = {
883
+ export const revocationFeed = {
365
884
  "$schema": "https://json-schema.org/draft/2020-12/schema",
366
- "$id": "https://authorizedretailers.ai/schemas/0.1/file-private.json",
367
- "title": "authorized-retailers.json, private form",
885
+ "$id": "https://authorizedretailers.ai/schemas/0.2/revocation-feed.json",
886
+ "title": "Revocation feed (section 10.3)",
368
887
  "type": "object",
369
888
  "required": [
370
889
  "spec",
371
- "form",
372
- "brand",
373
- "verify"
890
+ "feed",
891
+ "issued",
892
+ "valid_until",
893
+ "stale_until",
894
+ "entries",
895
+ "signature"
374
896
  ],
375
897
  "additionalProperties": false,
376
898
  "properties": {
377
899
  "spec": {
378
900
  "$ref": "common.json#/$defs/specVersion"
379
901
  },
380
- "form": {
381
- "const": "private"
902
+ "feed": {
903
+ "const": "revocations"
382
904
  },
383
- "brand": {
384
- "$ref": "common.json#/$defs/brand"
905
+ "issued": {
906
+ "$ref": "common.json#/$defs/timestamp"
385
907
  },
386
- "verify": {
387
- "$ref": "common.json#/$defs/httpsUrl"
388
- }
389
- }
390
- };
391
- export const file = {
392
- "$schema": "https://json-schema.org/draft/2020-12/schema",
393
- "$id": "https://authorizedretailers.ai/schemas/0.1/file.json",
394
- "title": "authorized-retailers.json, any form",
395
- "type": "object",
396
- "required": [
397
- "form"
398
- ],
399
- "properties": {
400
- "form": {
401
- "enum": [
402
- "full",
403
- "pointer",
404
- "private"
405
- ]
406
- }
407
- },
408
- "allOf": [
409
- {
410
- "if": {
411
- "properties": {
412
- "form": {
413
- "const": "full"
414
- }
415
- }
416
- },
417
- "then": {
418
- "$ref": "file-full.json"
419
- }
908
+ "valid_until": {
909
+ "$ref": "common.json#/$defs/timestamp"
420
910
  },
421
- {
422
- "if": {
423
- "properties": {
424
- "form": {
425
- "const": "pointer"
426
- }
427
- }
428
- },
429
- "then": {
430
- "$ref": "file-pointer.json"
431
- }
911
+ "stale_until": {
912
+ "$ref": "common.json#/$defs/timestamp"
432
913
  },
433
- {
434
- "if": {
914
+ "entries": {
915
+ "type": "array",
916
+ "items": {
917
+ "type": "object",
918
+ "required": [
919
+ "revocation_id",
920
+ "revoked"
921
+ ],
922
+ "additionalProperties": false,
435
923
  "properties": {
436
- "form": {
437
- "const": "private"
924
+ "revocation_id": {
925
+ "$ref": "common.json#/$defs/revocationId"
926
+ },
927
+ "revoked": {
928
+ "$ref": "common.json#/$defs/timestamp"
438
929
  }
439
930
  }
440
- },
441
- "then": {
442
- "$ref": "file-private.json"
443
931
  }
932
+ },
933
+ "signature": {
934
+ "$ref": "common.json#/$defs/signature"
444
935
  }
445
- ]
936
+ }
446
937
  };
447
938
  export const verifyRequest = {
448
939
  "$schema": "https://json-schema.org/draft/2020-12/schema",
449
- "$id": "https://authorizedretailers.ai/schemas/0.1/verify-request.json",
940
+ "$id": "https://authorizedretailers.ai/schemas/0.2/verify-request.json",
450
941
  "title": "POST /v0/verify request (section 9)",
451
- "description": "Canonical form. Registries normalize case and whitespace before validating (see normalizeVerifyRequest).",
942
+ "description": "Canonical form. Call normalizeVerifyRequest on raw input first.",
452
943
  "type": "object",
453
944
  "required": [
454
945
  "brand_domain",
455
- "channel",
456
- "territory"
946
+ "channel"
457
947
  ],
458
948
  "additionalProperties": false,
459
949
  "properties": {
@@ -461,26 +951,65 @@ export const verifyRequest = {
461
951
  "$ref": "common.json#/$defs/domain"
462
952
  },
463
953
  "channel": {
464
- "$ref": "common.json#/$defs/verifiableChannel"
954
+ "$ref": "common.json#/$defs/channel"
465
955
  },
466
956
  "territory": {
467
957
  "$ref": "common.json#/$defs/countryCode"
468
958
  },
469
959
  "product_line": {
470
- "description": "Defaults to \"all\" when omitted.",
471
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
+ ]
472
1000
  }
473
1001
  }
474
1002
  };
475
1003
  export const verifyResponse = {
476
1004
  "$schema": "https://json-schema.org/draft/2020-12/schema",
477
- "$id": "https://authorizedretailers.ai/schemas/0.1/verify-response.json",
1005
+ "$id": "https://authorizedretailers.ai/schemas/0.2/verify-response.json",
478
1006
  "title": "POST /v0/verify response (section 9)",
479
1007
  "type": "object",
480
1008
  "required": [
481
1009
  "status",
482
1010
  "checked",
483
1011
  "valid_until",
1012
+ "stale_until",
484
1013
  "observed",
485
1014
  "signals",
486
1015
  "signature"
@@ -492,7 +1021,7 @@ export const verifyResponse = {
492
1021
  "authorized",
493
1022
  "unlisted",
494
1023
  "expired",
495
- "brand_unverified",
1024
+ "brand_not_registered",
496
1025
  "disputed"
497
1026
  ]
498
1027
  },
@@ -500,21 +1029,75 @@ export const verifyResponse = {
500
1029
  "enum": [
501
1030
  "not_registered",
502
1031
  "domain_unlinked",
503
- "verification_lapsed"
1032
+ "verification_lapsed",
1033
+ "territory_mismatch",
1034
+ "product_excluded",
1035
+ "product_not_in_scope",
1036
+ "product_not_in_catalog"
504
1037
  ]
505
1038
  },
506
1039
  "authorization_id": {
507
1040
  "$ref": "common.json#/$defs/id"
508
1041
  },
1042
+ "revocation_id": {
1043
+ "$ref": "common.json#/$defs/revocationId"
1044
+ },
509
1045
  "expires": {
510
1046
  "$ref": "common.json#/$defs/timestamp"
511
1047
  },
512
1048
  "checked": {
513
1049
  "$ref": "common.json#/$defs/timestamp"
514
1050
  },
1051
+ "as_of": {
1052
+ "$ref": "common.json#/$defs/timestamp"
1053
+ },
515
1054
  "valid_until": {
516
1055
  "$ref": "common.json#/$defs/timestamp"
517
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
+ },
518
1101
  "observed": {
519
1102
  "description": "Section 7: when the registry last saw this seller selling on the channel, within 30 days; otherwise null",
520
1103
  "oneOf": [
@@ -568,11 +1151,20 @@ export const verifyResponse = {
568
1151
  "if": {
569
1152
  "properties": {
570
1153
  "status": {
571
- "const": "brand_unverified"
1154
+ "enum": [
1155
+ "authorized",
1156
+ "expired",
1157
+ "disputed"
1158
+ ]
572
1159
  }
573
1160
  }
574
1161
  },
575
1162
  "then": {
1163
+ "required": [
1164
+ "authorization_id"
1165
+ ]
1166
+ },
1167
+ "else": {
576
1168
  "not": {
577
1169
  "anyOf": [
578
1170
  {
@@ -587,29 +1179,64 @@ export const verifyResponse = {
587
1179
  }
588
1180
  ]
589
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
+ ]
590
1210
  },
591
1211
  "else": {
1212
+ "properties": {
1213
+ "observed": {
1214
+ "const": null
1215
+ }
1216
+ },
592
1217
  "not": {
593
1218
  "required": [
594
- "reason"
1219
+ "revocation_id"
595
1220
  ]
596
1221
  }
597
1222
  }
598
1223
  },
599
1224
  {
600
1225
  "if": {
601
- "not": {
602
- "properties": {
603
- "status": {
604
- "const": "authorized"
605
- }
1226
+ "properties": {
1227
+ "status": {
1228
+ "const": "brand_not_registered"
606
1229
  }
607
1230
  }
608
1231
  },
609
1232
  "then": {
610
1233
  "properties": {
611
- "observed": {
612
- "const": null
1234
+ "reason": {
1235
+ "enum": [
1236
+ "not_registered",
1237
+ "domain_unlinked",
1238
+ "verification_lapsed"
1239
+ ]
613
1240
  }
614
1241
  }
615
1242
  }
@@ -618,42 +1245,39 @@ export const verifyResponse = {
618
1245
  "if": {
619
1246
  "properties": {
620
1247
  "status": {
621
- "enum": [
622
- "authorized",
623
- "expired",
624
- "disputed"
625
- ]
1248
+ "const": "unlisted"
626
1249
  }
627
1250
  }
628
1251
  },
629
1252
  "then": {
630
- "required": [
631
- "authorization_id",
632
- "expires"
633
- ]
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
+ }
634
1263
  }
635
1264
  },
636
1265
  {
637
1266
  "if": {
638
1267
  "properties": {
639
1268
  "status": {
640
- "const": "unlisted"
1269
+ "enum": [
1270
+ "authorized",
1271
+ "expired",
1272
+ "disputed"
1273
+ ]
641
1274
  }
642
1275
  }
643
1276
  },
644
1277
  "then": {
645
1278
  "not": {
646
- "anyOf": [
647
- {
648
- "required": [
649
- "authorization_id"
650
- ]
651
- },
652
- {
653
- "required": [
654
- "expires"
655
- ]
656
- }
1279
+ "required": [
1280
+ "reason"
657
1281
  ]
658
1282
  }
659
1283
  }