@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
@@ -0,0 +1,761 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://authorizedretailers.ai/schemas/0.2/common.json",
4
+ "title": "Authorized Retailers v0.2 shared definitions",
5
+ "$defs": {
6
+ "specVersion": {
7
+ "const": "authorized-retailers/0.2"
8
+ },
9
+ "timestamp": {
10
+ "description": "RFC 3339 timestamp in UTC with a Z suffix.",
11
+ "type": "string",
12
+ "format": "date-time",
13
+ "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$"
14
+ },
15
+ "date": {
16
+ "description": "ISO 8601 calendar date.",
17
+ "type": "string",
18
+ "format": "date",
19
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
20
+ },
21
+ "domain": {
22
+ "description": "A bare hostname, lowercase: no scheme, port, path, trailing dot or leading www. (section 6).",
23
+ "type": "string",
24
+ "maxLength": 253,
25
+ "pattern": "^(?!www\\.)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+(?:[a-z]{2,63}|xn--[a-z0-9-]{1,59})$"
26
+ },
27
+ "countryCode": {
28
+ "description": "ISO 3166-1 alpha-2, uppercase. The United Kingdom is GB.",
29
+ "enum": [
30
+ "AD",
31
+ "AE",
32
+ "AF",
33
+ "AG",
34
+ "AI",
35
+ "AL",
36
+ "AM",
37
+ "AO",
38
+ "AQ",
39
+ "AR",
40
+ "AS",
41
+ "AT",
42
+ "AU",
43
+ "AW",
44
+ "AX",
45
+ "AZ",
46
+ "BA",
47
+ "BB",
48
+ "BD",
49
+ "BE",
50
+ "BF",
51
+ "BG",
52
+ "BH",
53
+ "BI",
54
+ "BJ",
55
+ "BL",
56
+ "BM",
57
+ "BN",
58
+ "BO",
59
+ "BQ",
60
+ "BR",
61
+ "BS",
62
+ "BT",
63
+ "BV",
64
+ "BW",
65
+ "BY",
66
+ "BZ",
67
+ "CA",
68
+ "CC",
69
+ "CD",
70
+ "CF",
71
+ "CG",
72
+ "CH",
73
+ "CI",
74
+ "CK",
75
+ "CL",
76
+ "CM",
77
+ "CN",
78
+ "CO",
79
+ "CR",
80
+ "CU",
81
+ "CV",
82
+ "CW",
83
+ "CX",
84
+ "CY",
85
+ "CZ",
86
+ "DE",
87
+ "DJ",
88
+ "DK",
89
+ "DM",
90
+ "DO",
91
+ "DZ",
92
+ "EC",
93
+ "EE",
94
+ "EG",
95
+ "EH",
96
+ "ER",
97
+ "ES",
98
+ "ET",
99
+ "FI",
100
+ "FJ",
101
+ "FK",
102
+ "FM",
103
+ "FO",
104
+ "FR",
105
+ "GA",
106
+ "GB",
107
+ "GD",
108
+ "GE",
109
+ "GF",
110
+ "GG",
111
+ "GH",
112
+ "GI",
113
+ "GL",
114
+ "GM",
115
+ "GN",
116
+ "GP",
117
+ "GQ",
118
+ "GR",
119
+ "GS",
120
+ "GT",
121
+ "GU",
122
+ "GW",
123
+ "GY",
124
+ "HK",
125
+ "HM",
126
+ "HN",
127
+ "HR",
128
+ "HT",
129
+ "HU",
130
+ "ID",
131
+ "IE",
132
+ "IL",
133
+ "IM",
134
+ "IN",
135
+ "IO",
136
+ "IQ",
137
+ "IR",
138
+ "IS",
139
+ "IT",
140
+ "JE",
141
+ "JM",
142
+ "JO",
143
+ "JP",
144
+ "KE",
145
+ "KG",
146
+ "KH",
147
+ "KI",
148
+ "KM",
149
+ "KN",
150
+ "KP",
151
+ "KR",
152
+ "KW",
153
+ "KY",
154
+ "KZ",
155
+ "LA",
156
+ "LB",
157
+ "LC",
158
+ "LI",
159
+ "LK",
160
+ "LR",
161
+ "LS",
162
+ "LT",
163
+ "LU",
164
+ "LV",
165
+ "LY",
166
+ "MA",
167
+ "MC",
168
+ "MD",
169
+ "ME",
170
+ "MF",
171
+ "MG",
172
+ "MH",
173
+ "MK",
174
+ "ML",
175
+ "MM",
176
+ "MN",
177
+ "MO",
178
+ "MP",
179
+ "MQ",
180
+ "MR",
181
+ "MS",
182
+ "MT",
183
+ "MU",
184
+ "MV",
185
+ "MW",
186
+ "MX",
187
+ "MY",
188
+ "MZ",
189
+ "NA",
190
+ "NC",
191
+ "NE",
192
+ "NF",
193
+ "NG",
194
+ "NI",
195
+ "NL",
196
+ "NO",
197
+ "NP",
198
+ "NR",
199
+ "NU",
200
+ "NZ",
201
+ "OM",
202
+ "PA",
203
+ "PE",
204
+ "PF",
205
+ "PG",
206
+ "PH",
207
+ "PK",
208
+ "PL",
209
+ "PM",
210
+ "PN",
211
+ "PR",
212
+ "PS",
213
+ "PT",
214
+ "PW",
215
+ "PY",
216
+ "QA",
217
+ "RE",
218
+ "RO",
219
+ "RS",
220
+ "RU",
221
+ "RW",
222
+ "SA",
223
+ "SB",
224
+ "SC",
225
+ "SD",
226
+ "SE",
227
+ "SG",
228
+ "SH",
229
+ "SI",
230
+ "SJ",
231
+ "SK",
232
+ "SL",
233
+ "SM",
234
+ "SN",
235
+ "SO",
236
+ "SR",
237
+ "SS",
238
+ "ST",
239
+ "SV",
240
+ "SX",
241
+ "SY",
242
+ "SZ",
243
+ "TC",
244
+ "TD",
245
+ "TF",
246
+ "TG",
247
+ "TH",
248
+ "TJ",
249
+ "TK",
250
+ "TL",
251
+ "TM",
252
+ "TN",
253
+ "TO",
254
+ "TR",
255
+ "TT",
256
+ "TV",
257
+ "TW",
258
+ "TZ",
259
+ "UA",
260
+ "UG",
261
+ "UM",
262
+ "US",
263
+ "UY",
264
+ "UZ",
265
+ "VA",
266
+ "VC",
267
+ "VE",
268
+ "VG",
269
+ "VI",
270
+ "VN",
271
+ "VU",
272
+ "WF",
273
+ "WS",
274
+ "YE",
275
+ "YT",
276
+ "ZA",
277
+ "ZM",
278
+ "ZW"
279
+ ]
280
+ },
281
+ "httpsUrl": {
282
+ "type": "string",
283
+ "format": "uri",
284
+ "pattern": "^https://",
285
+ "maxLength": 2048
286
+ },
287
+ "registryUrl": {
288
+ "description": "Section 5.1: a list URL MUST be on authorizedretailers.ai.",
289
+ "type": "string",
290
+ "format": "uri",
291
+ "pattern": "^https://authorizedretailers\\.ai/",
292
+ "maxLength": 2048
293
+ },
294
+ "id": {
295
+ "type": "string",
296
+ "pattern": "^[A-Za-z0-9_-]{1,64}$"
297
+ },
298
+ "revocationId": {
299
+ "description": "Section 10.3: a random value, rv_ followed by at least 16 base64url characters.",
300
+ "type": "string",
301
+ "pattern": "^rv_[A-Za-z0-9_-]{16,64}$"
302
+ },
303
+ "nonEmptyString": {
304
+ "type": "string",
305
+ "minLength": 1,
306
+ "maxLength": 256
307
+ },
308
+ "sellerId": {
309
+ "type": "string",
310
+ "pattern": "^\\S{1,128}$"
311
+ },
312
+ "amazonChannel": {
313
+ "type": "object",
314
+ "required": [
315
+ "type",
316
+ "domain",
317
+ "seller_id"
318
+ ],
319
+ "additionalProperties": false,
320
+ "properties": {
321
+ "type": {
322
+ "const": "amazon"
323
+ },
324
+ "domain": {
325
+ "enum": [
326
+ "amazon.com",
327
+ "amazon.ca",
328
+ "amazon.co.uk",
329
+ "amazon.de",
330
+ "amazon.fr",
331
+ "amazon.it",
332
+ "amazon.es",
333
+ "amazon.com.au"
334
+ ]
335
+ },
336
+ "seller_id": {
337
+ "$ref": "#/$defs/sellerId"
338
+ }
339
+ }
340
+ },
341
+ "walmartChannel": {
342
+ "type": "object",
343
+ "required": [
344
+ "type",
345
+ "domain",
346
+ "seller_id"
347
+ ],
348
+ "additionalProperties": false,
349
+ "properties": {
350
+ "type": {
351
+ "const": "walmart"
352
+ },
353
+ "domain": {
354
+ "enum": [
355
+ "walmart.com",
356
+ "walmart.ca"
357
+ ]
358
+ },
359
+ "seller_id": {
360
+ "$ref": "#/$defs/sellerId"
361
+ }
362
+ }
363
+ },
364
+ "ebayChannel": {
365
+ "type": "object",
366
+ "required": [
367
+ "type",
368
+ "domain",
369
+ "seller_id"
370
+ ],
371
+ "additionalProperties": false,
372
+ "properties": {
373
+ "type": {
374
+ "const": "ebay"
375
+ },
376
+ "domain": {
377
+ "enum": [
378
+ "ebay.com",
379
+ "ebay.co.uk",
380
+ "ebay.ca",
381
+ "ebay.de",
382
+ "ebay.com.au"
383
+ ]
384
+ },
385
+ "seller_id": {
386
+ "$ref": "#/$defs/sellerId"
387
+ }
388
+ }
389
+ },
390
+ "webChannel": {
391
+ "type": "object",
392
+ "required": [
393
+ "type",
394
+ "domain"
395
+ ],
396
+ "additionalProperties": false,
397
+ "properties": {
398
+ "type": {
399
+ "const": "web"
400
+ },
401
+ "domain": {
402
+ "allOf": [
403
+ {
404
+ "$ref": "#/$defs/domain"
405
+ },
406
+ {
407
+ "not": {
408
+ "enum": [
409
+ "amazon.com",
410
+ "amazon.ca",
411
+ "amazon.co.uk",
412
+ "amazon.de",
413
+ "amazon.fr",
414
+ "amazon.it",
415
+ "amazon.es",
416
+ "amazon.com.au",
417
+ "walmart.com",
418
+ "walmart.ca",
419
+ "ebay.com",
420
+ "ebay.co.uk",
421
+ "ebay.ca",
422
+ "ebay.de",
423
+ "ebay.com.au"
424
+ ]
425
+ }
426
+ }
427
+ ]
428
+ }
429
+ }
430
+ },
431
+ "channel": {
432
+ "description": "Section 6. Every channel is identified by a domain.",
433
+ "oneOf": [
434
+ {
435
+ "$ref": "#/$defs/amazonChannel"
436
+ },
437
+ {
438
+ "$ref": "#/$defs/walmartChannel"
439
+ },
440
+ {
441
+ "$ref": "#/$defs/ebayChannel"
442
+ },
443
+ {
444
+ "$ref": "#/$defs/webChannel"
445
+ }
446
+ ]
447
+ },
448
+ "party": {
449
+ "type": "object",
450
+ "required": [
451
+ "name"
452
+ ],
453
+ "additionalProperties": false,
454
+ "properties": {
455
+ "name": {
456
+ "$ref": "#/$defs/nonEmptyString"
457
+ },
458
+ "entity_id": {
459
+ "$ref": "#/$defs/id"
460
+ }
461
+ }
462
+ },
463
+ "territories": {
464
+ "description": "ISO 3166-1 alpha-2 codes, or exactly [\"*\"] for worldwide.",
465
+ "type": "array",
466
+ "minItems": 1,
467
+ "uniqueItems": true,
468
+ "anyOf": [
469
+ {
470
+ "const": [
471
+ "*"
472
+ ]
473
+ },
474
+ {
475
+ "items": {
476
+ "$ref": "#/$defs/countryCode"
477
+ }
478
+ }
479
+ ]
480
+ },
481
+ "productLine": {
482
+ "type": "string",
483
+ "minLength": 1,
484
+ "maxLength": 64,
485
+ "pattern": "^\\S(.*\\S)?$"
486
+ },
487
+ "productLines": {
488
+ "description": "Named product lines, or exactly [\"all\"].",
489
+ "type": "array",
490
+ "minItems": 1,
491
+ "uniqueItems": true,
492
+ "anyOf": [
493
+ {
494
+ "const": [
495
+ "all"
496
+ ]
497
+ },
498
+ {
499
+ "items": {
500
+ "allOf": [
501
+ {
502
+ "$ref": "#/$defs/productLine"
503
+ },
504
+ {
505
+ "not": {
506
+ "const": "all"
507
+ }
508
+ }
509
+ ]
510
+ }
511
+ }
512
+ ]
513
+ },
514
+ "namedProductLines": {
515
+ "type": "array",
516
+ "uniqueItems": true,
517
+ "items": {
518
+ "allOf": [
519
+ {
520
+ "$ref": "#/$defs/productLine"
521
+ },
522
+ {
523
+ "not": {
524
+ "const": "all"
525
+ }
526
+ }
527
+ ]
528
+ }
529
+ },
530
+ "productIds": {
531
+ "type": "array",
532
+ "uniqueItems": true,
533
+ "items": {
534
+ "$ref": "#/$defs/id"
535
+ }
536
+ },
537
+ "gtin": {
538
+ "description": "8, 12, 13 or 14 digits with a valid GS1 check digit (checked by the validator).",
539
+ "type": "string",
540
+ "pattern": "^([0-9]{8}|[0-9]{12,14})$"
541
+ },
542
+ "asin": {
543
+ "description": "10 uppercase letters or digits.",
544
+ "type": "string",
545
+ "pattern": "^[A-Z0-9]{10}$"
546
+ },
547
+ "product": {
548
+ "description": "Section 3.1. At least one of gtin or asins.",
549
+ "type": "object",
550
+ "required": [
551
+ "id",
552
+ "name"
553
+ ],
554
+ "additionalProperties": false,
555
+ "properties": {
556
+ "id": {
557
+ "$ref": "#/$defs/id"
558
+ },
559
+ "name": {
560
+ "$ref": "#/$defs/nonEmptyString"
561
+ },
562
+ "product_line": {
563
+ "$ref": "#/$defs/productLine"
564
+ },
565
+ "attributes": {
566
+ "type": "object",
567
+ "maxProperties": 32,
568
+ "propertyNames": {
569
+ "minLength": 1,
570
+ "maxLength": 64
571
+ },
572
+ "additionalProperties": {
573
+ "type": "string",
574
+ "maxLength": 256
575
+ }
576
+ },
577
+ "gtin": {
578
+ "$ref": "#/$defs/gtin"
579
+ },
580
+ "asins": {
581
+ "type": "array",
582
+ "minItems": 1,
583
+ "uniqueItems": true,
584
+ "items": {
585
+ "$ref": "#/$defs/asin"
586
+ }
587
+ }
588
+ },
589
+ "anyOf": [
590
+ {
591
+ "required": [
592
+ "gtin"
593
+ ]
594
+ },
595
+ {
596
+ "required": [
597
+ "asins"
598
+ ]
599
+ }
600
+ ]
601
+ },
602
+ "scope": {
603
+ "description": "Section 3. product_lines, products or both; territories optional (section 6.2).",
604
+ "type": "object",
605
+ "additionalProperties": false,
606
+ "properties": {
607
+ "territories": {
608
+ "$ref": "#/$defs/territories"
609
+ },
610
+ "product_lines": {
611
+ "$ref": "#/$defs/productLines"
612
+ },
613
+ "products": {
614
+ "allOf": [
615
+ {
616
+ "$ref": "#/$defs/productIds"
617
+ },
618
+ {
619
+ "minItems": 1
620
+ }
621
+ ]
622
+ },
623
+ "exclude_product_lines": {
624
+ "$ref": "#/$defs/namedProductLines"
625
+ },
626
+ "exclude_products": {
627
+ "$ref": "#/$defs/productIds"
628
+ }
629
+ },
630
+ "anyOf": [
631
+ {
632
+ "required": [
633
+ "product_lines"
634
+ ]
635
+ },
636
+ {
637
+ "required": [
638
+ "products"
639
+ ]
640
+ }
641
+ ]
642
+ },
643
+ "exclusions": {
644
+ "type": "object",
645
+ "additionalProperties": false,
646
+ "properties": {
647
+ "product_lines": {
648
+ "$ref": "#/$defs/namedProductLines"
649
+ },
650
+ "products": {
651
+ "$ref": "#/$defs/productIds"
652
+ }
653
+ }
654
+ },
655
+ "authorization": {
656
+ "type": "object",
657
+ "required": [
658
+ "id",
659
+ "revocation_id",
660
+ "retailer",
661
+ "channels",
662
+ "scope"
663
+ ],
664
+ "additionalProperties": false,
665
+ "properties": {
666
+ "id": {
667
+ "$ref": "#/$defs/id"
668
+ },
669
+ "revocation_id": {
670
+ "$ref": "#/$defs/revocationId"
671
+ },
672
+ "retailer": {
673
+ "$ref": "#/$defs/party"
674
+ },
675
+ "channels": {
676
+ "type": "array",
677
+ "minItems": 1,
678
+ "items": {
679
+ "$ref": "#/$defs/channel"
680
+ }
681
+ },
682
+ "scope": {
683
+ "$ref": "#/$defs/scope"
684
+ },
685
+ "proposed_by": {
686
+ "description": "The distributor that proposed this authorization, if any (section 3).",
687
+ "oneOf": [
688
+ {
689
+ "type": "null"
690
+ },
691
+ {
692
+ "$ref": "#/$defs/party"
693
+ }
694
+ ]
695
+ },
696
+ "expires": {
697
+ "description": "Optional end date set by the brand (section 10).",
698
+ "$ref": "#/$defs/timestamp"
699
+ }
700
+ }
701
+ },
702
+ "brand": {
703
+ "description": "Pointer form: one domain.",
704
+ "type": "object",
705
+ "required": [
706
+ "name",
707
+ "domain"
708
+ ],
709
+ "additionalProperties": false,
710
+ "properties": {
711
+ "name": {
712
+ "$ref": "#/$defs/nonEmptyString"
713
+ },
714
+ "domain": {
715
+ "$ref": "#/$defs/domain"
716
+ }
717
+ }
718
+ },
719
+ "listBrand": {
720
+ "description": "Every domain the list applies to (section 5.2).",
721
+ "type": "object",
722
+ "required": [
723
+ "name",
724
+ "domains"
725
+ ],
726
+ "additionalProperties": false,
727
+ "properties": {
728
+ "name": {
729
+ "$ref": "#/$defs/nonEmptyString"
730
+ },
731
+ "domains": {
732
+ "type": "array",
733
+ "minItems": 1,
734
+ "uniqueItems": true,
735
+ "items": {
736
+ "$ref": "#/$defs/domain"
737
+ }
738
+ }
739
+ }
740
+ },
741
+ "signature": {
742
+ "type": "object",
743
+ "required": [
744
+ "kid",
745
+ "jws"
746
+ ],
747
+ "additionalProperties": false,
748
+ "properties": {
749
+ "kid": {
750
+ "type": "string",
751
+ "pattern": "^[A-Za-z0-9._-]{1,64}$"
752
+ },
753
+ "jws": {
754
+ "description": "Detached compact JWS: header..signature (empty payload segment).",
755
+ "type": "string",
756
+ "pattern": "^[A-Za-z0-9_-]+\\.\\.[A-Za-z0-9_-]+$"
757
+ }
758
+ }
759
+ }
760
+ }
761
+ }