@pagefront/lint-commerce 0.9.0 → 0.11.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 (44) hide show
  1. package/README.md +57 -13
  2. package/dist/catalogue.js +5 -3
  3. package/dist/generated/release-manifest.d.ts +22 -0
  4. package/dist/generated/release-manifest.js +27 -0
  5. package/dist/generated/schema-ids.d.ts +1 -0
  6. package/dist/generated/schema-ids.js +7 -0
  7. package/dist/generated/schema-properties.d.ts +1 -0
  8. package/dist/{schema-properties.js → generated/schema-properties.js} +2 -10
  9. package/dist/generated/schemas.d.ts +1 -0
  10. package/dist/generated/schemas.js +4883 -0
  11. package/dist/index.d.ts +10 -4
  12. package/dist/index.js +9 -3
  13. package/dist/organization-catalogue.js +6 -3
  14. package/dist/releases.d.ts +22 -0
  15. package/dist/releases.js +27 -0
  16. package/dist/rules/org-e-002.d.ts +7 -0
  17. package/dist/rules/org-e-002.js +13 -0
  18. package/dist/rules/org-e-003.d.ts +7 -0
  19. package/dist/rules/org-e-003.js +13 -0
  20. package/dist/rules/pdp-e-002.d.ts +3 -9
  21. package/dist/rules/pdp-e-002.js +6 -26
  22. package/dist/rules/pdp-e-016.d.ts +7 -0
  23. package/dist/rules/pdp-e-016.js +13 -0
  24. package/dist/rules/pdp-i-001.js +3 -2
  25. package/dist/rules/release-schema.d.ts +16 -0
  26. package/dist/rules/release-schema.js +77 -0
  27. package/dist/schema-registry.d.ts +29 -0
  28. package/dist/schema-registry.js +35 -0
  29. package/dist/schema-validators.d.ts +7 -6
  30. package/dist/schema-validators.js +15 -3
  31. package/dist/sheet-type.d.ts +17 -0
  32. package/dist/sheet-type.js +25 -0
  33. package/dist/validate-and-lint.d.ts +24 -17
  34. package/dist/validate-and-lint.js +47 -28
  35. package/dist/validate-organization.d.ts +5 -5
  36. package/dist/validate-organization.js +8 -15
  37. package/dist/version.d.ts +1 -1
  38. package/dist/version.js +1 -1
  39. package/package.json +3 -3
  40. package/dist/organization-schema.d.ts +0 -9
  41. package/dist/organization-schema.js +0 -441
  42. package/dist/product-schema.d.ts +0 -9
  43. package/dist/product-schema.js +0 -2014
  44. package/dist/schema-properties.d.ts +0 -10
@@ -1,441 +0,0 @@
1
- /**
2
- * The Pagefront Commerce Organization Sheet JSON Schema
3
- * (commerce/spec/organization.json, format 0.9), bundled verbatim so
4
- * the published package can run Layer 1 validation without the
5
- * monorepo checkout. Generated from the spec file; the schema drift
6
- * test (test/schema.test.mjs) fails when the two diverge. Regenerate
7
- * on any schema change, in the same change that motivates it.
8
- */
9
- export const ORGANIZATION_SCHEMA = {
10
- "$schema": "https://json-schema.org/draft/2020-12/schema",
11
- "$id": "https://themachineweb.org/pagefront/spec/commerce/organization/v0.9.json",
12
- "title": "Pagefront Commerce Organization Sheet v0.9",
13
- "description": "Formal schema for the Pagefront Commerce Organization Sheet — the sheet describing the entity behind products (brand owner, manufacturer, seller), introduced with commerce format 0.9 alongside the reference-capable legalEntity and the seller-sheet return/shipping model. The data block roots on Schema.org Organization (recognized subtypes permitted; @type is not constrained to a single value). pagefront:commerceRole is the required role discriminator, an array of one or more values from the closed enum brand_owner / manufacturer / seller. pagefront:fulfillmentTerms carries the store-wide shipping defaults as an array of Schema.org-native OfferShippingDetails objects; only the attachment shell is validated, the payload is Schema.org content. pagefront:socialAccount carries the organization's official social accounts (platform / url / handle; publisher-stated only), distinct from sameAs, which carries identity authority records only. pagefront:authorizedResellers carries the brand's authorization claim over its distribution — a pagefront:AuthorizedResellers object with an optional exhaustive flag and a reseller array whose entries name an Organization either as a reference stub (@id) or inline (name plus url and/or address), with optional Schema.org-native areaServed; valid only where commerceRole includes brand_owner (linter ORG-W-006). There is no GTIN-equivalent identifier requirement: identity is @id + name. Validates the envelope and pagefront-namespaced extensions strictly; Schema.org-typed blocks permit additional unspecified properties.",
14
- "type": "object",
15
- "required": [
16
- "format_version",
17
- "schema_org_version",
18
- "canonical_url",
19
- "sheet_url",
20
- "generated_at",
21
- "data"
22
- ],
23
- "properties": {
24
- "$schema": {
25
- "type": "string",
26
- "format": "uri"
27
- },
28
- "format_version": {
29
- "const": "0.9"
30
- },
31
- "schema_org_version": {
32
- "type": "string",
33
- "pattern": "^\\d+(\\.\\d+)?$"
34
- },
35
- "canonical_url": {
36
- "type": "string",
37
- "format": "uri"
38
- },
39
- "sheet_url": {
40
- "type": "string",
41
- "format": "uri"
42
- },
43
- "generated_at": {
44
- "type": "string",
45
- "format": "date-time"
46
- },
47
- "expires_at": {
48
- "type": "string",
49
- "format": "date-time"
50
- },
51
- "data": {
52
- "$ref": "#/$defs/dataBlock"
53
- }
54
- },
55
- "additionalProperties": false,
56
- "$defs": {
57
- "dataBlock": {
58
- "type": "object",
59
- "required": [
60
- "@context",
61
- "@type",
62
- "@id",
63
- "name",
64
- "inLanguage",
65
- "pagefront:commerceRole"
66
- ],
67
- "properties": {
68
- "@context": {
69
- "oneOf": [
70
- {
71
- "const": "https://schema.org"
72
- },
73
- {
74
- "type": "array",
75
- "items": {
76
- "oneOf": [
77
- {
78
- "type": "string",
79
- "format": "uri"
80
- },
81
- {
82
- "type": "object"
83
- }
84
- ]
85
- },
86
- "minItems": 1
87
- }
88
- ]
89
- },
90
- "@type": {
91
- "type": "string"
92
- },
93
- "@id": {
94
- "type": "string",
95
- "format": "uri"
96
- },
97
- "name": {
98
- "type": "string",
99
- "minLength": 1
100
- },
101
- "legalName": {
102
- "type": "string"
103
- },
104
- "inLanguage": {
105
- "type": "string"
106
- },
107
- "url": {
108
- "type": "string",
109
- "format": "uri"
110
- },
111
- "description": {
112
- "type": "string"
113
- },
114
- "slogan": {
115
- "type": "string"
116
- },
117
- "logo": {
118
- "oneOf": [
119
- {
120
- "type": "string",
121
- "format": "uri"
122
- },
123
- {
124
- "type": "object"
125
- }
126
- ]
127
- },
128
- "iso6523Code": {
129
- "type": "string"
130
- },
131
- "identifier": {
132
- "oneOf": [
133
- {
134
- "type": "string"
135
- },
136
- {
137
- "type": "object"
138
- },
139
- {
140
- "type": "array",
141
- "items": {
142
- "oneOf": [
143
- {
144
- "type": "string"
145
- },
146
- {
147
- "type": "object"
148
- }
149
- ]
150
- }
151
- }
152
- ]
153
- },
154
- "sameAs": {
155
- "oneOf": [
156
- {
157
- "type": "string",
158
- "format": "uri"
159
- },
160
- {
161
- "type": "array",
162
- "items": {
163
- "type": "string",
164
- "format": "uri"
165
- }
166
- }
167
- ]
168
- },
169
- "email": {
170
- "type": "string",
171
- "format": "email"
172
- },
173
- "address": {
174
- "type": "object"
175
- },
176
- "contactPoint": {
177
- "oneOf": [
178
- {
179
- "type": "object"
180
- },
181
- {
182
- "type": "array",
183
- "items": {
184
- "type": "object"
185
- }
186
- }
187
- ]
188
- },
189
- "foundingDate": {
190
- "type": "string"
191
- },
192
- "numberOfEmployees": {
193
- "type": "object"
194
- },
195
- "parentOrganization": {
196
- "type": "object"
197
- },
198
- "subOrganization": {
199
- "oneOf": [
200
- {
201
- "type": "object"
202
- },
203
- {
204
- "type": "array",
205
- "items": {
206
- "type": "object"
207
- }
208
- }
209
- ]
210
- },
211
- "location": {
212
- "oneOf": [
213
- {
214
- "type": "object"
215
- },
216
- {
217
- "type": "array",
218
- "items": {
219
- "type": "object"
220
- }
221
- }
222
- ]
223
- },
224
- "brand": {
225
- "type": "object"
226
- },
227
- "aggregateRating": {
228
- "type": "object"
229
- },
230
- "hasCertification": {
231
- "type": "array",
232
- "items": {
233
- "$ref": "#/$defs/certification"
234
- }
235
- },
236
- "hasMerchantReturnPolicy": {
237
- "type": "object"
238
- },
239
- "paymentAccepted": {
240
- "oneOf": [
241
- {
242
- "type": "string"
243
- },
244
- {
245
- "type": "array",
246
- "items": {
247
- "type": "string"
248
- }
249
- }
250
- ]
251
- },
252
- "pagefront:commerceRole": {
253
- "type": "array",
254
- "minItems": 1,
255
- "items": {
256
- "type": "string",
257
- "enum": [
258
- "brand_owner",
259
- "manufacturer",
260
- "seller"
261
- ]
262
- }
263
- },
264
- "pagefront:fulfillmentTerms": {
265
- "type": "array",
266
- "items": {
267
- "type": "object",
268
- "required": [
269
- "@type"
270
- ],
271
- "properties": {
272
- "@type": {
273
- "const": "OfferShippingDetails"
274
- }
275
- },
276
- "additionalProperties": true
277
- }
278
- },
279
- "pagefront:socialAccount": {
280
- "type": "array",
281
- "items": {
282
- "type": "object",
283
- "required": [
284
- "platform",
285
- "url"
286
- ],
287
- "properties": {
288
- "@type": {
289
- "const": "pagefront:SocialAccount"
290
- },
291
- "platform": {
292
- "type": "string",
293
- "minLength": 1
294
- },
295
- "url": {
296
- "type": "string",
297
- "format": "uri"
298
- },
299
- "handle": {
300
- "type": "string",
301
- "minLength": 1
302
- }
303
- },
304
- "additionalProperties": true
305
- }
306
- },
307
- "pagefront:authorizedResellers": {
308
- "type": "object",
309
- "required": [
310
- "reseller"
311
- ],
312
- "properties": {
313
- "@type": {
314
- "const": "pagefront:AuthorizedResellers"
315
- },
316
- "exhaustive": {
317
- "type": "boolean"
318
- },
319
- "reseller": {
320
- "type": "array",
321
- "minItems": 1,
322
- "items": {
323
- "type": "object",
324
- "required": [
325
- "organization"
326
- ],
327
- "properties": {
328
- "organization": {
329
- "type": "object",
330
- "properties": {
331
- "@type": {
332
- "type": "string"
333
- },
334
- "@id": {
335
- "type": "string",
336
- "format": "uri"
337
- },
338
- "name": {
339
- "type": "string",
340
- "minLength": 1
341
- },
342
- "url": {
343
- "type": "string",
344
- "format": "uri"
345
- },
346
- "address": {
347
- "type": "object"
348
- }
349
- },
350
- "anyOf": [
351
- {
352
- "required": [
353
- "@id"
354
- ]
355
- },
356
- {
357
- "required": [
358
- "name",
359
- "url"
360
- ]
361
- },
362
- {
363
- "required": [
364
- "name",
365
- "address"
366
- ]
367
- }
368
- ],
369
- "additionalProperties": true
370
- },
371
- "areaServed": {
372
- "oneOf": [
373
- {
374
- "type": "object"
375
- },
376
- {
377
- "type": "array",
378
- "minItems": 1,
379
- "items": {
380
- "type": "object"
381
- }
382
- }
383
- ]
384
- }
385
- },
386
- "additionalProperties": false
387
- }
388
- }
389
- },
390
- "additionalProperties": false
391
- },
392
- "pagefront:availableLanguages": {
393
- "type": "array",
394
- "items": {
395
- "type": "object",
396
- "required": [
397
- "lang",
398
- "url"
399
- ],
400
- "properties": {
401
- "lang": {
402
- "type": "string"
403
- },
404
- "url": {
405
- "type": "string",
406
- "format": "uri"
407
- }
408
- },
409
- "additionalProperties": false
410
- }
411
- }
412
- },
413
- "additionalProperties": true
414
- },
415
- "certification": {
416
- "type": "object",
417
- "required": [
418
- "@type",
419
- "name"
420
- ],
421
- "properties": {
422
- "@type": {
423
- "const": "Certification"
424
- },
425
- "name": {
426
- "type": "string"
427
- },
428
- "issuedBy": {
429
- "type": "object"
430
- },
431
- "about": {
432
- "type": "string"
433
- },
434
- "additionalProperty": {
435
- "type": "array"
436
- }
437
- },
438
- "additionalProperties": true
439
- }
440
- }
441
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * The Pagefront product JSON Schema (commerce/spec/product.json,
3
- * format 0.9), bundled verbatim so the published package can run
4
- * Layer 1 validation without the monorepo checkout. Generated from
5
- * the spec file; the schema drift test (test/schema.test.mjs) fails
6
- * when the two diverge. Regenerate on any schema change, in the same
7
- * change that motivates it.
8
- */
9
- export declare const PRODUCT_SCHEMA: Record<string, unknown>;