@epilot/pricing-client 2.1.1 → 2.1.4
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/LICENSE +21 -0
- package/dist/definition.js +1 -1
- package/dist/index.js +5 -1
- package/dist/openapi.d.ts +254 -98
- package/dist/openapi.json +241 -55
- package/package.json +2 -2
package/dist/openapi.json
CHANGED
|
@@ -562,6 +562,14 @@
|
|
|
562
562
|
"message": {
|
|
563
563
|
"type": "string",
|
|
564
564
|
"description": "Error message"
|
|
565
|
+
},
|
|
566
|
+
"status": {
|
|
567
|
+
"type": "number",
|
|
568
|
+
"description": "The HTTP status code"
|
|
569
|
+
},
|
|
570
|
+
"cause": {
|
|
571
|
+
"type": "string",
|
|
572
|
+
"description": "The cause of the error (visible for bad requests - http 400)"
|
|
565
573
|
}
|
|
566
574
|
}
|
|
567
575
|
},
|
|
@@ -1111,16 +1119,26 @@
|
|
|
1111
1119
|
]
|
|
1112
1120
|
},
|
|
1113
1121
|
"tax": {
|
|
1114
|
-
"type": "object",
|
|
1115
1122
|
"description": "The default tax rate applied to the price",
|
|
1116
|
-
"
|
|
1117
|
-
|
|
1123
|
+
"oneOf": [
|
|
1124
|
+
{
|
|
1125
|
+
"type": "object",
|
|
1126
|
+
"properties": {
|
|
1127
|
+
"$relation": {
|
|
1128
|
+
"type": "array",
|
|
1129
|
+
"items": {
|
|
1130
|
+
"$ref": "#/components/schemas/EntityRelation"
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1118
1136
|
"type": "array",
|
|
1119
1137
|
"items": {
|
|
1120
|
-
"$ref": "#/components/schemas/
|
|
1138
|
+
"$ref": "#/components/schemas/Tax"
|
|
1121
1139
|
}
|
|
1122
1140
|
}
|
|
1123
|
-
|
|
1141
|
+
]
|
|
1124
1142
|
},
|
|
1125
1143
|
"tax_behavior": {
|
|
1126
1144
|
"type": "string",
|
|
@@ -1277,16 +1295,26 @@
|
|
|
1277
1295
|
"description": "A brief description of the price."
|
|
1278
1296
|
},
|
|
1279
1297
|
"price_components": {
|
|
1280
|
-
"type": "object",
|
|
1281
1298
|
"description": "A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.",
|
|
1282
|
-
"
|
|
1283
|
-
|
|
1299
|
+
"oneOf": [
|
|
1300
|
+
{
|
|
1284
1301
|
"type": "array",
|
|
1285
1302
|
"items": {
|
|
1286
|
-
"$ref": "#/components/schemas/
|
|
1303
|
+
"$ref": "#/components/schemas/Price"
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
"type": "object",
|
|
1308
|
+
"properties": {
|
|
1309
|
+
"$relation": {
|
|
1310
|
+
"type": "array",
|
|
1311
|
+
"items": {
|
|
1312
|
+
"$ref": "#/components/schemas/PriceComponentRelation"
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1287
1315
|
}
|
|
1288
1316
|
}
|
|
1289
|
-
|
|
1317
|
+
]
|
|
1290
1318
|
},
|
|
1291
1319
|
"unit_amount_currency": {
|
|
1292
1320
|
"description": "Three-letter ISO currency code, in lowercase.",
|
|
@@ -1336,9 +1364,6 @@
|
|
|
1336
1364
|
"description": "By default, the quantity is set to 1, when greater than 1 this value is used as a multiplicative factor.\nE.g: 16 x Solar Modules - Premium price.\n",
|
|
1337
1365
|
"type": "number"
|
|
1338
1366
|
},
|
|
1339
|
-
"item": {
|
|
1340
|
-
"$ref": "#/components/schemas/Price"
|
|
1341
|
-
},
|
|
1342
1367
|
"_tags": {
|
|
1343
1368
|
"type": "array",
|
|
1344
1369
|
"description": "An arbitrary set of tags attached to the composite price - component relation",
|
|
@@ -1660,11 +1685,12 @@
|
|
|
1660
1685
|
]
|
|
1661
1686
|
}
|
|
1662
1687
|
},
|
|
1663
|
-
"
|
|
1664
|
-
"description": "Represents a valid price item from a client.",
|
|
1688
|
+
"BasePriceItemDto": {
|
|
1689
|
+
"description": "Represents a valid base price item from a client.",
|
|
1665
1690
|
"type": "object",
|
|
1666
1691
|
"properties": {
|
|
1667
1692
|
"metadata": {
|
|
1693
|
+
"description": "An additional structure to keep metadata related with the price item.",
|
|
1668
1694
|
"$ref": "#/components/schemas/MetaData"
|
|
1669
1695
|
},
|
|
1670
1696
|
"quantity": {
|
|
@@ -1683,26 +1709,6 @@
|
|
|
1683
1709
|
"type": "string",
|
|
1684
1710
|
"description": "The id of the price."
|
|
1685
1711
|
},
|
|
1686
|
-
"unit_amount": {
|
|
1687
|
-
"type": "integer",
|
|
1688
|
-
"description": "The unit amount value"
|
|
1689
|
-
},
|
|
1690
|
-
"unit_amount_currency": {
|
|
1691
|
-
"description": "Three-letter ISO currency code, in lowercase.",
|
|
1692
|
-
"oneOf": [
|
|
1693
|
-
{
|
|
1694
|
-
"$ref": "#/components/schemas/Currency"
|
|
1695
|
-
}
|
|
1696
|
-
]
|
|
1697
|
-
},
|
|
1698
|
-
"unit_amount_decimal": {
|
|
1699
|
-
"description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
|
|
1700
|
-
"type": "string"
|
|
1701
|
-
},
|
|
1702
|
-
"is_composite_price": {
|
|
1703
|
-
"description": "The flag for prices that contain price components.",
|
|
1704
|
-
"type": "boolean"
|
|
1705
|
-
},
|
|
1706
1712
|
"taxes": {
|
|
1707
1713
|
"type": "array",
|
|
1708
1714
|
"description": "The taxes applied to the price item.",
|
|
@@ -1727,26 +1733,39 @@
|
|
|
1727
1733
|
]
|
|
1728
1734
|
}
|
|
1729
1735
|
},
|
|
1730
|
-
"_price": {
|
|
1731
|
-
"anyOf": [
|
|
1732
|
-
{
|
|
1733
|
-
"$ref": "#/components/schemas/Price"
|
|
1734
|
-
},
|
|
1735
|
-
{
|
|
1736
|
-
"$ref": "#/components/schemas/CompositePrice"
|
|
1737
|
-
}
|
|
1738
|
-
]
|
|
1739
|
-
},
|
|
1740
1736
|
"_product": {
|
|
1741
|
-
"description": "The product linked to the price item.",
|
|
1737
|
+
"description": "The snapshot of the product linked to the price item.",
|
|
1742
1738
|
"$ref": "#/components/schemas/Product"
|
|
1743
1739
|
}
|
|
1744
1740
|
}
|
|
1745
1741
|
},
|
|
1742
|
+
"PriceItemDto": {
|
|
1743
|
+
"allOf": [
|
|
1744
|
+
{
|
|
1745
|
+
"$ref": "#/components/schemas/BasePriceItemDto"
|
|
1746
|
+
}
|
|
1747
|
+
],
|
|
1748
|
+
"description": "Represents a price input to the pricing library.",
|
|
1749
|
+
"type": "object",
|
|
1750
|
+
"properties": {
|
|
1751
|
+
"unit_amount": {
|
|
1752
|
+
"type": "integer",
|
|
1753
|
+
"description": "The unit amount value"
|
|
1754
|
+
},
|
|
1755
|
+
"unit_amount_decimal": {
|
|
1756
|
+
"description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
|
|
1757
|
+
"type": "string"
|
|
1758
|
+
},
|
|
1759
|
+
"_price": {
|
|
1760
|
+
"description": "The snapshot of the price linked to the price item.",
|
|
1761
|
+
"$ref": "#/components/schemas/Price"
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1746
1765
|
"CompositePriceItemDto": {
|
|
1747
1766
|
"allOf": [
|
|
1748
1767
|
{
|
|
1749
|
-
"$ref": "#/components/schemas/
|
|
1768
|
+
"$ref": "#/components/schemas/BasePriceItemDto"
|
|
1750
1769
|
}
|
|
1751
1770
|
],
|
|
1752
1771
|
"description": "Represents a composite price input to the pricing library.",
|
|
@@ -1758,6 +1777,10 @@
|
|
|
1758
1777
|
"items": {
|
|
1759
1778
|
"$ref": "#/components/schemas/PriceItemDto"
|
|
1760
1779
|
}
|
|
1780
|
+
},
|
|
1781
|
+
"_price": {
|
|
1782
|
+
"description": "The snapshot of the price linked to the price item.",
|
|
1783
|
+
"$ref": "#/components/schemas/CompositePrice"
|
|
1761
1784
|
}
|
|
1762
1785
|
}
|
|
1763
1786
|
},
|
|
@@ -1767,7 +1790,8 @@
|
|
|
1767
1790
|
"properties": {
|
|
1768
1791
|
"rate": {
|
|
1769
1792
|
"type": "string",
|
|
1770
|
-
"
|
|
1793
|
+
"deprecated": true,
|
|
1794
|
+
"description": "The deprecated tax rate applied.\nThis field has been deprecated in favor of the new Tax Management. You should use the new tax fields pointing to a proper tax entity.\n"
|
|
1771
1795
|
},
|
|
1772
1796
|
"tax": {
|
|
1773
1797
|
"description": "The tax applied.",
|
|
@@ -1837,7 +1861,6 @@
|
|
|
1837
1861
|
}
|
|
1838
1862
|
},
|
|
1839
1863
|
"required": [
|
|
1840
|
-
"type",
|
|
1841
1864
|
"amount_subtotal",
|
|
1842
1865
|
"amount_total"
|
|
1843
1866
|
]
|
|
@@ -1997,7 +2020,7 @@
|
|
|
1997
2020
|
"description": "Tracks a set of product prices, quantities, (discounts) and taxes.",
|
|
1998
2021
|
"type": "array",
|
|
1999
2022
|
"items": {
|
|
2000
|
-
"
|
|
2023
|
+
"anyOf": [
|
|
2001
2024
|
{
|
|
2002
2025
|
"$ref": "#/components/schemas/PriceItem"
|
|
2003
2026
|
},
|
|
@@ -2143,7 +2166,14 @@
|
|
|
2143
2166
|
},
|
|
2144
2167
|
"rate": {
|
|
2145
2168
|
"type": "string",
|
|
2146
|
-
"description": "The tax rate applied."
|
|
2169
|
+
"description": "The tax rate applied. With the release of the tax management feature this field is being deprecated in favor of the tax field.",
|
|
2170
|
+
"deprecated": true
|
|
2171
|
+
},
|
|
2172
|
+
"rateValue": {
|
|
2173
|
+
"type": "number",
|
|
2174
|
+
"description": "The tax rate value applied (represented as an integer percentage, e.g, 19 or 7).\nWith the release of the tax management feature this field is being deprecated in favor of the tax field.\n",
|
|
2175
|
+
"example": 19,
|
|
2176
|
+
"deprecated": true
|
|
2147
2177
|
},
|
|
2148
2178
|
"tax": {
|
|
2149
2179
|
"description": "The tax applied.",
|
|
@@ -2155,6 +2185,35 @@
|
|
|
2155
2185
|
}
|
|
2156
2186
|
}
|
|
2157
2187
|
},
|
|
2188
|
+
"TaxAmountBreakdown": {
|
|
2189
|
+
"type": "object",
|
|
2190
|
+
"description": "A tax amount associated with a specific tax rate.",
|
|
2191
|
+
"readOnly": true,
|
|
2192
|
+
"properties": {
|
|
2193
|
+
"amount": {
|
|
2194
|
+
"type": "integer",
|
|
2195
|
+
"description": "The tax amount."
|
|
2196
|
+
},
|
|
2197
|
+
"rate": {
|
|
2198
|
+
"type": "string",
|
|
2199
|
+
"description": "The tax rate applied. With the release of the tax manager feature this field is being deprecated in favor of the tax field.",
|
|
2200
|
+
"deprecated": true
|
|
2201
|
+
},
|
|
2202
|
+
"rateValue": {
|
|
2203
|
+
"type": "number",
|
|
2204
|
+
"description": "The tax rate value applied. With the release of the tax manager feature this field is being deprecated in favor of the tax field.",
|
|
2205
|
+
"deprecated": true
|
|
2206
|
+
},
|
|
2207
|
+
"tax": {
|
|
2208
|
+
"description": "The tax applied.",
|
|
2209
|
+
"oneOf": [
|
|
2210
|
+
{
|
|
2211
|
+
"$ref": "#/components/schemas/TaxBreakdownInfo"
|
|
2212
|
+
}
|
|
2213
|
+
]
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
},
|
|
2158
2217
|
"RecurrenceAmount": {
|
|
2159
2218
|
"type": "object",
|
|
2160
2219
|
"description": "An amount associated with a specific recurrence.",
|
|
@@ -2182,7 +2241,6 @@
|
|
|
2182
2241
|
}
|
|
2183
2242
|
},
|
|
2184
2243
|
"required": [
|
|
2185
|
-
"type",
|
|
2186
2244
|
"amount_subtotal",
|
|
2187
2245
|
"amount_total"
|
|
2188
2246
|
]
|
|
@@ -2210,7 +2268,7 @@
|
|
|
2210
2268
|
"items": {
|
|
2211
2269
|
"oneOf": [
|
|
2212
2270
|
{
|
|
2213
|
-
"$ref": "#/components/schemas/
|
|
2271
|
+
"$ref": "#/components/schemas/TaxAmountBreakdown"
|
|
2214
2272
|
}
|
|
2215
2273
|
]
|
|
2216
2274
|
}
|
|
@@ -2517,6 +2575,62 @@
|
|
|
2517
2575
|
"filename"
|
|
2518
2576
|
]
|
|
2519
2577
|
},
|
|
2578
|
+
"EntityId": {
|
|
2579
|
+
"type": "string",
|
|
2580
|
+
"format": "uuid"
|
|
2581
|
+
},
|
|
2582
|
+
"EntityItem": {
|
|
2583
|
+
"type": "object",
|
|
2584
|
+
"properties": {
|
|
2585
|
+
"_id": {
|
|
2586
|
+
"$ref": "#/components/schemas/EntityId"
|
|
2587
|
+
},
|
|
2588
|
+
"_title": {
|
|
2589
|
+
"type": "string",
|
|
2590
|
+
"description": "Title of entity"
|
|
2591
|
+
},
|
|
2592
|
+
"_org": {
|
|
2593
|
+
"type": "string",
|
|
2594
|
+
"description": "Organization Id the entity belongs to"
|
|
2595
|
+
},
|
|
2596
|
+
"_schema": {
|
|
2597
|
+
"type": "string"
|
|
2598
|
+
},
|
|
2599
|
+
"_tags": {
|
|
2600
|
+
"type": "array",
|
|
2601
|
+
"items": {
|
|
2602
|
+
"type": "string"
|
|
2603
|
+
}
|
|
2604
|
+
},
|
|
2605
|
+
"_created_at": {
|
|
2606
|
+
"type": "string",
|
|
2607
|
+
"format": "date-time"
|
|
2608
|
+
},
|
|
2609
|
+
"_updated_at": {
|
|
2610
|
+
"type": "string",
|
|
2611
|
+
"format": "date-time"
|
|
2612
|
+
}
|
|
2613
|
+
},
|
|
2614
|
+
"required": [
|
|
2615
|
+
"_id",
|
|
2616
|
+
"_title",
|
|
2617
|
+
"_org",
|
|
2618
|
+
"_schema",
|
|
2619
|
+
"_created_at",
|
|
2620
|
+
"_updated_at"
|
|
2621
|
+
],
|
|
2622
|
+
"example": {
|
|
2623
|
+
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
2624
|
+
"_org": "123",
|
|
2625
|
+
"_schema": "contact",
|
|
2626
|
+
"_tags": [
|
|
2627
|
+
"example",
|
|
2628
|
+
"mock"
|
|
2629
|
+
],
|
|
2630
|
+
"_created_at": "2021-02-09T12:41:43.662Z",
|
|
2631
|
+
"_updated_at": "2021-02-09T12:41:43.662Z"
|
|
2632
|
+
}
|
|
2633
|
+
},
|
|
2520
2634
|
"EntityRelation": {
|
|
2521
2635
|
"type": "object",
|
|
2522
2636
|
"additionalProperties": true,
|
|
@@ -2539,9 +2653,43 @@
|
|
|
2539
2653
|
"required": [
|
|
2540
2654
|
"type",
|
|
2541
2655
|
"rate",
|
|
2542
|
-
"behavior"
|
|
2656
|
+
"behavior",
|
|
2657
|
+
"_id",
|
|
2658
|
+
"_title",
|
|
2659
|
+
"_org",
|
|
2660
|
+
"_schema",
|
|
2661
|
+
"_created_at",
|
|
2662
|
+
"_updated_at"
|
|
2543
2663
|
],
|
|
2544
2664
|
"properties": {
|
|
2665
|
+
"_id": {
|
|
2666
|
+
"$ref": "#/components/schemas/EntityId"
|
|
2667
|
+
},
|
|
2668
|
+
"_title": {
|
|
2669
|
+
"type": "string",
|
|
2670
|
+
"description": "Title of entity"
|
|
2671
|
+
},
|
|
2672
|
+
"_org": {
|
|
2673
|
+
"type": "string",
|
|
2674
|
+
"description": "Organization Id the entity belongs to"
|
|
2675
|
+
},
|
|
2676
|
+
"_schema": {
|
|
2677
|
+
"type": "string"
|
|
2678
|
+
},
|
|
2679
|
+
"_tags": {
|
|
2680
|
+
"type": "array",
|
|
2681
|
+
"items": {
|
|
2682
|
+
"type": "string"
|
|
2683
|
+
}
|
|
2684
|
+
},
|
|
2685
|
+
"_created_at": {
|
|
2686
|
+
"type": "string",
|
|
2687
|
+
"format": "date-time"
|
|
2688
|
+
},
|
|
2689
|
+
"_updated_at": {
|
|
2690
|
+
"type": "string",
|
|
2691
|
+
"format": "date-time"
|
|
2692
|
+
},
|
|
2545
2693
|
"type": {
|
|
2546
2694
|
"type": "string",
|
|
2547
2695
|
"enum": [
|
|
@@ -2560,7 +2708,9 @@
|
|
|
2560
2708
|
"type": "string",
|
|
2561
2709
|
"enum": [
|
|
2562
2710
|
"Exclusive",
|
|
2563
|
-
"Inclusive"
|
|
2711
|
+
"Inclusive",
|
|
2712
|
+
"exclusive",
|
|
2713
|
+
"inclusive"
|
|
2564
2714
|
]
|
|
2565
2715
|
},
|
|
2566
2716
|
"active": {
|
|
@@ -2572,6 +2722,42 @@
|
|
|
2572
2722
|
"region_label": {
|
|
2573
2723
|
"type": "string"
|
|
2574
2724
|
}
|
|
2725
|
+
},
|
|
2726
|
+
"example": {
|
|
2727
|
+
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
2728
|
+
"type": "VAT",
|
|
2729
|
+
"description": "Tax description",
|
|
2730
|
+
"behavior": "Exclusive",
|
|
2731
|
+
"active": "true",
|
|
2732
|
+
"region": "DE",
|
|
2733
|
+
"region_label": "Germany",
|
|
2734
|
+
"_org": "123",
|
|
2735
|
+
"_schema": "tax",
|
|
2736
|
+
"_tags": [
|
|
2737
|
+
"example",
|
|
2738
|
+
"mock"
|
|
2739
|
+
],
|
|
2740
|
+
"_created_at": "2021-02-09T12:41:43.662Z",
|
|
2741
|
+
"_updated_at": "2021-02-09T12:41:43.662Z"
|
|
2742
|
+
}
|
|
2743
|
+
},
|
|
2744
|
+
"TaxBreakdownInfo": {
|
|
2745
|
+
"type": "object",
|
|
2746
|
+
"properties": {
|
|
2747
|
+
"rate": {
|
|
2748
|
+
"type": "number"
|
|
2749
|
+
},
|
|
2750
|
+
"type": {
|
|
2751
|
+
"type": "string",
|
|
2752
|
+
"enum": [
|
|
2753
|
+
"VAT",
|
|
2754
|
+
"GST",
|
|
2755
|
+
"Custom"
|
|
2756
|
+
]
|
|
2757
|
+
},
|
|
2758
|
+
"_id": {
|
|
2759
|
+
"type": "string"
|
|
2760
|
+
}
|
|
2575
2761
|
}
|
|
2576
2762
|
}
|
|
2577
2763
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/pricing-client",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "Client for epilot Pricing APIs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"webpack": "~5.18.0",
|
|
70
70
|
"webpack-cli": "^4.4.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f536b90339a38b0f29e0ad3ee0fa25df0fd2df78"
|
|
73
73
|
}
|