@epilot/metering-client 0.5.5 → 0.5.6

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/dist/openapi.json CHANGED
@@ -20,6 +20,9 @@
20
20
  },
21
21
  {
22
22
  "PortalAuth": []
23
+ },
24
+ {
25
+ "EitherAuth": []
23
26
  }
24
27
  ],
25
28
  "paths": {
@@ -47,7 +50,19 @@
47
50
  "data": {
48
51
  "type": "array",
49
52
  "items": {
50
- "$ref": "#/components/schemas/Meter"
53
+ "allOf": [
54
+ {
55
+ "$ref": "#/components/schemas/Meter"
56
+ },
57
+ {
58
+ "type": "object",
59
+ "properties": {
60
+ "journey_actions": {
61
+ "$ref": "#/components/schemas/JourneyActions"
62
+ }
63
+ }
64
+ }
65
+ ]
51
66
  }
52
67
  }
53
68
  }
@@ -228,6 +243,9 @@
228
243
  "entity": {
229
244
  "$ref": "#/components/schemas/Meter"
230
245
  },
246
+ "journey_actions": {
247
+ "$ref": "#/components/schemas/JourneyActions"
248
+ },
231
249
  "relations": {
232
250
  "type": "array",
233
251
  "items": {
@@ -275,8 +293,7 @@
275
293
  "name": "meter_id",
276
294
  "required": true,
277
295
  "schema": {
278
- "type": "string",
279
- "example": "1446829f-4b6f-474e-b978-3997d89a7928"
296
+ "$ref": "#/components/schemas/EntityId"
280
297
  }
281
298
  }
282
299
  ],
@@ -380,10 +397,7 @@
380
397
  ],
381
398
  "security": [
382
399
  {
383
- "EpilotAuth": []
384
- },
385
- {
386
- "PortalAuth": []
400
+ "EitherAuth": []
387
401
  }
388
402
  ],
389
403
  "requestBody": {
@@ -439,10 +453,7 @@
439
453
  ],
440
454
  "security": [
441
455
  {
442
- "EpilotAuth": []
443
- },
444
- {
445
- "PortalAuth": []
456
+ "EitherAuth": []
446
457
  }
447
458
  ],
448
459
  "requestBody": {
@@ -592,10 +603,7 @@
592
603
  ],
593
604
  "security": [
594
605
  {
595
- "EpilotAuth": []
596
- },
597
- {
598
- "PortalAuth": []
606
+ "EitherAuth": []
599
607
  }
600
608
  ],
601
609
  "parameters": [
@@ -732,10 +740,7 @@
732
740
  ],
733
741
  "security": [
734
742
  {
735
- "EpilotAuth": []
736
- },
737
- {
738
- "PortalAuth": []
743
+ "EitherAuth": []
739
744
  }
740
745
  ],
741
746
  "parameters": [
@@ -1055,10 +1060,7 @@
1055
1060
  ],
1056
1061
  "security": [
1057
1062
  {
1058
- "EpilotAuth": []
1059
- },
1060
- {
1061
- "PortalAuth": []
1063
+ "EitherAuth": []
1062
1064
  }
1063
1065
  ],
1064
1066
  "parameters": [
@@ -1204,16 +1206,6 @@
1204
1206
  }
1205
1207
  }
1206
1208
  },
1207
- "NotFound": {
1208
- "description": "The specified resource was not found",
1209
- "content": {
1210
- "application/json": {
1211
- "schema": {
1212
- "$ref": "#/components/schemas/ErrorResp"
1213
- }
1214
- }
1215
- }
1216
- },
1217
1209
  "InternalServerError": {
1218
1210
  "description": "Internal Server Error",
1219
1211
  "content": {
@@ -1237,6 +1229,11 @@
1237
1229
  "scheme": "bearer",
1238
1230
  "description": "Authorization header with customer portal OAuth2 bearer token",
1239
1231
  "bearerFormat": "JWT"
1232
+ },
1233
+ "EitherAuth": {
1234
+ "type": "http",
1235
+ "scheme": "bearer",
1236
+ "description": "Portal or Epilot Bearer Token"
1240
1237
  }
1241
1238
  },
1242
1239
  "schemas": {
@@ -1250,12 +1247,8 @@
1250
1247
  }
1251
1248
  },
1252
1249
  "EntityId": {
1253
- "type": "string"
1254
- },
1255
- "EntitySlug": {
1256
- "description": "URL-friendly identifier for the entity schema",
1257
1250
  "type": "string",
1258
- "example": "contact"
1251
+ "format": "uuid"
1259
1252
  },
1260
1253
  "BaseEntity": {
1261
1254
  "type": "object",
@@ -1329,8 +1322,7 @@
1329
1322
  "type": "object",
1330
1323
  "properties": {
1331
1324
  "entity_id": {
1332
- "type": "string",
1333
- "example": "9a2081a2-1615-44b8-b988-d757983290dd"
1325
+ "$ref": "#/components/schemas/EntityId"
1334
1326
  },
1335
1327
  "_slug": {
1336
1328
  "type": "string",
@@ -1508,13 +1500,11 @@
1508
1500
  "description": "The reason for recording the reading"
1509
1501
  },
1510
1502
  "meter_id": {
1511
- "type": "string",
1512
- "example": "1446829f-4b6f-474e-b978-3997d89a7928",
1503
+ "$ref": "#/components/schemas/EntityId",
1513
1504
  "description": "The ID of the associated meter"
1514
1505
  },
1515
1506
  "counter_id": {
1516
- "type": "string",
1517
- "example": "991a1821-43bc-46b8-967d-64a3d87c31f8",
1507
+ "$ref": "#/components/schemas/EntityId",
1518
1508
  "description": "The ID of the associated meter counter"
1519
1509
  },
1520
1510
  "direction": {
@@ -1558,8 +1548,7 @@
1558
1548
  ],
1559
1549
  "properties": {
1560
1550
  "_id": {
1561
- "type": "string",
1562
- "example": "991a1821-43bc-46b8-967d-64a3d87c31f8"
1551
+ "$ref": "#/components/schemas/EntityId"
1563
1552
  },
1564
1553
  "_schema": {
1565
1554
  "type": "string",
@@ -1661,12 +1650,12 @@
1661
1650
  }
1662
1651
  }
1663
1652
  },
1664
- "SubmissionMeterReading": {
1653
+ "AuthenticatedSubmission": {
1665
1654
  "type": "object",
1655
+ "nullable": true,
1666
1656
  "required": [
1667
1657
  "meterId"
1668
1658
  ],
1669
- "nullable": true,
1670
1659
  "properties": {
1671
1660
  "meterId": {
1672
1661
  "$ref": "#/components/schemas/Id",
@@ -1679,6 +1668,36 @@
1679
1668
  },
1680
1669
  "description": "- The counter readings of a meter\n- This is only sent when the user is authenticated while submitting a journey\n"
1681
1670
  },
1671
+ "readingDate": {
1672
+ "type": "string",
1673
+ "description": "If the value is not provided, the system will be set with the time the request is processed.",
1674
+ "example": "2022-10-10T10:10:00.000Z"
1675
+ },
1676
+ "readBy": {
1677
+ "type": "string",
1678
+ "example": "John Doe",
1679
+ "description": "The person who recorded the reading"
1680
+ },
1681
+ "reason": {
1682
+ "type": "string",
1683
+ "example": "Storing the feed-in record",
1684
+ "description": "The reason for recording the reading"
1685
+ },
1686
+ "maloId": {
1687
+ "type": "string",
1688
+ "example": "A09-123",
1689
+ "description": "The MA-LO ID of the meter"
1690
+ }
1691
+ }
1692
+ },
1693
+ "UnauthenticatedSubmission": {
1694
+ "type": "object",
1695
+ "nullable": true,
1696
+ "properties": {
1697
+ "meterId": {
1698
+ "$ref": "#/components/schemas/Id",
1699
+ "description": "The ID of the associated meter"
1700
+ },
1682
1701
  "readingValue": {
1683
1702
  "type": "number",
1684
1703
  "example": 240,
@@ -1704,11 +1723,6 @@
1704
1723
  "example": "A09-123",
1705
1724
  "description": "The MA-LO ID of the meter"
1706
1725
  },
1707
- "obisNumber": {
1708
- "type": "string",
1709
- "example": "A-34",
1710
- "description": "The OBIS number of the meter counter"
1711
- },
1712
1726
  "readingUnit": {
1713
1727
  "$ref": "#/components/schemas/Unit",
1714
1728
  "description": "The unit of measurement for the reading"
@@ -1744,6 +1758,16 @@
1744
1758
  }
1745
1759
  }
1746
1760
  },
1761
+ "SubmissionMeterReading": {
1762
+ "oneOf": [
1763
+ {
1764
+ "$ref": "#/components/schemas/AuthenticatedSubmission"
1765
+ },
1766
+ {
1767
+ "$ref": "#/components/schemas/UnauthenticatedSubmission"
1768
+ }
1769
+ ]
1770
+ },
1747
1771
  "Unit": {
1748
1772
  "type": "string",
1749
1773
  "enum": [
@@ -1772,6 +1796,61 @@
1772
1796
  "journey-submission"
1773
1797
  ]
1774
1798
  },
1799
+ "ActionLabel": {
1800
+ "type": "object",
1801
+ "properties": {
1802
+ "en": {
1803
+ "type": "string",
1804
+ "nullable": true
1805
+ },
1806
+ "de": {
1807
+ "type": "string",
1808
+ "nullable": true
1809
+ }
1810
+ }
1811
+ },
1812
+ "Rule": {
1813
+ "type": "object",
1814
+ "properties": {
1815
+ "entity": {
1816
+ "type": "string",
1817
+ "nullable": true
1818
+ },
1819
+ "attribute": {
1820
+ "type": "string",
1821
+ "nullable": true
1822
+ },
1823
+ "attribute_value": {
1824
+ "type": "string",
1825
+ "nullable": true
1826
+ }
1827
+ }
1828
+ },
1829
+ "JourneyActions": {
1830
+ "type": "object",
1831
+ "properties": {
1832
+ "journey_id": {
1833
+ "type": "string",
1834
+ "nullable": true
1835
+ },
1836
+ "action_label": {
1837
+ "type": "object",
1838
+ "$ref": "#/components/schemas/ActionLabel",
1839
+ "nullable": true
1840
+ },
1841
+ "slug": {
1842
+ "type": "string",
1843
+ "nullable": true
1844
+ },
1845
+ "rules": {
1846
+ "type": "array",
1847
+ "items": {
1848
+ "$ref": "#/components/schemas/Rule"
1849
+ },
1850
+ "nullable": true
1851
+ }
1852
+ }
1853
+ },
1775
1854
  "ReadingWithMeter": {
1776
1855
  "type": "object",
1777
1856
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/metering-client",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "API Client for epilot Metering API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -48,7 +48,6 @@
48
48
  "axios": "^1.6.2"
49
49
  },
50
50
  "dependencies": {
51
- "ajv": "^8.16.0",
52
51
  "buffer": "^6.0.3",
53
52
  "https-browserify": "^1.0.0",
54
53
  "openapi-client-axios": "^7.5.1",
@@ -71,4 +70,4 @@
71
70
  "webpack": "^5.18.0",
72
71
  "webpack-cli": "^4.4.0"
73
72
  }
74
- }
73
+ }