@gruncellka/porto-data 0.3.0 → 0.4.1

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 (88) hide show
  1. package/CHANGELOG.md +215 -0
  2. package/LICENSE +199 -5
  3. package/README.md +53 -34
  4. package/index.d.ts +35 -18
  5. package/index.js +2 -1
  6. package/package.json +28 -8
  7. package/porto_data/formats/envelopes.json +120 -0
  8. package/porto_data/formats/layouts.json +288 -0
  9. package/porto_data/mappings.json +65 -10
  10. package/porto_data/metadata.json +662 -125
  11. package/porto_data/policy/jurisdictions.json +839 -0
  12. package/porto_data/policy/markets.json +75 -0
  13. package/porto_data/policy/restrictions.json +668 -0
  14. package/porto_data/providers/deutschepost/features.json +42 -0
  15. package/porto_data/providers/deutschepost/graph.json +203 -0
  16. package/porto_data/providers/deutschepost/limits.json +17 -0
  17. package/porto_data/providers/deutschepost/marks.json +71 -0
  18. package/porto_data/providers/deutschepost/prices/products.json +239 -0
  19. package/porto_data/providers/deutschepost/prices/services.json +51 -0
  20. package/porto_data/providers/deutschepost/products.json +197 -0
  21. package/porto_data/providers/deutschepost/services.json +88 -0
  22. package/porto_data/providers/deutschepost/weights.json +46 -0
  23. package/porto_data/providers/deutschepost/zones.json +231 -0
  24. package/porto_data/providers/laposte/features.json +42 -0
  25. package/porto_data/providers/laposte/graph.json +234 -0
  26. package/porto_data/providers/laposte/limits.json +17 -0
  27. package/porto_data/providers/laposte/marks.json +39 -0
  28. package/porto_data/providers/laposte/prices/products.json +947 -0
  29. package/porto_data/providers/laposte/prices/services.json +41 -0
  30. package/porto_data/providers/laposte/products.json +276 -0
  31. package/porto_data/providers/laposte/services.json +63 -0
  32. package/porto_data/providers/laposte/weights.json +38 -0
  33. package/porto_data/providers/laposte/zones.json +230 -0
  34. package/porto_data/providers/swisspost/features.json +21 -0
  35. package/porto_data/providers/swisspost/graph.json +212 -0
  36. package/porto_data/providers/swisspost/limits.json +17 -0
  37. package/porto_data/providers/swisspost/marks.json +41 -0
  38. package/porto_data/providers/swisspost/prices/products.json +347 -0
  39. package/porto_data/providers/swisspost/prices/services.json +31 -0
  40. package/porto_data/providers/swisspost/products.json +193 -0
  41. package/porto_data/providers/swisspost/rules.json +25 -0
  42. package/porto_data/providers/swisspost/services.json +40 -0
  43. package/porto_data/providers/swisspost/weights.json +38 -0
  44. package/porto_data/providers/swisspost/zones.json +223 -0
  45. package/porto_data/providers/ukrposhta/features.json +28 -0
  46. package/porto_data/providers/ukrposhta/graph.json +148 -0
  47. package/porto_data/providers/ukrposhta/limits.json +17 -0
  48. package/porto_data/providers/ukrposhta/marks.json +25 -0
  49. package/porto_data/providers/ukrposhta/prices/products.json +123 -0
  50. package/porto_data/providers/ukrposhta/prices/services.json +42 -0
  51. package/porto_data/providers/ukrposhta/products.json +74 -0
  52. package/porto_data/providers/ukrposhta/services.json +40 -0
  53. package/porto_data/providers/ukrposhta/weights.json +26 -0
  54. package/porto_data/providers/ukrposhta/zones.json +226 -0
  55. package/porto_data/providers.json +37 -0
  56. package/porto_data/schemas/envelopes.schema.json +120 -0
  57. package/porto_data/schemas/features.schema.json +66 -55
  58. package/porto_data/schemas/graph.schema.json +189 -0
  59. package/porto_data/schemas/jurisdictions.schema.json +116 -0
  60. package/porto_data/schemas/layouts.schema.json +156 -0
  61. package/porto_data/schemas/limits.schema.json +253 -0
  62. package/porto_data/schemas/mappings.schema.json +73 -0
  63. package/porto_data/schemas/markets.schema.json +186 -0
  64. package/porto_data/schemas/marks.schema.json +127 -0
  65. package/porto_data/schemas/metadata.schema.json +183 -0
  66. package/porto_data/schemas/porto_ids.schema.json +45 -0
  67. package/porto_data/schemas/product_prices.schema.json +126 -0
  68. package/porto_data/schemas/products.schema.json +338 -110
  69. package/porto_data/schemas/providers.schema.json +71 -0
  70. package/porto_data/schemas/restrictions.schema.json +175 -355
  71. package/porto_data/schemas/rules.schema.json +104 -0
  72. package/porto_data/schemas/service_prices.schema.json +116 -0
  73. package/porto_data/schemas/services.schema.json +113 -70
  74. package/porto_data/schemas/weights.schema.json +70 -0
  75. package/porto_data/schemas/zones.schema.json +78 -72
  76. package/porto_data/data/data_links.json +0 -148
  77. package/porto_data/data/dimensions.json +0 -158
  78. package/porto_data/data/features.json +0 -66
  79. package/porto_data/data/prices.json +0 -242
  80. package/porto_data/data/products.json +0 -84
  81. package/porto_data/data/restrictions.json +0 -795
  82. package/porto_data/data/services.json +0 -61
  83. package/porto_data/data/weight_tiers.json +0 -54
  84. package/porto_data/data/zones.json +0 -230
  85. package/porto_data/schemas/data_links.schema.json +0 -223
  86. package/porto_data/schemas/dimensions.schema.json +0 -215
  87. package/porto_data/schemas/prices.schema.json +0 -180
  88. package/porto_data/schemas/weight_tiers.schema.json +0 -70
@@ -1,148 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/data_links.schema.json",
3
- "file_type": "data_links",
4
- "schema_version": "1.0",
5
- "unit": {
6
- "weight": "g",
7
- "dimension": "mm",
8
- "price": "cents",
9
- "currency": "EUR"
10
- },
11
- "dependencies": {
12
- "products": {
13
- "file": "products.json",
14
- "depends_on": [
15
- "zones.json",
16
- "weight_tiers.json",
17
- "dimensions.json",
18
- "services.json",
19
- "features.json"
20
- ],
21
- "description": "Products require zones, weight tiers, dimensions, services and features"
22
- },
23
- "services": {
24
- "file": "services.json",
25
- "depends_on": [
26
- "features.json"
27
- ],
28
- "description": "Services require features and price information"
29
- },
30
- "prices": {
31
- "file": "prices.json",
32
- "depends_on": [
33
- "products.json",
34
- "services.json",
35
- "zones.json",
36
- "weight_tiers.json"
37
- ],
38
- "description": "Prices reference products, services, zones, and weight tiers"
39
- },
40
- "zones": {
41
- "file": "zones.json",
42
- "depends_on": [
43
- "restrictions.json"
44
- ],
45
- "description": "Zones may have restricted destinations"
46
- },
47
- "weight_tiers": {
48
- "file": "weight_tiers.json",
49
- "depends_on": [],
50
- "description": "Weight tiers are standalone definitions"
51
- },
52
- "dimensions": {
53
- "file": "dimensions.json",
54
- "depends_on": [],
55
- "description": "Dimensions are standalone definitions"
56
- },
57
- "restrictions": {
58
- "file": "restrictions.json",
59
- "depends_on": [
60
- "zones.json",
61
- "products.json"
62
- ],
63
- "description": "Restrictions reference zones, products, and compliance frameworks"
64
- },
65
- "features": {
66
- "file": "features.json",
67
- "depends_on": [],
68
- "description": "Features are standalone definitions referenced by services"
69
- }
70
- },
71
- "links": {
72
- "letter_standard": {
73
- "zones": [
74
- "domestic",
75
- "zone_1_eu",
76
- "world"
77
- ],
78
- "weight_tiers": [
79
- "W0020"
80
- ]
81
- },
82
- "letter_compact": {
83
- "zones": [
84
- "domestic",
85
- "zone_1_eu",
86
- "world"
87
- ],
88
- "weight_tiers": [
89
- "W0050"
90
- ]
91
- },
92
- "letter_large": {
93
- "zones": [
94
- "domestic",
95
- "zone_1_eu",
96
- "world"
97
- ],
98
- "weight_tiers": [
99
- "W0500"
100
- ]
101
- },
102
- "letter_maxi": {
103
- "zones": [
104
- "domestic",
105
- "zone_1_eu",
106
- "world"
107
- ],
108
- "weight_tiers": [
109
- "W1000"
110
- ]
111
- },
112
- "merchandise": {
113
- "zones": [
114
- "domestic"
115
- ],
116
- "weight_tiers": [
117
- "W1000",
118
- "W2000"
119
- ]
120
- }
121
- },
122
- "lookup_rules": {
123
- "price_lookup": "Find price in prices.json where product_id + zone + weight_tier match",
124
- "service_lookup": "Find service in services.json by id",
125
- "weight_resolution": "Find weight_tier in weight_tiers.json where min <= weight <= max",
126
- "zone_validation": "Check if zone is in product's zones array"
127
- },
128
- "global_settings": {
129
- "price_source": "prices.json",
130
- "lookup_method": {
131
- "file": "prices.json",
132
- "array": "prices.product_prices",
133
- "match": {
134
- "product_id": "from product id",
135
- "zone": "from zones array",
136
- "weight_tier": "from weight_tiers array"
137
- },
138
- "description": "Find prices by matching product_id, zone, and weight_tier"
139
- },
140
- "available_services": [
141
- "registered_mail",
142
- "registered_mail_mailbox",
143
- "registered_mail_return_receipt",
144
- "registered_mail_personal",
145
- "registered_mail_personal_return_receipt"
146
- ]
147
- }
148
- }
@@ -1,158 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/dimensions.schema.json",
3
- "file_type": "dimensions",
4
- "unit": {
5
- "dimension": "mm"
6
- },
7
- "dimensions": [
8
- {
9
- "id": "DL",
10
- "label": "DIN Lang",
11
- "standard": "DIN 678",
12
- "size": {
13
- "width": 220,
14
- "height": 110,
15
- "thickness": 5
16
- },
17
- "print_area": {
18
- "x": 10,
19
- "y": 45,
20
- "width": 200,
21
- "height": 60
22
- },
23
- "stamp_area": {
24
- "x": 160,
25
- "y": 10,
26
- "width": 40,
27
- "height": 40
28
- },
29
- "window_supported": true,
30
- "window_area": {
31
- "x": 20,
32
- "y": 50,
33
- "width": 90,
34
- "height": 40
35
- },
36
- "orientation": "landscape",
37
- "weight_tier": "W0020"
38
- },
39
- {
40
- "id": "C6",
41
- "label": "C6 Envelope",
42
- "standard": "DIN 678",
43
- "size": {
44
- "width": 162,
45
- "height": 114,
46
- "thickness": 5
47
- },
48
- "print_area": {
49
- "x": 10,
50
- "y": 45,
51
- "width": 140,
52
- "height": 60
53
- },
54
- "stamp_area": {
55
- "x": 110,
56
- "y": 10,
57
- "width": 40,
58
- "height": 40
59
- },
60
- "window_supported": true,
61
- "window_area": {
62
- "x": 20,
63
- "y": 50,
64
- "width": 90,
65
- "height": 40
66
- },
67
- "orientation": "landscape",
68
- "weight_tier": "W0020"
69
- },
70
- {
71
- "id": "C5",
72
- "label": "C5 Envelope",
73
- "standard": "DIN 678",
74
- "size": {
75
- "width": 229,
76
- "height": 162,
77
- "thickness": 10
78
- },
79
- "print_area": {
80
- "x": 15,
81
- "y": 50,
82
- "width": 200,
83
- "height": 90
84
- },
85
- "stamp_area": {
86
- "x": 180,
87
- "y": 15,
88
- "width": 40,
89
- "height": 40
90
- },
91
- "window_supported": true,
92
- "window_area": {
93
- "x": 20,
94
- "y": 60,
95
- "width": 90,
96
- "height": 45
97
- },
98
- "orientation": "landscape",
99
- "weight_tier": "W0050"
100
- },
101
- {
102
- "id": "C4",
103
- "label": "C4 Envelope",
104
- "standard": "DIN 678",
105
- "size": {
106
- "width": 324,
107
- "height": 229,
108
- "thickness": 20
109
- },
110
- "print_area": {
111
- "x": 15,
112
- "y": 60,
113
- "width": 295,
114
- "height": 150
115
- },
116
- "stamp_area": {
117
- "x": 270,
118
- "y": 15,
119
- "width": 40,
120
- "height": 40
121
- },
122
- "window_supported": true,
123
- "window_area": {
124
- "x": 20,
125
- "y": 70,
126
- "width": 90,
127
- "height": 45
128
- },
129
- "orientation": "landscape",
130
- "weight_tier": "W0500"
131
- },
132
- {
133
- "id": "B4",
134
- "label": "B4 Envelope",
135
- "standard": "DIN 678",
136
- "size": {
137
- "width": 353,
138
- "height": 250,
139
- "thickness": 50
140
- },
141
- "print_area": {
142
- "x": 15,
143
- "y": 70,
144
- "width": 320,
145
- "height": 170
146
- },
147
- "stamp_area": {
148
- "x": 300,
149
- "y": 15,
150
- "width": 40,
151
- "height": 40
152
- },
153
- "supports_window": false,
154
- "orientation": "landscape",
155
- "weight_tier": "W1000"
156
- }
157
- ]
158
- }
@@ -1,66 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/features.schema.json",
3
- "file_type": "features",
4
- "features": [
5
- {
6
- "id": "tracking_number",
7
- "name": "Sendungsverfolgung",
8
- "label": "Tracking number",
9
- "description": "Unique tracking number for package monitoring"
10
- },
11
- {
12
- "id": "proof_of_mailing",
13
- "name": "Einlieferungsbeleg",
14
- "label": "Proof of mailing",
15
- "description": "Documentation that item was mailed"
16
- },
17
- {
18
- "id": "delivery_confirmation",
19
- "name": "Zustellbest\u00e4tigung",
20
- "label": "Delivery confirmation",
21
- "description": "Confirmation that item was delivered"
22
- },
23
- {
24
- "id": "mailbox_delivery",
25
- "name": "Briefkastenzustellung",
26
- "label": "Mailbox delivery",
27
- "description": "Item delivered directly to recipient's mailbox"
28
- },
29
- {
30
- "id": "photo_proof_delivery",
31
- "name": "Foto-Zustellnachweis",
32
- "label": "Photo proof of delivery",
33
- "description": "Photographic evidence of delivery"
34
- },
35
- {
36
- "id": "recipient_signature",
37
- "name": "Empf\u00e4ngerunterschrift",
38
- "label": "Recipient signature required",
39
- "description": "Recipient must sign upon delivery"
40
- },
41
- {
42
- "id": "return_receipt",
43
- "name": "R\u00fcckschein",
44
- "label": "Return receipt to sender",
45
- "description": "Receipt returned to sender as proof of delivery"
46
- },
47
- {
48
- "id": "proof_of_delivery",
49
- "name": "Zustellnachweis",
50
- "label": "Proof of delivery",
51
- "description": "Documentation proving successful delivery"
52
- },
53
- {
54
- "id": "personal_delivery",
55
- "name": "Eigenh\u00e4ndige Zustellung",
56
- "label": "Personal delivery to recipient only",
57
- "description": "Item delivered only to the named recipient"
58
- },
59
- {
60
- "id": "id_verification",
61
- "name": "Ausweiskontrolle",
62
- "label": "ID verification",
63
- "description": "Recipient must show identification"
64
- }
65
- ]
66
- }
@@ -1,242 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/prices.schema.json",
3
- "file_type": "prices",
4
- "unit": {
5
- "price": "cents",
6
- "currency": "EUR"
7
- },
8
- "prices": {
9
- "product_prices": [
10
- {
11
- "product_id": "letter_standard",
12
- "zone": "domestic",
13
- "weight_tier": "W0020",
14
- "price": [
15
- {
16
- "price": 95,
17
- "effective_from": null,
18
- "effective_to": null
19
- }
20
- ]
21
- },
22
- {
23
- "product_id": "letter_standard",
24
- "zone": "zone_1_eu",
25
- "weight_tier": "W0020",
26
- "price": [
27
- {
28
- "price": 110,
29
- "effective_from": null,
30
- "effective_to": null
31
- }
32
- ]
33
- },
34
- {
35
- "product_id": "letter_standard",
36
- "zone": "world",
37
- "weight_tier": "W0020",
38
- "price": [
39
- {
40
- "price": 110,
41
- "effective_from": null,
42
- "effective_to": null
43
- }
44
- ]
45
- },
46
- {
47
- "product_id": "letter_compact",
48
- "zone": "domestic",
49
- "weight_tier": "W0050",
50
- "price": [
51
- {
52
- "price": 110,
53
- "effective_from": null,
54
- "effective_to": null
55
- }
56
- ]
57
- },
58
- {
59
- "product_id": "letter_compact",
60
- "zone": "zone_1_eu",
61
- "weight_tier": "W0050",
62
- "price": [
63
- {
64
- "price": 170,
65
- "effective_from": null,
66
- "effective_to": null
67
- }
68
- ]
69
- },
70
- {
71
- "product_id": "letter_compact",
72
- "zone": "world",
73
- "weight_tier": "W0050",
74
- "price": [
75
- {
76
- "price": 170,
77
- "effective_from": null,
78
- "effective_to": null
79
- }
80
- ]
81
- },
82
- {
83
- "product_id": "letter_large",
84
- "zone": "domestic",
85
- "weight_tier": "W0500",
86
- "price": [
87
- {
88
- "price": 180,
89
- "effective_from": null,
90
- "effective_to": null
91
- }
92
- ]
93
- },
94
- {
95
- "product_id": "letter_large",
96
- "zone": "zone_1_eu",
97
- "weight_tier": "W0500",
98
- "price": [
99
- {
100
- "price": 370,
101
- "effective_from": null,
102
- "effective_to": null
103
- }
104
- ]
105
- },
106
- {
107
- "product_id": "letter_large",
108
- "zone": "world",
109
- "weight_tier": "W0500",
110
- "price": [
111
- {
112
- "price": 370,
113
- "effective_from": null,
114
- "effective_to": null
115
- }
116
- ]
117
- },
118
- {
119
- "product_id": "letter_maxi",
120
- "zone": "domestic",
121
- "weight_tier": "W1000",
122
- "price": [
123
- {
124
- "price": 290,
125
- "effective_from": null,
126
- "effective_to": null
127
- }
128
- ]
129
- },
130
- {
131
- "product_id": "letter_maxi",
132
- "zone": "zone_1_eu",
133
- "weight_tier": "W1000",
134
- "price": [
135
- {
136
- "price": 700,
137
- "effective_from": null,
138
- "effective_to": null
139
- }
140
- ]
141
- },
142
- {
143
- "product_id": "letter_maxi",
144
- "zone": "world",
145
- "weight_tier": "W1000",
146
- "price": [
147
- {
148
- "price": 700,
149
- "effective_from": null,
150
- "effective_to": null
151
- }
152
- ]
153
- },
154
- {
155
- "product_id": "merchandise",
156
- "zone": "domestic",
157
- "weight_tier": "W1000",
158
- "price": [
159
- {
160
- "price": 270,
161
- "effective_from": null,
162
- "effective_to": null
163
- }
164
- ]
165
- },
166
- {
167
- "product_id": "merchandise",
168
- "zone": "domestic",
169
- "weight_tier": "W2000",
170
- "price": [
171
- {
172
- "price": 355,
173
- "effective_from": null,
174
- "effective_to": null
175
- }
176
- ]
177
- }
178
- ],
179
- "service_prices": [
180
- {
181
- "service_id": "registered_mail",
182
- "price": [
183
- {
184
- "price": 265,
185
- "effective_from": null,
186
- "effective_to": null
187
- }
188
- ]
189
- },
190
- {
191
- "service_id": "registered_mail_mailbox",
192
- "price": [
193
- {
194
- "price": 235,
195
- "effective_from": null,
196
- "effective_to": null
197
- }
198
- ]
199
- },
200
- {
201
- "service_id": "registered_mail_return_receipt",
202
- "price": [
203
- {
204
- "price": 485,
205
- "effective_from": null,
206
- "effective_to": null
207
- }
208
- ]
209
- },
210
- {
211
- "service_id": "registered_mail_personal",
212
- "price": [
213
- {
214
- "price": 470,
215
- "effective_from": null,
216
- "effective_to": null
217
- }
218
- ]
219
- },
220
- {
221
- "service_id": "registered_mail_personal_return_receipt",
222
- "price": [
223
- {
224
- "price": 690,
225
- "effective_from": null,
226
- "effective_to": null
227
- }
228
- ]
229
- },
230
- {
231
- "service_id": "additional_insurance_500",
232
- "price": [
233
- {
234
- "price": 250,
235
- "effective_from": null,
236
- "effective_to": null
237
- }
238
- ]
239
- }
240
- ]
241
- }
242
- }
@@ -1,84 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/gruncellka/porto-data/refs/heads/main/porto_data/schemas/products.schema.json",
3
- "file_type": "products",
4
- "unit": {
5
- "dimension": "mm",
6
- "weight": "g"
7
- },
8
- "products": [
9
- {
10
- "id": "letter_standard",
11
- "name": "Standardbrief",
12
- "dimension_ids": [
13
- "DL",
14
- "C6"
15
- ],
16
- "supported_zones": [
17
- "domestic",
18
- "zone_1_eu",
19
- "world"
20
- ],
21
- "weight_tier": "W0020",
22
- "effective_from": null,
23
- "effective_to": null
24
- },
25
- {
26
- "id": "letter_compact",
27
- "name": "Kompaktbrief",
28
- "dimension_ids": [
29
- "C5"
30
- ],
31
- "supported_zones": [
32
- "domestic",
33
- "zone_1_eu",
34
- "world"
35
- ],
36
- "weight_tier": "W0050",
37
- "effective_from": null,
38
- "effective_to": null
39
- },
40
- {
41
- "id": "letter_large",
42
- "name": "Gro\u00dfbrief",
43
- "dimension_ids": [
44
- "C4"
45
- ],
46
- "supported_zones": [
47
- "domestic",
48
- "zone_1_eu",
49
- "world"
50
- ],
51
- "weight_tier": "W0500",
52
- "effective_from": null,
53
- "effective_to": null
54
- },
55
- {
56
- "id": "letter_maxi",
57
- "name": "Maxibrief",
58
- "dimension_ids": [
59
- "B4"
60
- ],
61
- "supported_zones": [
62
- "domestic",
63
- "zone_1_eu",
64
- "world"
65
- ],
66
- "weight_tier": "W1000",
67
- "effective_from": null,
68
- "effective_to": null
69
- },
70
- {
71
- "id": "merchandise",
72
- "name": "Warensendung",
73
- "dimension_ids": [
74
- "B4"
75
- ],
76
- "supported_zones": [
77
- "domestic"
78
- ],
79
- "weight_tier": "W2000",
80
- "effective_from": null,
81
- "effective_to": null
82
- }
83
- ]
84
- }