@authorizedretailers/spec 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/LICENSE +202 -0
  2. package/LICENSE-SPEC +396 -0
  3. package/README.md +130 -0
  4. package/dist/constants.d.ts +6 -0
  5. package/dist/constants.js +7 -0
  6. package/dist/identity.d.ts +27 -0
  7. package/dist/identity.js +92 -0
  8. package/dist/index.d.ts +8 -0
  9. package/dist/index.js +8 -0
  10. package/dist/jcs.d.ts +5 -0
  11. package/dist/jcs.js +47 -0
  12. package/dist/jws.d.ts +42 -0
  13. package/dist/jws.js +90 -0
  14. package/dist/published.d.ts +15 -0
  15. package/dist/published.js +15 -0
  16. package/dist/schemas.d.ts +519 -0
  17. package/dist/schemas.js +662 -0
  18. package/dist/timestamp.d.ts +6 -0
  19. package/dist/timestamp.js +26 -0
  20. package/dist/types.d.ts +116 -0
  21. package/dist/types.js +2 -0
  22. package/dist/validate.d.ts +28 -0
  23. package/dist/validate.js +147 -0
  24. package/fixtures/file/invalid/full-all-mixed.json +47 -0
  25. package/fixtures/file/invalid/full-amazon-missing-seller-id.json +45 -0
  26. package/fixtures/file/invalid/full-attached-jws.json +50 -0
  27. package/fixtures/file/invalid/full-authorization-expires-after-file.json +46 -0
  28. package/fixtures/file/invalid/full-duplicate-authorization-id.json +80 -0
  29. package/fixtures/file/invalid/full-empty-territories.json +43 -0
  30. package/fixtures/file/invalid/full-expires-before-issued.json +46 -0
  31. package/fixtures/file/invalid/full-expiry-over-180-days.json +46 -0
  32. package/fixtures/file/invalid/full-extra-property.json +47 -0
  33. package/fixtures/file/invalid/full-impossible-date.json +46 -0
  34. package/fixtures/file/invalid/full-lowercase-territory.json +45 -0
  35. package/fixtures/file/invalid/full-missing-authorization-expires.json +45 -0
  36. package/fixtures/file/invalid/full-missing-file-expires.json +45 -0
  37. package/fixtures/file/invalid/full-missing-product-lines.json +43 -0
  38. package/fixtures/file/invalid/full-missing-scope.json +37 -0
  39. package/fixtures/file/invalid/full-missing-territories.json +42 -0
  40. package/fixtures/file/invalid/full-name-only-retailer.json +30 -0
  41. package/fixtures/file/invalid/full-no-channels.json +31 -0
  42. package/fixtures/file/invalid/full-non-utc-timestamp.json +46 -0
  43. package/fixtures/file/invalid/full-physical-missing-country.json +50 -0
  44. package/fixtures/file/invalid/full-signature-missing-kid.json +49 -0
  45. package/fixtures/file/invalid/full-unknown-channel-type.json +50 -0
  46. package/fixtures/file/invalid/full-web-domain-is-url.json +46 -0
  47. package/fixtures/file/invalid/full-web-missing-domain.json +45 -0
  48. package/fixtures/file/invalid/full-wildcard-mixed.json +46 -0
  49. package/fixtures/file/invalid/full-wrong-spec.json +46 -0
  50. package/fixtures/file/invalid/pointer-http-url.json +9 -0
  51. package/fixtures/file/invalid/private-missing-verify.json +8 -0
  52. package/fixtures/file/invalid/private-with-authorizations.json +45 -0
  53. package/fixtures/file/invalid/unknown-form.json +9 -0
  54. package/fixtures/file/valid/full-fractional-seconds.json +46 -0
  55. package/fixtures/file/valid/full-max-expiry.json +46 -0
  56. package/fixtures/file/valid/full-no-authorizations.json +11 -0
  57. package/fixtures/file/valid/full-signed.json +50 -0
  58. package/fixtures/file/valid/full-unsigned-handwritten.json +46 -0
  59. package/fixtures/file/valid/full-worldwide-physical-proposed.json +82 -0
  60. package/fixtures/file/valid/pointer.json +9 -0
  61. package/fixtures/file/valid/private.json +9 -0
  62. package/fixtures/manifest.json +434 -0
  63. package/fixtures/verify-request/invalid/domain-with-scheme.json +10 -0
  64. package/fixtures/verify-request/invalid/missing-channel.json +5 -0
  65. package/fixtures/verify-request/invalid/physical-channel.json +10 -0
  66. package/fixtures/verify-request/invalid/retailer-name-only.json +6 -0
  67. package/fixtures/verify-request/invalid/wildcard-territory.json +10 -0
  68. package/fixtures/verify-request/valid/amazon.json +10 -0
  69. package/fixtures/verify-request/valid/web-no-product-line.json +8 -0
  70. package/fixtures/verify-response/invalid/authorized-missing-authorization-id.json +12 -0
  71. package/fixtures/verify-response/invalid/missing-observed.json +12 -0
  72. package/fixtures/verify-response/invalid/missing-signature.json +9 -0
  73. package/fixtures/verify-response/invalid/missing-valid-until.json +12 -0
  74. package/fixtures/verify-response/invalid/observed-without-last-seen.json +13 -0
  75. package/fixtures/verify-response/invalid/unknown-status.json +13 -0
  76. package/fixtures/verify-response/invalid/unlisted-observed.json +13 -0
  77. package/fixtures/verify-response/invalid/unlisted-with-authorization-id.json +12 -0
  78. package/fixtures/verify-response/invalid/unlisted-with-reason.json +12 -0
  79. package/fixtures/verify-response/invalid/valid-until-before-checked.json +13 -0
  80. package/fixtures/verify-response/invalid/valid-until-over-24h.json +13 -0
  81. package/fixtures/verify-response/invalid/with-tier.json +14 -0
  82. package/fixtures/verify-response/valid/authorized-observed.json +15 -0
  83. package/fixtures/verify-response/valid/authorized.json +13 -0
  84. package/fixtures/verify-response/valid/brand-unverified-no-reason.json +11 -0
  85. package/fixtures/verify-response/valid/brand-unverified-reason.json +12 -0
  86. package/fixtures/verify-response/valid/disputed.json +13 -0
  87. package/fixtures/verify-response/valid/expired.json +13 -0
  88. package/fixtures/verify-response/valid/unlisted.json +11 -0
  89. package/fixtures/verify-response/valid/with-signal.json +19 -0
  90. package/package.json +76 -0
  91. package/schemas/common.json +170 -0
  92. package/schemas/file-full.json +23 -0
  93. package/schemas/file-pointer.json +14 -0
  94. package/schemas/file-private.json +14 -0
  95. package/schemas/file.json +13 -0
  96. package/schemas/verify-request.json +18 -0
  97. package/schemas/verify-response.json +61 -0
  98. package/spec/spec-v0.1.md +282 -0
@@ -0,0 +1,519 @@
1
+ export declare const common: {
2
+ $schema: string;
3
+ $id: string;
4
+ title: string;
5
+ $defs: {
6
+ specVersion: {
7
+ const: string;
8
+ };
9
+ timestamp: {
10
+ description: string;
11
+ type: string;
12
+ format: string;
13
+ pattern: string;
14
+ };
15
+ domain: {
16
+ description: string;
17
+ type: string;
18
+ maxLength: number;
19
+ pattern: string;
20
+ };
21
+ countryCode: {
22
+ description: string;
23
+ type: string;
24
+ pattern: string;
25
+ };
26
+ httpsUrl: {
27
+ type: string;
28
+ format: string;
29
+ pattern: string;
30
+ maxLength: number;
31
+ };
32
+ id: {
33
+ type: string;
34
+ pattern: string;
35
+ };
36
+ nonEmptyString: {
37
+ type: string;
38
+ minLength: number;
39
+ maxLength: number;
40
+ };
41
+ brand: {
42
+ type: string;
43
+ required: string[];
44
+ additionalProperties: boolean;
45
+ properties: {
46
+ name: {
47
+ $ref: string;
48
+ };
49
+ domain: {
50
+ $ref: string;
51
+ };
52
+ };
53
+ };
54
+ sellerId: {
55
+ type: string;
56
+ pattern: string;
57
+ };
58
+ marketplaceChannel: {
59
+ type: string;
60
+ required: string[];
61
+ additionalProperties: boolean;
62
+ properties: {
63
+ type: {
64
+ enum: string[];
65
+ };
66
+ marketplace: {
67
+ $ref: string;
68
+ };
69
+ seller_id: {
70
+ $ref: string;
71
+ };
72
+ };
73
+ };
74
+ webChannel: {
75
+ type: string;
76
+ required: string[];
77
+ additionalProperties: boolean;
78
+ properties: {
79
+ type: {
80
+ const: string;
81
+ };
82
+ domain: {
83
+ $ref: string;
84
+ };
85
+ };
86
+ };
87
+ physicalChannel: {
88
+ type: string;
89
+ required: string[];
90
+ additionalProperties: boolean;
91
+ properties: {
92
+ type: {
93
+ const: string;
94
+ };
95
+ address: {
96
+ type: string;
97
+ minLength: number;
98
+ maxLength: number;
99
+ };
100
+ country: {
101
+ $ref: string;
102
+ };
103
+ };
104
+ };
105
+ verifiableChannel: {
106
+ description: string;
107
+ oneOf: {
108
+ $ref: string;
109
+ }[];
110
+ };
111
+ channel: {
112
+ oneOf: {
113
+ $ref: string;
114
+ }[];
115
+ };
116
+ party: {
117
+ type: string;
118
+ required: string[];
119
+ additionalProperties: boolean;
120
+ properties: {
121
+ name: {
122
+ $ref: string;
123
+ };
124
+ entity_id: {
125
+ $ref: string;
126
+ };
127
+ };
128
+ };
129
+ territories: {
130
+ description: string;
131
+ type: string;
132
+ minItems: number;
133
+ uniqueItems: boolean;
134
+ anyOf: ({
135
+ const: string[];
136
+ items?: never;
137
+ } | {
138
+ items: {
139
+ $ref: string;
140
+ };
141
+ const?: never;
142
+ })[];
143
+ };
144
+ productLine: {
145
+ type: string;
146
+ minLength: number;
147
+ maxLength: number;
148
+ pattern: string;
149
+ };
150
+ productLines: {
151
+ description: string;
152
+ type: string;
153
+ minItems: number;
154
+ uniqueItems: boolean;
155
+ anyOf: ({
156
+ const: string[];
157
+ items?: never;
158
+ } | {
159
+ items: {
160
+ allOf: ({
161
+ $ref: string;
162
+ not?: never;
163
+ } | {
164
+ not: {
165
+ const: string;
166
+ };
167
+ $ref?: never;
168
+ })[];
169
+ };
170
+ const?: never;
171
+ })[];
172
+ };
173
+ scope: {
174
+ type: string;
175
+ required: string[];
176
+ additionalProperties: boolean;
177
+ properties: {
178
+ territories: {
179
+ $ref: string;
180
+ };
181
+ product_lines: {
182
+ $ref: string;
183
+ };
184
+ };
185
+ };
186
+ authorization: {
187
+ type: string;
188
+ required: string[];
189
+ additionalProperties: boolean;
190
+ properties: {
191
+ id: {
192
+ $ref: string;
193
+ };
194
+ retailer: {
195
+ $ref: string;
196
+ };
197
+ channels: {
198
+ description: string;
199
+ type: string;
200
+ minItems: number;
201
+ items: {
202
+ $ref: string;
203
+ };
204
+ };
205
+ scope: {
206
+ $ref: string;
207
+ };
208
+ proposed_by: {
209
+ description: string;
210
+ oneOf: ({
211
+ type: string;
212
+ $ref?: never;
213
+ } | {
214
+ $ref: string;
215
+ type?: never;
216
+ })[];
217
+ };
218
+ expires: {
219
+ $ref: string;
220
+ };
221
+ };
222
+ };
223
+ signature: {
224
+ type: string;
225
+ required: string[];
226
+ additionalProperties: boolean;
227
+ properties: {
228
+ kid: {
229
+ type: string;
230
+ pattern: string;
231
+ };
232
+ jws: {
233
+ description: string;
234
+ type: string;
235
+ pattern: string;
236
+ };
237
+ };
238
+ };
239
+ };
240
+ };
241
+ export declare const fileFull: {
242
+ $schema: string;
243
+ $id: string;
244
+ title: string;
245
+ type: string;
246
+ required: string[];
247
+ additionalProperties: boolean;
248
+ properties: {
249
+ spec: {
250
+ $ref: string;
251
+ };
252
+ form: {
253
+ const: string;
254
+ };
255
+ brand: {
256
+ $ref: string;
257
+ };
258
+ issued: {
259
+ $ref: string;
260
+ };
261
+ expires: {
262
+ $ref: string;
263
+ };
264
+ authorizations: {
265
+ type: string;
266
+ items: {
267
+ $ref: string;
268
+ };
269
+ };
270
+ signature: {
271
+ description: string;
272
+ $ref: string;
273
+ };
274
+ };
275
+ };
276
+ export declare const filePointer: {
277
+ $schema: string;
278
+ $id: string;
279
+ title: string;
280
+ type: string;
281
+ required: string[];
282
+ additionalProperties: boolean;
283
+ properties: {
284
+ spec: {
285
+ $ref: string;
286
+ };
287
+ form: {
288
+ const: string;
289
+ };
290
+ brand: {
291
+ $ref: string;
292
+ };
293
+ list: {
294
+ $ref: string;
295
+ };
296
+ };
297
+ };
298
+ export declare const filePrivate: {
299
+ $schema: string;
300
+ $id: string;
301
+ title: string;
302
+ type: string;
303
+ required: string[];
304
+ additionalProperties: boolean;
305
+ properties: {
306
+ spec: {
307
+ $ref: string;
308
+ };
309
+ form: {
310
+ const: string;
311
+ };
312
+ brand: {
313
+ $ref: string;
314
+ };
315
+ verify: {
316
+ $ref: string;
317
+ };
318
+ };
319
+ };
320
+ export declare const file: {
321
+ $schema: string;
322
+ $id: string;
323
+ title: string;
324
+ type: string;
325
+ required: string[];
326
+ properties: {
327
+ form: {
328
+ enum: string[];
329
+ };
330
+ };
331
+ allOf: {
332
+ if: {
333
+ properties: {
334
+ form: {
335
+ const: string;
336
+ };
337
+ };
338
+ };
339
+ then: {
340
+ $ref: string;
341
+ };
342
+ }[];
343
+ };
344
+ export declare const verifyRequest: {
345
+ $schema: string;
346
+ $id: string;
347
+ title: string;
348
+ description: string;
349
+ type: string;
350
+ required: string[];
351
+ additionalProperties: boolean;
352
+ properties: {
353
+ brand_domain: {
354
+ $ref: string;
355
+ };
356
+ channel: {
357
+ $ref: string;
358
+ };
359
+ territory: {
360
+ $ref: string;
361
+ };
362
+ product_line: {
363
+ description: string;
364
+ $ref: string;
365
+ };
366
+ };
367
+ };
368
+ export declare const verifyResponse: {
369
+ $schema: string;
370
+ $id: string;
371
+ title: string;
372
+ type: string;
373
+ required: string[];
374
+ additionalProperties: boolean;
375
+ properties: {
376
+ status: {
377
+ enum: string[];
378
+ };
379
+ reason: {
380
+ enum: string[];
381
+ };
382
+ authorization_id: {
383
+ $ref: string;
384
+ };
385
+ expires: {
386
+ $ref: string;
387
+ };
388
+ checked: {
389
+ $ref: string;
390
+ };
391
+ valid_until: {
392
+ $ref: string;
393
+ };
394
+ observed: {
395
+ description: string;
396
+ oneOf: ({
397
+ type: string;
398
+ required?: never;
399
+ additionalProperties?: never;
400
+ properties?: never;
401
+ } | {
402
+ type: string;
403
+ required: string[];
404
+ additionalProperties: boolean;
405
+ properties: {
406
+ last_seen: {
407
+ $ref: string;
408
+ };
409
+ };
410
+ })[];
411
+ };
412
+ signals: {
413
+ type: string;
414
+ items: {
415
+ type: string;
416
+ required: string[];
417
+ additionalProperties: boolean;
418
+ properties: {
419
+ type: {
420
+ type: string;
421
+ pattern: string;
422
+ };
423
+ observed: {
424
+ $ref: string;
425
+ };
426
+ detail: {
427
+ type: string;
428
+ maxLength: number;
429
+ };
430
+ };
431
+ };
432
+ };
433
+ signature: {
434
+ $ref: string;
435
+ };
436
+ };
437
+ allOf: ({
438
+ if: {
439
+ properties: {
440
+ status: {
441
+ const: string;
442
+ enum?: never;
443
+ };
444
+ };
445
+ not?: never;
446
+ };
447
+ then: {
448
+ not: {
449
+ anyOf: {
450
+ required: string[];
451
+ }[];
452
+ };
453
+ properties?: never;
454
+ required?: never;
455
+ };
456
+ else: {
457
+ not: {
458
+ required: string[];
459
+ };
460
+ };
461
+ } | {
462
+ if: {
463
+ not: {
464
+ properties: {
465
+ status: {
466
+ const: string;
467
+ };
468
+ };
469
+ };
470
+ properties?: never;
471
+ };
472
+ then: {
473
+ properties: {
474
+ observed: {
475
+ const: null;
476
+ };
477
+ };
478
+ not?: never;
479
+ required?: never;
480
+ };
481
+ else?: never;
482
+ } | {
483
+ if: {
484
+ properties: {
485
+ status: {
486
+ enum: string[];
487
+ const?: never;
488
+ };
489
+ };
490
+ not?: never;
491
+ };
492
+ then: {
493
+ required: string[];
494
+ not?: never;
495
+ properties?: never;
496
+ };
497
+ else?: never;
498
+ } | {
499
+ if: {
500
+ properties: {
501
+ status: {
502
+ const: string;
503
+ enum?: never;
504
+ };
505
+ };
506
+ not?: never;
507
+ };
508
+ then: {
509
+ not: {
510
+ anyOf: {
511
+ required: string[];
512
+ }[];
513
+ };
514
+ properties?: never;
515
+ required?: never;
516
+ };
517
+ else?: never;
518
+ })[];
519
+ };