@pacp/spec 1.0.2 → 2.0.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.
- package/README.md +9 -13
- package/dist/index.cjs +0 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -36
- package/dist/index.d.ts +27 -36
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/pacp.schema.json +146 -228
- package/dist/profiles/fiscal-br.schema.json +1 -1
- package/dist/profiles/iluminacao.schema.json +1 -1
- package/dist/profiles/moveis.schema.json +2 -2
- package/dist/profiles/pisos-revestimentos.schema.json +1 -1
- package/package.json +1 -1
package/dist/pacp.schema.json
CHANGED
|
@@ -1,78 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://cdn.jsdelivr.net/npm/@pacp/spec@latest/dist/pacp.schema.json",
|
|
4
|
-
"title": "PACP
|
|
4
|
+
"title": "PACP",
|
|
5
5
|
"oneOf": [
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"$ref": "#/$defs/productDocument"
|
|
11
|
-
}
|
|
6
|
+
{ "$ref": "#/$defs/catalog_document" },
|
|
7
|
+
{ "$ref": "#/$defs/product_document" }
|
|
12
8
|
],
|
|
13
9
|
"$defs": {
|
|
14
|
-
"
|
|
10
|
+
"catalog_document": {
|
|
15
11
|
"type": "object",
|
|
16
|
-
"required": ["
|
|
12
|
+
"required": ["document_type", "catalog", "rulesets"],
|
|
17
13
|
"additionalProperties": false,
|
|
18
|
-
"patternProperties": {
|
|
19
|
-
"^x-": true
|
|
20
|
-
},
|
|
14
|
+
"patternProperties": { "^x-": true },
|
|
21
15
|
"properties": {
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"const": "1.0.0"
|
|
25
|
-
},
|
|
26
|
-
"document_type": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"const": "CATALOG"
|
|
29
|
-
},
|
|
30
|
-
"catalog": {
|
|
31
|
-
"$ref": "#/$defs/catalog"
|
|
32
|
-
},
|
|
16
|
+
"document_type": { "type": "string", "const": "CATALOG" },
|
|
17
|
+
"catalog": { "$ref": "#/$defs/catalog" },
|
|
33
18
|
"product_refs": {
|
|
34
19
|
"type": "array",
|
|
35
|
-
"items": {
|
|
36
|
-
"$ref": "#/$defs/productRef"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"context": {
|
|
40
|
-
"$ref": "#/$defs/context"
|
|
41
|
-
},
|
|
42
|
-
"pricing": {
|
|
43
|
-
"$ref": "#/$defs/pricing"
|
|
20
|
+
"items": { "$ref": "#/$defs/product_ref" }
|
|
44
21
|
},
|
|
22
|
+
"context": { "$ref": "#/$defs/context" },
|
|
23
|
+
"pricing": { "$ref": "#/$defs/pricing" },
|
|
45
24
|
"dictionaries": {
|
|
46
25
|
"type": "object",
|
|
47
26
|
"additionalProperties": true,
|
|
48
|
-
"patternProperties": {
|
|
49
|
-
"^x-": true
|
|
50
|
-
}
|
|
27
|
+
"patternProperties": { "^x-": true }
|
|
51
28
|
},
|
|
52
29
|
"rulesets": {
|
|
53
30
|
"type": "array",
|
|
54
31
|
"minItems": 1,
|
|
55
|
-
"items": {
|
|
56
|
-
"$ref": "#/$defs/ruleset"
|
|
57
|
-
}
|
|
32
|
+
"items": { "$ref": "#/$defs/ruleset" }
|
|
58
33
|
},
|
|
59
34
|
"tables": {
|
|
60
35
|
"type": "array",
|
|
61
|
-
"items": {
|
|
62
|
-
"$ref": "#/$defs/table"
|
|
63
|
-
}
|
|
36
|
+
"items": { "$ref": "#/$defs/table" }
|
|
64
37
|
},
|
|
65
38
|
"dependencies": {
|
|
66
39
|
"type": "array",
|
|
67
|
-
"items": {
|
|
68
|
-
"$ref": "#/$defs/dependency"
|
|
69
|
-
}
|
|
40
|
+
"items": { "$ref": "#/$defs/dependency" }
|
|
70
41
|
},
|
|
71
42
|
"constraints": {
|
|
72
43
|
"type": "array",
|
|
73
|
-
"items": {
|
|
74
|
-
"$ref": "#/$defs/constraint"
|
|
75
|
-
}
|
|
44
|
+
"items": { "$ref": "#/$defs/constraint" }
|
|
76
45
|
},
|
|
77
46
|
"profiles": {
|
|
78
47
|
"type": "array",
|
|
@@ -80,52 +49,31 @@
|
|
|
80
49
|
}
|
|
81
50
|
}
|
|
82
51
|
},
|
|
83
|
-
|
|
52
|
+
|
|
53
|
+
"product_document": {
|
|
84
54
|
"type": "object",
|
|
85
|
-
"required": ["
|
|
55
|
+
"required": ["document_type", "catalog_id", "product"],
|
|
86
56
|
"additionalProperties": false,
|
|
87
|
-
"patternProperties": {
|
|
88
|
-
"^x-": true
|
|
89
|
-
},
|
|
57
|
+
"patternProperties": { "^x-": true },
|
|
90
58
|
"properties": {
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
"document_type": {
|
|
96
|
-
"type": "string",
|
|
97
|
-
"const": "PRODUCT"
|
|
98
|
-
},
|
|
99
|
-
"catalog_id": {
|
|
100
|
-
"type": "string",
|
|
101
|
-
"minLength": 1
|
|
102
|
-
},
|
|
103
|
-
"product": {
|
|
104
|
-
"$ref": "#/$defs/product"
|
|
105
|
-
},
|
|
59
|
+
"document_type": { "type": "string", "const": "PRODUCT" },
|
|
60
|
+
"catalog_id": { "type": "string", "minLength": 1 },
|
|
61
|
+
"product": { "$ref": "#/$defs/product" },
|
|
106
62
|
"rulesets": {
|
|
107
63
|
"type": "array",
|
|
108
|
-
"items": {
|
|
109
|
-
"$ref": "#/$defs/ruleset"
|
|
110
|
-
}
|
|
64
|
+
"items": { "$ref": "#/$defs/ruleset" }
|
|
111
65
|
},
|
|
112
66
|
"tables": {
|
|
113
67
|
"type": "array",
|
|
114
|
-
"items": {
|
|
115
|
-
"$ref": "#/$defs/table"
|
|
116
|
-
}
|
|
68
|
+
"items": { "$ref": "#/$defs/table" }
|
|
117
69
|
},
|
|
118
70
|
"constraints": {
|
|
119
71
|
"type": "array",
|
|
120
|
-
"items": {
|
|
121
|
-
"$ref": "#/$defs/constraint"
|
|
122
|
-
}
|
|
72
|
+
"items": { "$ref": "#/$defs/constraint" }
|
|
123
73
|
},
|
|
124
74
|
"dependencies": {
|
|
125
75
|
"type": "array",
|
|
126
|
-
"items": {
|
|
127
|
-
"$ref": "#/$defs/dependency"
|
|
128
|
-
}
|
|
76
|
+
"items": { "$ref": "#/$defs/dependency" }
|
|
129
77
|
},
|
|
130
78
|
"profiles": {
|
|
131
79
|
"type": "array",
|
|
@@ -133,13 +81,12 @@
|
|
|
133
81
|
}
|
|
134
82
|
}
|
|
135
83
|
},
|
|
136
|
-
|
|
84
|
+
|
|
85
|
+
"product_ref": {
|
|
137
86
|
"type": "object",
|
|
138
87
|
"required": ["id", "path"],
|
|
139
88
|
"additionalProperties": false,
|
|
140
|
-
"patternProperties": {
|
|
141
|
-
"^x-": true
|
|
142
|
-
},
|
|
89
|
+
"patternProperties": { "^x-": true },
|
|
143
90
|
"properties": {
|
|
144
91
|
"id": { "type": "string", "minLength": 1 },
|
|
145
92
|
"path": {
|
|
@@ -150,46 +97,43 @@
|
|
|
150
97
|
}
|
|
151
98
|
}
|
|
152
99
|
},
|
|
100
|
+
|
|
153
101
|
"catalog": {
|
|
154
102
|
"type": "object",
|
|
155
103
|
"required": ["id"],
|
|
156
104
|
"additionalProperties": false,
|
|
157
|
-
"patternProperties": {
|
|
158
|
-
"^x-": true
|
|
159
|
-
},
|
|
105
|
+
"patternProperties": { "^x-": true },
|
|
160
106
|
"properties": {
|
|
161
107
|
"id": { "type": "string", "minLength": 1 },
|
|
162
108
|
"name": { "type": "string", "minLength": 1 },
|
|
163
109
|
"default_price_list_id": { "type": "string", "minLength": 1 },
|
|
164
110
|
"price_lists": {
|
|
165
111
|
"type": "array",
|
|
166
|
-
"items": { "$ref": "#/$defs/
|
|
112
|
+
"items": { "$ref": "#/$defs/price_list" }
|
|
167
113
|
}
|
|
168
114
|
}
|
|
169
115
|
},
|
|
170
|
-
|
|
116
|
+
|
|
117
|
+
"price_list": {
|
|
171
118
|
"type": "object",
|
|
172
119
|
"required": ["id", "currency"],
|
|
173
120
|
"additionalProperties": false,
|
|
174
|
-
"patternProperties": {
|
|
175
|
-
"^x-": true
|
|
176
|
-
},
|
|
121
|
+
"patternProperties": { "^x-": true },
|
|
177
122
|
"properties": {
|
|
178
123
|
"id": { "type": "string", "minLength": 1 },
|
|
179
124
|
"label": { "type": "string" },
|
|
180
125
|
"currency": { "type": "string", "minLength": 3, "maxLength": 3 },
|
|
181
126
|
"context_match": {
|
|
182
127
|
"type": "object",
|
|
183
|
-
"additionalProperties": { "$ref": "#/$defs/
|
|
128
|
+
"additionalProperties": { "$ref": "#/$defs/scalar_value" }
|
|
184
129
|
}
|
|
185
130
|
}
|
|
186
131
|
},
|
|
132
|
+
|
|
187
133
|
"context": {
|
|
188
134
|
"type": "object",
|
|
189
|
-
"additionalProperties":
|
|
190
|
-
"patternProperties": {
|
|
191
|
-
"^x-": true
|
|
192
|
-
},
|
|
135
|
+
"additionalProperties": { "$ref": "#/$defs/scalar_value" },
|
|
136
|
+
"patternProperties": { "^x-": true },
|
|
193
137
|
"properties": {
|
|
194
138
|
"price_list_id": { "type": "string", "minLength": 1 },
|
|
195
139
|
"region": { "type": "string" },
|
|
@@ -200,12 +144,11 @@
|
|
|
200
144
|
"requested_unit": { "type": "string", "minLength": 1 }
|
|
201
145
|
}
|
|
202
146
|
},
|
|
147
|
+
|
|
203
148
|
"pricing": {
|
|
204
149
|
"type": "object",
|
|
205
150
|
"additionalProperties": false,
|
|
206
|
-
"patternProperties": {
|
|
207
|
-
"^x-": true
|
|
208
|
-
},
|
|
151
|
+
"patternProperties": { "^x-": true },
|
|
209
152
|
"properties": {
|
|
210
153
|
"calculation_mode": {
|
|
211
154
|
"type": "string",
|
|
@@ -213,13 +156,12 @@
|
|
|
213
156
|
}
|
|
214
157
|
}
|
|
215
158
|
},
|
|
159
|
+
|
|
216
160
|
"product": {
|
|
217
161
|
"type": "object",
|
|
218
162
|
"required": ["id", "options"],
|
|
219
163
|
"additionalProperties": false,
|
|
220
|
-
"patternProperties": {
|
|
221
|
-
"^x-": true
|
|
222
|
-
},
|
|
164
|
+
"patternProperties": { "^x-": true },
|
|
223
165
|
"properties": {
|
|
224
166
|
"id": { "type": "string", "minLength": 1 },
|
|
225
167
|
"name": { "type": "string" },
|
|
@@ -233,29 +175,29 @@
|
|
|
233
175
|
"unit": { "type": "string", "minLength": 1 },
|
|
234
176
|
"images": {
|
|
235
177
|
"type": "array",
|
|
236
|
-
"items": { "$ref": "#/$defs/
|
|
178
|
+
"items": { "$ref": "#/$defs/image" }
|
|
237
179
|
},
|
|
238
180
|
"tags": {
|
|
239
181
|
"type": "array",
|
|
240
182
|
"items": { "type": "string", "minLength": 1 }
|
|
241
183
|
},
|
|
242
184
|
"weight": { "$ref": "#/$defs/measure" },
|
|
243
|
-
"dimensions": { "$ref": "#/$defs/
|
|
244
|
-
"lot_policy": { "$ref": "#/$defs/
|
|
245
|
-
"sales_unit": { "$ref": "#/$defs/
|
|
185
|
+
"dimensions": { "$ref": "#/$defs/physical_dimensions" },
|
|
186
|
+
"lot_policy": { "$ref": "#/$defs/lot_policy" },
|
|
187
|
+
"sales_unit": { "$ref": "#/$defs/sales_unit" },
|
|
246
188
|
"attributes": {
|
|
247
189
|
"type": "array",
|
|
248
|
-
"items": { "$ref": "#/$defs/
|
|
190
|
+
"items": { "$ref": "#/$defs/attribute_ref" }
|
|
249
191
|
},
|
|
250
192
|
"attribute_values": {
|
|
251
193
|
"type": "array",
|
|
252
|
-
"items": { "$ref": "#/$defs/
|
|
194
|
+
"items": { "$ref": "#/$defs/attribute_value" }
|
|
253
195
|
},
|
|
254
196
|
"options": {
|
|
255
197
|
"type": "array",
|
|
256
198
|
"items": { "$ref": "#/$defs/option" }
|
|
257
199
|
},
|
|
258
|
-
"
|
|
200
|
+
"ruleset_ids": {
|
|
259
201
|
"type": "array",
|
|
260
202
|
"items": { "type": "string", "minLength": 1 }
|
|
261
203
|
}
|
|
@@ -265,9 +207,7 @@
|
|
|
265
207
|
"if": {
|
|
266
208
|
"properties": {
|
|
267
209
|
"lot_policy": {
|
|
268
|
-
"properties": {
|
|
269
|
-
"source": { "const": "ATTRIBUTE" }
|
|
270
|
-
},
|
|
210
|
+
"properties": { "source": { "const": "ATTRIBUTE" } },
|
|
271
211
|
"required": ["source"]
|
|
272
212
|
}
|
|
273
213
|
},
|
|
@@ -275,99 +215,91 @@
|
|
|
275
215
|
},
|
|
276
216
|
"then": {
|
|
277
217
|
"properties": {
|
|
278
|
-
"lot_policy": {
|
|
279
|
-
"required": ["attributeId"]
|
|
280
|
-
}
|
|
218
|
+
"lot_policy": { "required": ["attribute_id"] }
|
|
281
219
|
}
|
|
282
220
|
}
|
|
283
221
|
}
|
|
284
222
|
]
|
|
285
223
|
},
|
|
286
|
-
|
|
224
|
+
|
|
225
|
+
"lot_policy": {
|
|
287
226
|
"type": "object",
|
|
288
227
|
"required": ["required", "source"],
|
|
289
228
|
"additionalProperties": false,
|
|
290
|
-
"patternProperties": {
|
|
291
|
-
"^x-": true
|
|
292
|
-
},
|
|
229
|
+
"patternProperties": { "^x-": true },
|
|
293
230
|
"properties": {
|
|
294
231
|
"required": { "type": "boolean" },
|
|
295
232
|
"source": { "type": "string", "enum": ["CONTEXT", "ATTRIBUTE"] },
|
|
296
|
-
"
|
|
297
|
-
"
|
|
233
|
+
"context_key": { "type": "string", "minLength": 1 },
|
|
234
|
+
"attribute_id": { "type": "string", "minLength": 1 }
|
|
298
235
|
},
|
|
299
236
|
"allOf": [
|
|
300
237
|
{
|
|
301
238
|
"if": { "properties": { "source": { "const": "CONTEXT" } } },
|
|
302
|
-
"then": { "required": ["
|
|
239
|
+
"then": { "required": ["context_key"] }
|
|
303
240
|
},
|
|
304
241
|
{
|
|
305
242
|
"if": { "properties": { "source": { "const": "ATTRIBUTE" } } },
|
|
306
|
-
"then": { "required": ["
|
|
243
|
+
"then": { "required": ["attribute_id"] }
|
|
307
244
|
}
|
|
308
245
|
]
|
|
309
246
|
},
|
|
310
|
-
|
|
247
|
+
|
|
248
|
+
"sales_unit": {
|
|
311
249
|
"type": "object",
|
|
312
250
|
"required": ["requested_unit", "sell_unit", "quantity_per_sell_unit", "rounding"],
|
|
313
251
|
"additionalProperties": false,
|
|
314
|
-
"patternProperties": {
|
|
315
|
-
"^x-": true
|
|
316
|
-
},
|
|
252
|
+
"patternProperties": { "^x-": true },
|
|
317
253
|
"properties": {
|
|
318
254
|
"requested_unit": { "type": "string", "minLength": 1 },
|
|
319
255
|
"sell_unit": { "type": "string", "minLength": 1 },
|
|
320
256
|
"quantity_per_sell_unit": { "type": "number", "exclusiveMinimum": 0 },
|
|
321
|
-
"rounding": { "type": "string", "enum": ["CEIL"] },
|
|
257
|
+
"rounding": { "type": "string", "enum": ["CEIL", "FLOOR", "ROUND", "HALF_UP"] },
|
|
322
258
|
"min_sell_units": { "type": "integer", "minimum": 1 }
|
|
323
259
|
}
|
|
324
260
|
},
|
|
325
|
-
|
|
261
|
+
|
|
262
|
+
"attribute_ref": {
|
|
326
263
|
"type": "object",
|
|
327
264
|
"required": ["id"],
|
|
328
265
|
"additionalProperties": false,
|
|
329
|
-
"patternProperties": {
|
|
330
|
-
"^x-": true
|
|
331
|
-
},
|
|
266
|
+
"patternProperties": { "^x-": true },
|
|
332
267
|
"properties": {
|
|
333
268
|
"id": { "type": "string", "minLength": 1 },
|
|
334
269
|
"label": { "type": "string" }
|
|
335
270
|
}
|
|
336
271
|
},
|
|
337
|
-
|
|
272
|
+
|
|
273
|
+
"attribute_value": {
|
|
338
274
|
"type": "object",
|
|
339
|
-
"required": ["
|
|
275
|
+
"required": ["attribute_id", "value"],
|
|
340
276
|
"additionalProperties": false,
|
|
341
|
-
"patternProperties": {
|
|
342
|
-
"^x-": true
|
|
343
|
-
},
|
|
277
|
+
"patternProperties": { "^x-": true },
|
|
344
278
|
"properties": {
|
|
345
|
-
"
|
|
279
|
+
"attribute_id": { "type": "string", "minLength": 1 },
|
|
346
280
|
"label": { "type": "string" },
|
|
347
|
-
"value": { "$ref": "#/$defs/
|
|
281
|
+
"value": { "$ref": "#/$defs/scalar_value" }
|
|
348
282
|
}
|
|
349
283
|
},
|
|
284
|
+
|
|
350
285
|
"option": {
|
|
351
286
|
"type": "object",
|
|
352
|
-
"required": ["id", "
|
|
287
|
+
"required": ["id", "attribute_id", "value"],
|
|
353
288
|
"additionalProperties": false,
|
|
354
|
-
"patternProperties": {
|
|
355
|
-
"^x-": true
|
|
356
|
-
},
|
|
289
|
+
"patternProperties": { "^x-": true },
|
|
357
290
|
"properties": {
|
|
358
291
|
"id": { "type": "string", "minLength": 1 },
|
|
359
|
-
"
|
|
292
|
+
"attribute_id": { "type": "string", "minLength": 1 },
|
|
360
293
|
"label": { "type": "string" },
|
|
361
|
-
"value": { "$ref": "#/$defs/
|
|
294
|
+
"value": { "$ref": "#/$defs/scalar_value" }
|
|
362
295
|
}
|
|
363
296
|
},
|
|
297
|
+
|
|
364
298
|
"ruleset": {
|
|
365
299
|
"type": "object",
|
|
366
300
|
"required": ["id", "target", "rules"],
|
|
367
301
|
"additionalProperties": false,
|
|
368
|
-
"patternProperties": {
|
|
369
|
-
"^x-": true
|
|
370
|
-
},
|
|
302
|
+
"patternProperties": { "^x-": true },
|
|
371
303
|
"properties": {
|
|
372
304
|
"id": { "type": "string", "minLength": 1 },
|
|
373
305
|
"target": {
|
|
@@ -380,13 +312,12 @@
|
|
|
380
312
|
}
|
|
381
313
|
}
|
|
382
314
|
},
|
|
315
|
+
|
|
383
316
|
"rule": {
|
|
384
317
|
"type": "object",
|
|
385
318
|
"required": ["id", "operation"],
|
|
386
319
|
"additionalProperties": false,
|
|
387
|
-
"patternProperties": {
|
|
388
|
-
"^x-": true
|
|
389
|
-
},
|
|
320
|
+
"patternProperties": { "^x-": true },
|
|
390
321
|
"properties": {
|
|
391
322
|
"id": { "type": "string", "minLength": 1 },
|
|
392
323
|
"priority": { "type": "integer" },
|
|
@@ -398,7 +329,7 @@
|
|
|
398
329
|
},
|
|
399
330
|
"value": { "type": "number" },
|
|
400
331
|
"percent": { "type": "number" },
|
|
401
|
-
"
|
|
332
|
+
"table_id": { "type": "string", "minLength": 1 },
|
|
402
333
|
"components": {
|
|
403
334
|
"type": "array",
|
|
404
335
|
"items": { "$ref": "#/$defs/component" }
|
|
@@ -407,8 +338,8 @@
|
|
|
407
338
|
"max": { "type": "number" },
|
|
408
339
|
"min": { "type": "number" },
|
|
409
340
|
"fallback": { "type": "number" },
|
|
410
|
-
"
|
|
411
|
-
"
|
|
341
|
+
"option_id": { "type": "string" },
|
|
342
|
+
"option_ids": {
|
|
412
343
|
"type": "array",
|
|
413
344
|
"items": { "type": "string" }
|
|
414
345
|
}
|
|
@@ -428,7 +359,7 @@
|
|
|
428
359
|
},
|
|
429
360
|
{
|
|
430
361
|
"if": { "properties": { "operation": { "const": "LOOKUP" } } },
|
|
431
|
-
"then": { "required": ["
|
|
362
|
+
"then": { "required": ["table_id"] }
|
|
432
363
|
},
|
|
433
364
|
{
|
|
434
365
|
"if": { "properties": { "operation": { "enum": ["MAX_OF", "MIN_OF", "PICK"] } } },
|
|
@@ -448,29 +379,31 @@
|
|
|
448
379
|
}
|
|
449
380
|
]
|
|
450
381
|
},
|
|
382
|
+
|
|
451
383
|
"component": {
|
|
452
384
|
"type": "object",
|
|
453
385
|
"additionalProperties": false,
|
|
454
|
-
"patternProperties": {
|
|
455
|
-
"^x-": true
|
|
456
|
-
},
|
|
386
|
+
"patternProperties": { "^x-": true },
|
|
457
387
|
"properties": {
|
|
458
388
|
"label": { "type": "string" },
|
|
459
389
|
"value": { "type": "number" },
|
|
460
|
-
"
|
|
461
|
-
"
|
|
390
|
+
"table_id": { "type": "string" },
|
|
391
|
+
"option_id": { "type": "string" }
|
|
462
392
|
},
|
|
463
393
|
"anyOf": [
|
|
464
394
|
{ "required": ["value"] },
|
|
465
|
-
{ "required": ["
|
|
395
|
+
{ "required": ["table_id"] }
|
|
466
396
|
]
|
|
467
397
|
},
|
|
398
|
+
|
|
468
399
|
"condition": {
|
|
469
400
|
"type": "object",
|
|
470
401
|
"additionalProperties": false,
|
|
471
|
-
"patternProperties": {
|
|
472
|
-
|
|
473
|
-
|
|
402
|
+
"patternProperties": { "^x-": true },
|
|
403
|
+
"anyOf": [
|
|
404
|
+
{ "required": ["all"] },
|
|
405
|
+
{ "required": ["any"] }
|
|
406
|
+
],
|
|
474
407
|
"properties": {
|
|
475
408
|
"all": {
|
|
476
409
|
"type": "array",
|
|
@@ -482,130 +415,117 @@
|
|
|
482
415
|
}
|
|
483
416
|
}
|
|
484
417
|
},
|
|
418
|
+
|
|
485
419
|
"predicate": {
|
|
486
420
|
"type": "object",
|
|
487
421
|
"required": ["fact", "operator"],
|
|
488
422
|
"additionalProperties": false,
|
|
489
|
-
"patternProperties": {
|
|
490
|
-
"^x-": true
|
|
491
|
-
},
|
|
423
|
+
"patternProperties": { "^x-": true },
|
|
492
424
|
"properties": {
|
|
493
425
|
"fact": { "type": "string" },
|
|
494
426
|
"operator": {
|
|
495
427
|
"type": "string",
|
|
496
428
|
"enum": ["EQ", "NEQ", "IN", "NOT_IN", "GT", "GTE", "LT", "LTE", "EXISTS"]
|
|
497
429
|
},
|
|
498
|
-
"value": { "$ref": "#/$defs/
|
|
430
|
+
"value": { "$ref": "#/$defs/scalar_value" },
|
|
499
431
|
"values": {
|
|
500
432
|
"type": "array",
|
|
501
|
-
"items": { "$ref": "#/$defs/
|
|
433
|
+
"items": { "$ref": "#/$defs/scalar_value" }
|
|
502
434
|
}
|
|
503
435
|
}
|
|
504
436
|
},
|
|
437
|
+
|
|
505
438
|
"table": {
|
|
506
439
|
"type": "object",
|
|
507
440
|
"required": ["id", "type", "dimensions", "rows"],
|
|
508
441
|
"additionalProperties": false,
|
|
509
|
-
"patternProperties": {
|
|
510
|
-
"^x-": true
|
|
511
|
-
},
|
|
442
|
+
"patternProperties": { "^x-": true },
|
|
512
443
|
"properties": {
|
|
513
444
|
"id": { "type": "string", "minLength": 1 },
|
|
514
445
|
"type": { "type": "string", "enum": ["LOOKUP"] },
|
|
515
|
-
"keys": {
|
|
516
|
-
"type": "array",
|
|
517
|
-
"items": {
|
|
518
|
-
"anyOf": [
|
|
519
|
-
{ "type": "string" },
|
|
520
|
-
{
|
|
521
|
-
"type": "object",
|
|
522
|
-
"additionalProperties": false,
|
|
523
|
-
"properties": {
|
|
524
|
-
"optionId": { "type": "string" },
|
|
525
|
-
"id": { "type": "string" },
|
|
526
|
-
"name": { "type": "string" }
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
]
|
|
530
|
-
}
|
|
531
|
-
},
|
|
532
446
|
"dimensions": {
|
|
533
447
|
"type": "array",
|
|
534
448
|
"minItems": 1,
|
|
535
|
-
"items": { "$ref": "#/$defs/
|
|
449
|
+
"items": { "$ref": "#/$defs/lookup_axis" }
|
|
536
450
|
},
|
|
537
451
|
"rows": {
|
|
538
452
|
"type": "array",
|
|
539
453
|
"minItems": 1,
|
|
540
|
-
"items": { "$ref": "#/$defs/
|
|
454
|
+
"items": { "$ref": "#/$defs/table_row" }
|
|
541
455
|
}
|
|
542
456
|
}
|
|
543
457
|
},
|
|
544
|
-
|
|
458
|
+
|
|
459
|
+
"lookup_axis": {
|
|
545
460
|
"type": "object",
|
|
546
461
|
"required": ["key", "source"],
|
|
547
462
|
"additionalProperties": false,
|
|
548
|
-
"patternProperties": {
|
|
549
|
-
"^x-": true
|
|
550
|
-
},
|
|
463
|
+
"patternProperties": { "^x-": true },
|
|
551
464
|
"properties": {
|
|
552
465
|
"key": { "type": "string" },
|
|
553
466
|
"source": { "type": "string", "enum": ["ATTRIBUTE", "CONTEXT", "LITERAL"] },
|
|
554
|
-
"
|
|
555
|
-
"
|
|
556
|
-
"literal": { "$ref": "#/$defs/
|
|
467
|
+
"attribute_id": { "type": "string" },
|
|
468
|
+
"context_key": { "type": "string" },
|
|
469
|
+
"literal": { "$ref": "#/$defs/scalar_value" }
|
|
557
470
|
}
|
|
558
471
|
},
|
|
559
|
-
|
|
472
|
+
|
|
473
|
+
"table_row": {
|
|
560
474
|
"type": "object",
|
|
561
475
|
"required": ["key", "value"],
|
|
562
476
|
"additionalProperties": false,
|
|
563
|
-
"patternProperties": {
|
|
564
|
-
"^x-": true
|
|
565
|
-
},
|
|
477
|
+
"patternProperties": { "^x-": true },
|
|
566
478
|
"properties": {
|
|
567
479
|
"key": {
|
|
568
480
|
"type": "object",
|
|
569
|
-
"additionalProperties": { "$ref": "#/$defs/
|
|
481
|
+
"additionalProperties": { "$ref": "#/$defs/scalar_value" }
|
|
570
482
|
},
|
|
571
483
|
"value": { "type": "number" }
|
|
572
484
|
}
|
|
573
485
|
},
|
|
486
|
+
|
|
574
487
|
"dependency": {
|
|
575
488
|
"type": "object",
|
|
576
489
|
"required": ["id", "type"],
|
|
577
490
|
"additionalProperties": false,
|
|
578
|
-
"patternProperties": {
|
|
579
|
-
"^x-": true
|
|
580
|
-
},
|
|
491
|
+
"patternProperties": { "^x-": true },
|
|
581
492
|
"properties": {
|
|
582
493
|
"id": { "type": "string", "minLength": 1 },
|
|
583
494
|
"type": { "type": "string", "enum": ["REQUIRES", "IMPLIES", "AVAILABLE_OPTIONS_WHEN"] },
|
|
584
|
-
"
|
|
585
|
-
"
|
|
586
|
-
"
|
|
495
|
+
"product_id": { "type": "string" },
|
|
496
|
+
"option_id": { "type": "string" },
|
|
497
|
+
"requires_option_ids": {
|
|
587
498
|
"type": "array",
|
|
588
499
|
"items": { "type": "string" }
|
|
589
500
|
},
|
|
590
|
-
"
|
|
501
|
+
"allowed_option_ids": {
|
|
591
502
|
"type": "array",
|
|
592
503
|
"items": { "type": "string" }
|
|
593
504
|
},
|
|
594
505
|
"when": { "$ref": "#/$defs/condition" }
|
|
595
|
-
}
|
|
506
|
+
},
|
|
507
|
+
"allOf": [
|
|
508
|
+
{
|
|
509
|
+
"if": { "properties": { "type": { "const": "REQUIRES" } } },
|
|
510
|
+
"then": { "required": ["option_id", "requires_option_ids"] }
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"if": { "properties": { "type": { "const": "AVAILABLE_OPTIONS_WHEN" } } },
|
|
514
|
+
"then": { "required": ["allowed_option_ids", "when"] }
|
|
515
|
+
}
|
|
516
|
+
]
|
|
596
517
|
},
|
|
518
|
+
|
|
597
519
|
"constraint": {
|
|
598
520
|
"type": "object",
|
|
599
521
|
"required": ["id", "type", "when", "message"],
|
|
600
522
|
"additionalProperties": false,
|
|
601
|
-
"patternProperties": {
|
|
602
|
-
"^x-": true
|
|
603
|
-
},
|
|
523
|
+
"patternProperties": { "^x-": true },
|
|
604
524
|
"properties": {
|
|
605
525
|
"id": { "type": "string", "minLength": 1 },
|
|
606
526
|
"type": { "type": "string", "enum": ["DENY"] },
|
|
607
|
-
"
|
|
608
|
-
"
|
|
527
|
+
"product_id": { "type": "string" },
|
|
528
|
+
"option_ids": {
|
|
609
529
|
"type": "array",
|
|
610
530
|
"items": { "type": "string" }
|
|
611
531
|
},
|
|
@@ -613,13 +533,12 @@
|
|
|
613
533
|
"message": { "type": "string", "minLength": 1 }
|
|
614
534
|
}
|
|
615
535
|
},
|
|
616
|
-
|
|
536
|
+
|
|
537
|
+
"image": {
|
|
617
538
|
"type": "object",
|
|
618
539
|
"required": ["url"],
|
|
619
540
|
"additionalProperties": false,
|
|
620
|
-
"patternProperties": {
|
|
621
|
-
"^x-": true
|
|
622
|
-
},
|
|
541
|
+
"patternProperties": { "^x-": true },
|
|
623
542
|
"properties": {
|
|
624
543
|
"url": { "type": "string", "format": "uri" },
|
|
625
544
|
"label": { "type": "string" },
|
|
@@ -629,25 +548,23 @@
|
|
|
629
548
|
}
|
|
630
549
|
}
|
|
631
550
|
},
|
|
551
|
+
|
|
632
552
|
"measure": {
|
|
633
553
|
"type": "object",
|
|
634
554
|
"required": ["value", "unit"],
|
|
635
555
|
"additionalProperties": false,
|
|
636
|
-
"patternProperties": {
|
|
637
|
-
"^x-": true
|
|
638
|
-
},
|
|
556
|
+
"patternProperties": { "^x-": true },
|
|
639
557
|
"properties": {
|
|
640
558
|
"value": { "type": "number", "exclusiveMinimum": 0 },
|
|
641
559
|
"unit": { "type": "string", "minLength": 1 }
|
|
642
560
|
}
|
|
643
561
|
},
|
|
644
|
-
|
|
562
|
+
|
|
563
|
+
"physical_dimensions": {
|
|
645
564
|
"type": "object",
|
|
646
565
|
"required": ["unit"],
|
|
647
566
|
"additionalProperties": false,
|
|
648
|
-
"patternProperties": {
|
|
649
|
-
"^x-": true
|
|
650
|
-
},
|
|
567
|
+
"patternProperties": { "^x-": true },
|
|
651
568
|
"properties": {
|
|
652
569
|
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
653
570
|
"height": { "type": "number", "exclusiveMinimum": 0 },
|
|
@@ -655,7 +572,8 @@
|
|
|
655
572
|
"unit": { "type": "string", "minLength": 1 }
|
|
656
573
|
}
|
|
657
574
|
},
|
|
658
|
-
|
|
575
|
+
|
|
576
|
+
"scalar_value": {
|
|
659
577
|
"type": ["string", "number", "boolean"]
|
|
660
578
|
}
|
|
661
579
|
}
|